aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2010-10-11 21:40:17 +1100
committernyamatongwe <unknown>2010-10-11 21:40:17 +1100
commit66c09167ac82b63f4584ffd28ad425194811595b (patch)
tree7ac755258f485f98c53e4fe7423831d5a24040c1 /src/Editor.cxx
parent54cd02b4bbe654fea892975d46cd9071a7fc891e (diff)
downloadscintilla-mirror-66c09167ac82b63f4584ffd28ad425194811595b.tar.gz
Feature request #3082409 implemented for SCN_HOTSPOTRELEASECLICK event.
Contributed by Farshid Lashkari.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index d180e6194..681cb12cd 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -135,6 +135,7 @@ Editor::Editor() {
dropWentOutside = false;
posDrag = SelectionPosition(invalidPosition);
posDrop = SelectionPosition(invalidPosition);
+ hotSpotClickPos = INVALID_POSITION;
selectionType = selChar;
lastXChosen = 0;
@@ -4198,6 +4199,15 @@ void Editor::NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt)
NotifyParent(scn);
}
+void Editor::NotifyHotSpotReleaseClick(int position, bool shift, bool ctrl, bool alt) {
+ SCNotification scn = {0};
+ scn.nmhdr.code = SCN_HOTSPOTRELEASECLICK;
+ scn.position = position;
+ scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
+ (alt ? SCI_ALT : 0);
+ NotifyParent(scn);
+}
+
void Editor::NotifyUpdateUI() {
SCNotification scn = {0};
scn.nmhdr.code = SCN_UPDATEUI;
@@ -5939,6 +5949,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
} else {
if (PointIsHotspot(pt)) {
NotifyHotSpotClicked(newPos.Position(), shift, ctrl, alt);
+ hotSpotClickPos = PositionFromLocation(pt,true,false);
}
if (!shift) {
if (PointInSelection(pt) && !SelectionEmpty())
@@ -6118,6 +6129,13 @@ void Editor::ButtonMove(Point pt) {
if (hsStart != -1 && !PositionIsHotspot(movePos.Position()))
SetHotSpotRange(NULL);
+ if (hotSpotClickPos != INVALID_POSITION && PositionFromLocation(pt,true,false) != hotSpotClickPos ) {
+ if (inDragDrop == ddNone) {
+ DisplayCursor(Window::cursorText);
+ }
+ hotSpotClickPos = INVALID_POSITION;
+ }
+
} else {
if (vs.fixedColumnWidth > 0) { // There is a margin
if (PointInSelMargin(pt)) {
@@ -6148,6 +6166,10 @@ void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) {
inDragDrop = ddNone;
SetEmptySelection(newPos.Position());
}
+ if (hotSpotClickPos != INVALID_POSITION && PointIsHotspot(pt)) {
+ hotSpotClickPos = INVALID_POSITION;
+ NotifyHotSpotReleaseClick(newPos.Position(), false, ctrl, false);
+ }
if (HaveMouseCapture()) {
if (PointInSelMargin(pt)) {
DisplayCursor(Window::cursorReverseArrow);