Page 1 of 1
EventType for EditorGadget
Posted: Wed Jan 26, 2011 9:37 pm
by Vitor_Boss®
There is any way to get EventType for a Editor Gadget?
I need those ones:
#PB_EventType_LeftClick : Left mouse button click
#PB_EventType_Focus : Get the focus.
#PB_EventType_LostFocus : Lose the focus.
Any idea?
Re: EventType for EditorGadget
Posted: Thu Jan 27, 2011 9:09 pm
by WilliamL
I would like to second Vitor_Boss' request. I need this ability too.
I would like to just get a normal 'EventGadget()' response as writen in manual but Viror_Boss's request would be better.
#Gadget will be the number returned by the EventGadget() function.
Re: EventType for EditorGadget
Posted: Sun Jan 30, 2011 10:33 am
by Shardik
Vitor_Boss® wrote:There is any way to get EventType for a Editor Gadget?
Did you try a search in this forum?
Because there exist numerous code examples for detecting actions elicited by
the EditorGadget in Windows. See this posting from srod where he demonstrates
how to even enable #PB_EventType_Change in the EditorGadget of Windows:
http://www.purebasic.fr/english/viewtop ... 62&start=1
In this posting he also explains:
srod wrote:The default for Windows rich edit controls (editor gadgets) is NOT to send notification of such 'change' events to the parent window.
This is a small collection of further code examples for detecting events in the EditorGadget
in Windows:
- Detect mouse up and down of left and right button (Sparkie):
viewtopic.php?t=18667&start=3
- Detect left mouse click and moving the cursor above the EditorGadget (netmaestro)
http://www.purebasic.fr/english/viewtop ... 46&start=1
- Detect content change and count changes (Fluid Byte with addition by Rings):
http://www.purebasic.fr/german/viewtopi ... 5&start=15
- Detect click on WebLink (freak):
http://www.purebasic.fr/english/viewtop ... 35&start=5
- Detect left click and display x and y coordinates (Sparkie):
http://purebasic.fr/english/viewtopic.p ... 57&start=9
- Detect right click and display context menu (ts-soft):
http://www.purebasic.fr/german/viewtopi ... 43&start=4
Mac users may modify this example of
Niffo.
They only have to exchange the definition of the ContainerGadget against a
definition of an EditorGadget and then are able to detect mouse up and down
events and detecting the mouse cursor above the EditorGadget.
Of course crossplatform EventTypes for the EditorGadget would be the best
solution...

Re: EventType for EditorGadget
Posted: Sun Jan 30, 2011 9:03 pm
by Vitor_Boss®
Thank you very much.
I tried use the forum search but not found the posts.
Re: EventType for EditorGadget
Posted: Thu Jan 03, 2013 9:27 pm
by WilliamL
#PB_EventType_Focus : Get the focus.
#PB_EventType_LostFocus : Lose the focus.
#PB_EventType_Change works great (in 5.10b2x64) but I'd still like the above...
Re: EventType for EditorGadget
Posted: Mon Apr 15, 2013 2:15 pm
by infratec
Hi,
in Windows PB 5.11 there are additional undocumented EventTypes() for the EditorGadget()
1024 -> at program start
256 -> focus (or something similar)
512 -> lost focus (or something similar)
Bernd