EventType for EditorGadget

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Vitor_Boss®
User
User
Posts: 81
Joined: Thu Sep 23, 2010 4:22 am

EventType for EditorGadget

Post 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?
Sorry by bad English.
HP Pavilion DV6-2155DX: Intel i3-330m 2.13 / 4GB DDR3 / 500GB Sata2 HD / Display 15.6" LED / Win7 Ultimate x64 / PB 4.50 x86 demo.
WilliamL
Addict
Addict
Posts: 1252
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: EventType for EditorGadget

Post 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.
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
User avatar
Shardik
Addict
Addict
Posts: 2058
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: EventType for EditorGadget

Post by Shardik »

Vitor_Boss® wrote:There is any way to get EventType for a Editor Gadget?
Did you try a search in this forum? :wink:
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... :wink:
Vitor_Boss®
User
User
Posts: 81
Joined: Thu Sep 23, 2010 4:22 am

Re: EventType for EditorGadget

Post by Vitor_Boss® »

Thank you very much.

I tried use the forum search but not found the posts.
Sorry by bad English.
HP Pavilion DV6-2155DX: Intel i3-330m 2.13 / 4GB DDR3 / 500GB Sata2 HD / Display 15.6" LED / Win7 Ultimate x64 / PB 4.50 x86 demo.
WilliamL
Addict
Addict
Posts: 1252
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: EventType for EditorGadget

Post 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...
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
infratec
Always Here
Always Here
Posts: 7591
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: EventType for EditorGadget

Post 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
Post Reply