diff options
author | nyamatongwe <unknown> | 2000-06-24 00:35:46 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2000-06-24 00:35:46 +0000 |
commit | d54dd98c5183dd6d38e9556ce1e8dd45670a5c39 (patch) | |
tree | 1bb9e279d9cc08a6c6f649cf18c2e60326a06078 /src | |
parent | e8ec55130f8cc49fb3b7ce9863e4c73f5c35cb5b (diff) | |
download | scintilla-mirror-d54dd98c5183dd6d38e9556ce1e8dd45670a5c39.tar.gz |
Added methods for getting and setting the start and end of the selection.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index abfa947f0..d55b88095 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3320,12 +3320,34 @@ LRESULT Editor::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam) { case SCI_GETCHARAT: return pdoc->CharAt(wParam); + case SCI_SETCURRENTPOS: + SetSelection(wParam, anchor); + break; + case SCI_GETCURRENTPOS: return currentPos; + case SCI_SETANCHOR: + SetSelection(currentPos, wParam); + break; + case SCI_GETANCHOR: return anchor; + case SCI_SETSELECTIONSTART: + SetSelection(Platform::Maximum(currentPos, wParam), wParam); + break; + + case SCI_GETSELECTIONSTART: + return Platform::Minimum(anchor, currentPos); + + case SCI_SETSELECTIONEND: + SetSelection(wParam, Platform::Minimum(anchor, wParam)); + break; + + case SCI_GETSELECTIONEND: + return Platform::Maximum(anchor, currentPos); + case SCI_GETSTYLEAT: if (static_cast<short>(wParam) >= pdoc->Length()) return 0; @@ -3387,10 +3409,6 @@ LRESULT Editor::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam) { Redraw(); break; - case SCI_SETANCHOR: - SetSelection(currentPos, wParam); - break; - case SCI_GETCURLINE: { if (lParam == 0) return 0; |