Page 1 of 1

EditorGadget EventType 256

Posted: Tue Feb 12, 2013 9:38 am
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

Re: EditorGadget EventType 256

Posted: Tue Feb 12, 2013 11:51 am
by Fred
It's not safe if it's not documented.

Re: EditorGadget EventType 256

Posted: Tue Feb 12, 2013 5:01 pm
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

Re: EditorGadget EventType 256

Posted: Tue Feb 12, 2013 6:18 pm
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.