#368 Send SCN_HOTSPOTCLICK/SCN_HOTSPOTDOUBLECLICK on mouse up

Completed
closed
Scintilla (358)
2
2011-11-02
2006-09-25
Anonymous
No

In most cases hotspots are used to open new files, and
as they are sent onmousedown it causes a selection to
occur if one clicks the hotspot. It makes more sense
to me to have it occur on onmouseup. The modified code is:

Editor.h:
Line 501 to void ButtonUp(Point pt, unsigned int
curTime, bool shift, bool ctrl, bool alt);

Editor.cxx:
Line 5456 add:
bool inSelMargin = PointInSelMargin(pt);
if(!inSelMargin && PointIsHotspot(pt))
{
int newPos = PositionFromLocation(pt);
newPos = MovePositionOutsideChar(newPos, currentPos -
newPos);
NotifyHotSpotClicked(newPos, shift, ctrl, alt);
}
Line 2229 remove:
if (PointIsHotspot(pt)) {
NotifyHotSpotClicked(newPos, shift, ctrl, alt);
}

ScintillaWin.cxx:
Line 678 to:
ButtonUp(Point::FromLong(lParam), ::GetMessageTime(),
(wParam & MK_SHIFT) != 0, (wParam & MK_CONTROL) != 0,
(wParam & MK_ALT) != 0);

I haven't modified this for GTK.

Cheers.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Sorry forgot to mention, I didn't include the code for
    HOTSPOTDOUBLECLICK...should be obvious but I didn't write it
    as my code only relies on HOTSPOTCLICK....thanks and sorry.

     
  • Neil Hodgson

    Neil Hodgson - 2006-09-26

    Logged In: YES
    user_id=12579

    Hotspots are also used for popping up definition windows.
    This works best on mouse down. Any patch should introduce a
    new event instead of changing the behaviour of the existing
    event.

     
  • Neil Hodgson

    Neil Hodgson - 2006-09-26
    • priority: 5 --> 2
    • assigned_to: nobody --> nyamatongwe
     
  • Neil Hodgson

    Neil Hodgson - 2011-11-02
    • milestone: --> Completed
    • status: open --> closed
     
  • Neil Hodgson

    Neil Hodgson - 2011-11-02

    SCN_HOTSPOTRELEASECLICK added in 2.22.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks