aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2000-06-24 00:35:46 +0000
committernyamatongwe <devnull@localhost>2000-06-24 00:35:46 +0000
commit94b9dc447ea7ca09745e4a8e2d8786fda5655962 (patch)
tree1bb9e279d9cc08a6c6f649cf18c2e60326a06078 /src/Editor.cxx
parenta53dd61d8a62229c0d3cc6f1afb314ae7e0fb8c3 (diff)
downloadscintilla-mirror-94b9dc447ea7ca09745e4a8e2d8786fda5655962.tar.gz
Added methods for getting and setting the start and end of the selection.rel-1-27
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx26
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;