From 66c09167ac82b63f4584ffd28ad425194811595b Mon Sep 17 00:00:00 2001
From: nyamatongwe SciTEBase::Expand() for examples of the use of these messages.
SCI_CONTRACTEDFOLDNEXT(int lineStart)
- Search efficiently for lines that are contracted fold headers.
- This is useful when saving the user's folding when switching documents or saving folding with a file.
+ Search efficiently for lines that are contracted fold headers.
+ This is useful when saving the user's folding when switching documents or saving folding with a file.
The search starts at line number lineStart and continues forwards to the end of the file.
lineStart is returned if it is a contracted fold header otherwise the next contracted
fold header is returned. If there are no more contracted fold headers then -1 is returned.
SCN_HOTSPOTCLICK
SCN_HOTSPOTDOUBLECLICK
+ SCN_HOTSPOTRELEASECLICK
These notifications are generated when the user clicks or double clicks on
text that is in a style with the hotspot attribute set.
This notification can be used to link to variable definitions or web pages.
The position field is set the text position of the click or
double click and the modifiers field set to the key modifiers
- held down in a similar manner to .
SCN_HOTSPOTRELEASECLICK.
SCN_INDICATORCLICK
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 1b3ec124e..ae6827309 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -353,6 +353,7 @@
diff --git a/include/Scintilla.h b/include/Scintilla.h index 54f104437..331216979 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -885,6 +885,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCN_INDICATORRELEASE 2024 #define SCN_AUTOCCANCELLED 2025 #define SCN_AUTOCCHARDELETED 2026 +#define SCN_HOTSPOTRELEASECLICK 2027 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ /* These structures are defined to be exactly the same shape as the Win32 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 679bce53b..a8ef722a0 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -3846,6 +3846,7 @@ evt void IndicatorClick=2023(int modifiers, int position) evt void IndicatorRelease=2024(int modifiers, int position) evt void AutoCCancelled=2025(void) evt void AutoCCharDeleted=2026(void) +evt void HotSpotReleaseClick=2027(int modifiers, int position) cat Deprecated 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); diff --git a/src/Editor.h b/src/Editor.h index 3f36c9088..17683c63a 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -197,6 +197,7 @@ protected: // ScintillaBase subclass needs access to much of Editor bool dropWentOutside; SelectionPosition posDrag; SelectionPosition posDrop; + int hotSpotClickPos; int lastXChosen; int lineAnchor; int originalAnchorPos; @@ -417,6 +418,7 @@ protected: // ScintillaBase subclass needs access to much of Editor virtual void NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt); void NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt); void NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt); + void NotifyHotSpotReleaseClick(int position, bool shift, bool ctrl, bool alt); void NotifyUpdateUI(); void NotifyPainted(); void NotifyIndicatorClick(bool click, int position, bool shift, bool ctrl, bool alt); -- cgit v1.2.3