int LineEdit::PlaceCaretNoG(int newcursor, bool sel) { if(newcursor > total) newcursor = total; Point p = GetColumnLine(newcursor); if(sel) { if(anchor < 0) { anchor = cursor; } if(rectsel || rectsel != dorectsel) Refresh(); else RefreshLines(p.y, GetLine(cursor)); rectsel = dorectsel; } else { if(anchor >= 0) { if(rectsel || dorectsel) Refresh(); else RefreshLines(GetLine(cursor), GetLine(anchor)); anchor = -1; } rectsel = false; } RefreshLine(GetColumnLine(cursor).y); RefreshLine(p.y); cursor = newcursor; ScrollIntoCursor(); PlaceCaret0(p); SelectionChanged(); WhenSel(); if(IsAnySelection()) SetSelectionSource(ClipFmtsText()); return p.x; }
int LineEdit::PlaceCaretNoG(int newcursor, bool sel) { if(newcursor > total) newcursor = total; Point p = GetColumnLine(newcursor); if(sel) { if(anchor < 0) { anchor = cursor; } RefreshLines(p.y, GetLine(cursor)); } else if(anchor >= 0) { RefreshLines(GetLine(cursor), GetLine(anchor)); anchor = -1; } cursor = newcursor; ScrollIntoCursor(); PlaceCaret0(p); SelectionChanged(); WhenSel(); if(IsSelection()) SetSelectionSource(ClipFmtsText()); return p.x; }
LineEdit& LineEdit::TabSize(int n) { tabsize = n; PlaceCaret0(GetColumnLine(cursor)); Refresh(); return *this; }
void LineEdit::Scroll() { PlaceCaret0(GetColumnLine(cursor)); scroller.Scroll(*this, GetSize(), sb.Get(), GetFontSize()); SetHBar(); NewScrollPos(); }