Page 1 of 1

[SOLVED] How to catch mouse left click with GOScintilla

Posted: Fri Apr 17, 2020 9:59 pm
by Maitre_Kanter
Hello,

another question about scintilla and I can't catch mouse leftclick event using the Scintilla callback.

I searched on scintilla documentation and google but nothing relevant for me.

Windows 10 64bits, Purebasic 5.72, GoScintilla 3.0.1

Thank you,

Kanter

Re: How to catch mouse left click with Scintilla (GOSCIntill

Posted: Fri Apr 17, 2020 10:32 pm
by wombats
I don't know if this would interfere with anything Scintilla does internally, but this works (Windows only):

Code: Select all

InitScintilla()

Global oldScintillaProc

Procedure.i ScintillaProc(hWnd, uMsg, wParam, lParam)
  Protected Result
  Select uMsg
    Case #WM_LBUTTONDOWN
      Debug "Left button down"
  EndSelect
  ProcedureReturn CallWindowProc_(oldScintillaProc, hWnd, uMsg, wParam, lParam)
EndProcedure

If OpenWindow(0, 0, 0, 320, 240, "ScintillaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ScintillaGadget(0, 0, 0, 320, 240, 0)
  oldScintillaProc = SetWindowLong_(GadgetID(0), #GWL_WNDPROC, @ScintillaProc())
EndIf

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow

Re: How to catch mouse left click with Scintilla (GOSCIntill

Posted: Sat Apr 18, 2020 9:06 pm
by Maitre_Kanter
Thank you wombats,

it is working but the goal of the functionality is to click on a line and analyze this line. #WM_LBUTTONDOWN event is posted before Scintilla selects the line.

This is why I just modified the event #WM_LBUTTONDOWN to #WM_LBUTTONUP

Kanter