mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-28 06:12:53 -06:00
ide: Refining find&replace
git-svn-id: svn://ultimatepp.org/upp/trunk@7484 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
610034ad10
commit
755d38cba8
5 changed files with 26 additions and 16 deletions
|
|
@ -215,7 +215,8 @@ void CodeEditor::SelectionChanged()
|
|||
{
|
||||
int l, h;
|
||||
WString nselword;
|
||||
if(GetSelection(l, h) && h - l < 128 &&
|
||||
bool sel = GetSelection(l, h);
|
||||
if(sel && h - l < 128 &&
|
||||
(l == 0 || !iscid(GetChar(l - 1))) &&
|
||||
(h >= GetLength() || !iscid(GetChar(h)))) {
|
||||
for(int i = l; i < h; i++) {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ void CodeEditor::InitFindReplace()
|
|||
|
||||
FindReplaceDlg::FindReplaceDlg()
|
||||
{
|
||||
ignorecase <<= THISBACK(Sync);
|
||||
find.NoUpDownKeys();
|
||||
samecase <<= true;
|
||||
close.Cancel();
|
||||
prev.SetImage(CtrlImg::SmallUp());
|
||||
|
|
@ -54,7 +54,7 @@ bool FindReplaceDlg::Key(dword key, int cnt) {
|
|||
next.WhenAction();
|
||||
return true;
|
||||
}
|
||||
if(findarg(key, K_TAB, K_SHIFT_TAB, K_UP, K_DOWN) >= 0 && replace.IsShown()) {
|
||||
if(findarg(key, K_TAB, K_SHIFT_TAB) >= 0 && replace.IsShown()) {
|
||||
if(find.HasFocus())
|
||||
replace.SetFocus();
|
||||
else
|
||||
|
|
@ -641,6 +641,7 @@ void CodeEditor::CloseFindReplace()
|
|||
|
||||
void CodeEditor::IncrementalFind()
|
||||
{
|
||||
findreplace.Sync();
|
||||
if(!findreplace.incremental || findreplace.GetTopCtrl() == &findreplace) // || we are block replace
|
||||
return;
|
||||
int l, h;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ DropChoice::DropChoice() {
|
|||
EnableDrop(false);
|
||||
dropwidth = 0;
|
||||
appending = false;
|
||||
updownkeys = true;
|
||||
}
|
||||
|
||||
void DropChoice::EnableDrop(bool b)
|
||||
|
|
@ -83,6 +84,8 @@ bool DropChoice::DoKey(dword key) {
|
|||
PseudoPush();
|
||||
return true;
|
||||
case K_DOWN:
|
||||
if(!updownkeys)
|
||||
return false;
|
||||
if(appending)
|
||||
PseudoPush();
|
||||
else {
|
||||
|
|
@ -91,6 +94,8 @@ bool DropChoice::DoKey(dword key) {
|
|||
}
|
||||
return true;
|
||||
case K_UP:
|
||||
if(!updownkeys)
|
||||
return false;
|
||||
if(appending)
|
||||
PseudoPush();
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -160,6 +160,7 @@ protected:
|
|||
bool appending;
|
||||
bool dropfocus;
|
||||
bool always_drop;
|
||||
bool updownkeys;
|
||||
|
||||
void Select();
|
||||
void Drop();
|
||||
|
|
@ -203,7 +204,7 @@ public:
|
|||
|
||||
DropChoice& DropWidth(int w) { dropwidth = w; return *this; }
|
||||
DropChoice& DropWidthZ(int w) { dropwidth = HorzLayoutZoom(w); return *this; }
|
||||
|
||||
DropChoice& UpDownKeys(bool b = true) { updownkeys = b; return *this; }
|
||||
|
||||
DropChoice& SetScrollBarStyle(const ScrollBar::Style& s) { list.SetScrollBarStyle(s); return *this; }
|
||||
|
||||
|
|
@ -265,9 +266,10 @@ public:
|
|||
WithDropChoice& AlwaysDrop(bool b = true) { select.AlwaysDrop(b); return *this; }
|
||||
WithDropChoice& WithWheel(bool b = true) { withwheel = b; return *this; }
|
||||
WithDropChoice& NoWithWheel() { return WithWheel(false); }
|
||||
|
||||
WithDropChoice& DropWidth(int w) { select.DropWidth(w); return *this; }
|
||||
WithDropChoice& DropWidthZ(int w) { select.DropWidthZ(w); return *this; }
|
||||
WithDropChoice& UpDownKeys(bool b = true) { select.UpDownKeys(b); return *this; }
|
||||
WithDropChoice& NoUpDownKeys() { return UpDownKeys(false); }
|
||||
|
||||
WithDropChoice();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -18,17 +18,7 @@ topic "WithDropChoice";
|
|||
[s0;%% &]
|
||||
[s2;%%
|
||||
@@image:1350&331
|
||||
們貈祤€€兯<EFBFBD>€€€€<EFBFBD>滍湵污榔榾笫记咄<EFBFBD>小氆茒唵疇插ㄐ辶卢潹蕘垔谅<EFBFBD>聙堈诈幈谍勅<EFBFBD>叮<EFBFBD>
|
||||
屆斪交х角鑫棼魨缍睋狚苠鸂<EFBFBD><EFBFBD><EFBFBD>張瓐脽军嬝硬茙脌挕疵▊彑瘺嬶戊敵煤絼鈵牢<EFBFBD><EFBFBD>㈧敵煤勨
|
||||
邜狐<EFBFBD>囤镑貨播飰<EFBFBD>獓哉睚茬巡螟<EFBFBD><EFBFBD><EFBFBD><EFBFBD>椟堅幙╇祢制屄濇嫕距铤患欨桉赤枸坎釃输錆哒︸<EFBFBD>
|
||||
奸介蝤摎礋愜顷贶<EFBFBD>軋捾懒<EFBFBD><EFBFBD>掲圍鰢垊屪櫙扇<EFBFBD><EFBFBD>溡棽楛湗収鞏徧稗动п<EFBFBD><EFBFBD>ǔ帀<EFBFBD>啜彁<EFBFBD><EFBFBD>
|
||||
违革鹎鋽胚奥<EFBFBD>擢瓏盲椇撼葫<EFBFBD>易榉胼秆勈裆昼颂税毄霌膣髋壭喀羔飶钳<EFBFBD>攳<EFBFBD>嗗红イ弄犰<EFBFBD>
|
||||
<EFBFBD><EFBFBD>蟻飧雭胞幔澛癀荃棂兑≤攪煼仾捹浴馍隄贮€是蒯虛钖忾摇亨澵帟鲹<EFBFBD><EFBFBD>肆鵂禍徲寲缺樖耗
|
||||
迼斾紦<EFBFBD>嵱廃^痨冞〔荧浱免樖深锓豉<EFBFBD>斛澹叅栀狳穵紫笅瑁し佣阼町藠狠<EFBFBD>摺绝尡帍埗黍
|
||||
亱嬽裳婆麢牫寚駜<EFBFBD>堎斾骁<EFBFBD>讝椱蹧胁党<EFBFBD>詳垆戬灴<EFBFBD>赎琮妿缙嵀訉棤﹂儋♀∫『屶覈榭羻
|
||||
<EFBFBD>澓剹犆狆伜剹犆鲳伇澲笓螡妵駩軃蕩羺钀軃矌羺丕€嬙盀倠小袱酪噣ィ骺ㄨ濎镯堕字泲嬽<EFBFBD>
|
||||
凉俟煴黪辂訑<EFBFBD><EFBFBD>钹<EFBFBD>巩Л<EFBFBD><EFBFBD>磮公椷<EFBFBD>橒遣娫蕢谊臌<EFBFBD>莆能诊催朱吳颔俩詥坦嵄瀳<EFBFBD><EFBFBD>厢<EFBFBD>
|
||||
傜婧
|
||||
(A9gANQAAAMv/AAAAAHic7ZyxTttAGIDzSjxH36EP0KFrK8YGhi6gMmUoZUFCLJ0oyogKQUItIkIIVVUpDjE1hEilhbaj+0MU1707J2fHds7o+/QNtrGTIH3c5SCmf/mpj4iIQ5++fItYssYOQ4ASoUMogg+frxvvzmyUM0M6hGKQwM77f2yUM0M6hGKQuvyr3zbad1gbMqXvCaqH1NXt/bLRssN4fvmmaP9o/AhUDqnr7PLWxgwd5gsdPmDuO7wZ+Ojxs2hbPzJhh8pkHd9VJvGkaT3p8viTGh8Q3Efq6lzciJLcwMGufmSS94f69oiEjFcZL0l6NCKsHFKXF/wcGIWnbA/MsF62Lyf8fygzDon6YKiPkPrTQSW47/BHZJTfMMJ/Xyqtw6SXOjozOqw0Utfpt+u4UYTK8UnWy8zLMBqp6+v5d0WJUD844e8PR68slI2khYblOiUkxaph7NAof0+B4rjrsHthIx1Ccdx16Hk20iEUB5+3gSqS1CFiyeod1gBKx9jhzJMWYmnSIbrg2A6V95NTf8H4ILUcD9MWSLGYSjpEF5TkvJN9v9MO/KNecGzfoTJTKxtM4phKSW5vt3l4sHX65aOkaNlhfDcKz7iLaKMkt7baaG6uS4pdr23fob54MQ6PiDZKcosLdUlRRkWZoDOMh/GDdIjZlOTm52ZXlpda2xsyNTMv41SU5Oovnr95/WrnfYoOZ8atU4yXICZp2SFiodIhumBSh+k/QQaQHToEF6BDcAE6BBegQ3CBsR3WuJMdiofxEFyADsEF6BBcgA7BBVingAswHoIL0CG4QFKHACWjd6jonezv7TbXVhuLC/X5uVk5HzF39ftTFP1O+/Bgq7m5LqetLC9JtIi5q9+vpxj4RzJUygnSamt7Q0ZOxNzV719W7AXH8iWpVAZMOQ2xCOP/z+EvcWfmOg==)
|
||||
&]
|
||||
[s0;%% &]
|
||||
[s9;%% This template class adds a list of choices, with drop down
|
||||
|
|
@ -158,6 +148,17 @@ hoice][@(0.0.255) `&]_[* SetDisplay]([@(0.0.255) const]_[_^Display^ Display][@(0
|
|||
zooming [%-*@3 w] in accordance with font scaling.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:WithDropChoice`:`:UpDownKeys`(bool`): [_^WithDropChoice^ WithDropChoice][@(0.0.255) `&
|
||||
]_[* UpDownKeys]([@(0.0.255) bool]_[*@3 b]_`=_[@(0.0.255) true])&]
|
||||
[s2;%% If active, Up and Down keys cycle through the history. Default
|
||||
is active..&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:WithDropChoice`:`:NoUpDownKeys`(`): [_^WithDropChoice^ WithDropChoice][@(0.0.255) `&
|
||||
]_[* NoUpDownKeys]()&]
|
||||
[s2;%% Same as UpDownKeys(false).&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:WithDropChoice`:`:GetCount`(`)const: [@(0.0.255) int]_[* GetCount]()_[@(0.0.255) const
|
||||
]&]
|
||||
[s2;%% Returns the number of items in the drop down list.&]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue