EditorGadget EventType 256

Everything else that doesn't fall into one of the other PB categories.
dige
Addict
Addict
Posts: 1432
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

EditorGadget EventType 256

Post by dige »

Hi folks,

currently supports the EditorGadget() only the event: #PB_EventType_Change
But I need some more, especially the event: #PB_EventType_Focus

I found out, if I click into an inactive Editor Gadget, it sends the EventType = 256.
What is it? Can I use it safely?

Code: Select all

  If OpenWindow(0, 0, 0, 322, 150, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    EditorGadget(0, 8, 8, 306, 133)
    Repeat
      Event = WaitWindowEvent()
      If Event = #PB_Event_Gadget
        Debug EventType()
      EndIf
    Until Event = #PB_Event_CloseWindow
  EndIf
"Daddy, I'll run faster, then it is not so far..."
Fred
Administrator
Administrator
Posts: 18553
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: EditorGadget EventType 256

Post by Fred »

It's not safe if it's not documented.
WilliamL
Addict
Addict
Posts: 1260
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: EditorGadget EventType 256

Post by WilliamL »

This request just won't go away. Your discovery will give Fred heartburn.. or the rest of us if we use it. :)

http://www.purebasic.fr/english/viewtop ... dget+focus
MacBook Pro-M1 (2021), Tahoe 26.3.1, PB 6.40b1
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: EditorGadget EventType 256

Post by netmaestro »

If you're on Windows, a safe way for the present would be to subclass the editorgadget and respond to #WM_SETFOCUS and #WM_KILLFOCUS in your subclass proc. I'm not sure why the team hasn't done this for the editor gadget, it's done for the string gadget already but nowhere else.
BERESHEIT
Post Reply