[Done] PB v5.72 - Invalid Event Order with TAB key

Post bugreports for the Mac OSX version here
User avatar
mk-soft
Always Here
Always Here
Posts: 5216
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

[Done] PB v5.72 - Invalid Event Order with TAB key

Post by mk-soft »

Since v5.71 and v5.72 the event focus und lost focus not right order with TAB key.

Code: Select all

;-TOP

Procedure DoEventGadgetType()
  Protected gadget = EventGadget()
  If IsGadget(gadget)
    Select GadgetType(gadget)
      Case #PB_GadgetType_String
        Debug EventType()
        Select EventType()
          Case #PB_EventType_Focus
            Debug "Focus " + gadget
            ;TODO
          Case #PB_EventType_LostFocus
            Debug "LostFocus " + gadget
            ;TODO
        EndSelect
    EndSelect
  EndIf
EndProcedure

; ----

If OpenWindow(0, 0, 0, 400, 300, "StringGadget (Press Tab)", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  StringGadget(1, 10, 10, 380, 30, "StringGadget 1")
  StringGadget(2, 10, 50, 380, 30, "StringGadget 2")
  StringGadget(3, 10, 90, 380, 30, "StringGadget 3")
  
  CreateMenu(0, WindowID(0))
  BindEvent(#PB_Event_Gadget, @DoEventGadgetType())
  
  SetActiveGadget(1)
  
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_CloseWindow
        Break
        
      Case #PB_Event_Gadget
        Select EventGadget()
            
        EndSelect
        
    EndSelect
  ForEver
  
EndIf
It's a big problem for many programs to do any processes in right order.
Example this no longer work
Link: viewtopic.php?f=12&t=73843

P.S.
Here the small solution ...

Code: Select all

;-TOP

Procedure DoEventGadgetType()
  Protected gadget = EventGadget()
  If IsGadget(gadget)
    Select GadgetType(gadget)
      Case #PB_GadgetType_String
        Debug EventType()
        Select EventType()
          Case #PB_EventType_Focus
            If EventData() = 0
              PostEvent(#PB_Event_Gadget, EventWindow(), EventGadget(), EventType(), #True)
            Else
              Debug "Focus " + gadget
              ;TODO
            EndIf
          Case #PB_EventType_LostFocus
            Debug "LostFocus " + gadget
            ;TODO
        EndSelect
    EndSelect
  EndIf
EndProcedure

; ----

If OpenWindow(0, 0, 0, 400, 300, "StringGadget (Press Tab)", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  StringGadget(1, 10, 10, 380, 30, "StringGadget 1")
  StringGadget(2, 10, 50, 380, 30, "StringGadget 2")
  StringGadget(3, 10, 90, 380, 30, "StringGadget 3")
  
  CreateMenu(0, WindowID(0))
  BindEvent(#PB_Event_Gadget, @DoEventGadgetType())
  
  SetActiveGadget(1)
  
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_CloseWindow
        Break
        
      Case #PB_Event_Gadget
        Select EventGadget()
            
        EndSelect
        
    EndSelect
  ForEver
  
EndIf
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5216
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB v5.72 - Invalid Event Order with TAB key

Post by mk-soft »

Please repair event order. Last right version is PB v5.70
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Fred
Administrator
Administrator
Posts: 16448
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [Done] PB v5.72 - Invalid Event Order with TAB key

Post by Fred »

Fixed.
User avatar
mk-soft
Always Here
Always Here
Posts: 5216
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: [Done] PB v5.72 - Invalid Event Order with TAB key

Post by mk-soft »

Not fixed ...

Focus of next Gadget come before LostFocus from previous Gadget
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Piero
Enthusiast
Enthusiast
Posts: 275
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: PB v5.72 - Invalid Event Order with TAB key

Post by Piero »

How dare you mk-soft to contradict Fred?!?! :evil:
OPS! SORRY!
I'm a fan of both :oops:
Fred
Administrator
Administrator
Posts: 16448
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [Done] PB v5.72 - Invalid Event Order with TAB key

Post by Fred »

mk-soft wrote: Mon Dec 04, 2023 8:19 pm Not fixed ...

Focus of next Gadget come before LostFocus from previous Gadget
I just tried again with your first code and it works here, can you test again ? Can anybody else try it as well ?

debugger output:

Code: Select all

512
LostFocus 1
256
Focus 2
512
LostFocus 2
256
Focus 3
User avatar
mk-soft
Always Here
Always Here
Posts: 5216
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB v5.72 - Invalid Event Order with TAB key

Post by mk-soft »

Now works ok with PB v6.10 ;)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply