diff --git a/uppsrc/CodeEditor/CodeEditor.cpp b/uppsrc/CodeEditor/CodeEditor.cpp index 8150a7668..304bc0684 100644 --- a/uppsrc/CodeEditor/CodeEditor.cpp +++ b/uppsrc/CodeEditor/CodeEditor.cpp @@ -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++) { diff --git a/uppsrc/CodeEditor/FindReplace.cpp b/uppsrc/CodeEditor/FindReplace.cpp index 6583a90ea..8f79cf390 100644 --- a/uppsrc/CodeEditor/FindReplace.cpp +++ b/uppsrc/CodeEditor/FindReplace.cpp @@ -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; diff --git a/uppsrc/CtrlLib/DropChoice.cpp b/uppsrc/CtrlLib/DropChoice.cpp index f9311d2df..b5adaac27 100644 --- a/uppsrc/CtrlLib/DropChoice.cpp +++ b/uppsrc/CtrlLib/DropChoice.cpp @@ -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 { diff --git a/uppsrc/CtrlLib/DropChoice.h b/uppsrc/CtrlLib/DropChoice.h index c35b67001..edb4e67fa 100644 --- a/uppsrc/CtrlLib/DropChoice.h +++ b/uppsrc/CtrlLib/DropChoice.h @@ -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(); }; diff --git a/uppsrc/CtrlLib/src.tpp/WithDropChoice$en-us.tpp b/uppsrc/CtrlLib/src.tpp/WithDropChoice$en-us.tpp index 2383a7e79..59f93b74b 100644 --- a/uppsrc/CtrlLib/src.tpp/WithDropChoice$en-us.tpp +++ b/uppsrc/CtrlLib/src.tpp/WithDropChoice$en-us.tpp @@ -18,17 +18,7 @@ topic "WithDropChoice"; [s0;%% &] [s2;%% @@image:1350&331 -؀휱Ƙʼ͡СƊ¬ʁ­€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TbXVhuLC/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.&]