mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
CtrlLib: Fixed selection issue in DocEdit/LineEdit
git-svn-id: svn://ultimatepp.org/upp/trunk@12946 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
c34cc4236a
commit
7020c8fafb
2 changed files with 9 additions and 6 deletions
|
|
@ -240,9 +240,8 @@ void DocEdit::PlaceCaret(int64 newpos, bool select) {
|
|||
newpos = GetLength32();
|
||||
int z = GetLine(newpos);
|
||||
if(select) {
|
||||
if(anchor < 0) {
|
||||
if(anchor < 0)
|
||||
anchor = cursor;
|
||||
}
|
||||
RefreshLines(z, GetLine(cursor));
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -810,6 +810,7 @@ int TextCtrl::Insert0(int pos, const WString& txt) { // TODO: Do this with utf8
|
|||
total += size;
|
||||
SetSb();
|
||||
Update();
|
||||
ClearSelection();
|
||||
PostInsert(inspos, txt);
|
||||
return size;
|
||||
}
|
||||
|
|
@ -851,6 +852,7 @@ void TextCtrl::Remove0(int pos, int size) {
|
|||
Refresh();
|
||||
}
|
||||
Update();
|
||||
ClearSelection();
|
||||
PostRemove(rmpos, rmsize);
|
||||
SetSb();
|
||||
}
|
||||
|
|
@ -1010,10 +1012,12 @@ void TextCtrl::Redo() {
|
|||
}
|
||||
|
||||
void TextCtrl::ClearSelection() {
|
||||
anchor = -1;
|
||||
Refresh();
|
||||
SelectionChanged();
|
||||
WhenSel();
|
||||
if(anchor >= 0) {
|
||||
anchor = -1;
|
||||
Refresh();
|
||||
SelectionChanged();
|
||||
WhenSel();
|
||||
}
|
||||
}
|
||||
|
||||
void TextCtrl::SetSelection(int64 l, int64 h) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue