Page 1 of 1

bug or feature?

Posted: Thu Jan 28, 2010 9:22 am
by lnxque
There is a "strange" behavior regarding the optiongadget. 1st (default), work as expected.

Code: Select all

If OpenWindow(0, 100, 180, 200, 100, "Test")
   OptionGadget(0, 10,  10,  80, 20, "option 1")
   OptionGadget(1, 100, 10,  80, 20, "option 2") 
   ButtonGadget(2, 60,  50, 80, 20, "button")

   Repeat
       EvID=WaitWindowEvent()
   Until EvID = #PB_Event_CloseWindow
EndIf

End 
2nd, i want change the taborder, it seems to be something wrong.

Code: Select all

If OpenWindow(0, 100, 180, 200, 100, "Test")
   OptionGadget(0, 10,  10,  80, 20, "option 1")
   ButtonGadget(1, 60,  50, 80, 20, "button")
   OptionGadget(2, 100, 10,  80, 20, "option 2") 

   Repeat
       EvID=WaitWindowEvent()
   Until EvID = #PB_Event_CloseWindow
EndIf

End 
At least the question (if a feature ;-) - how to change the taborder.

Under Windows the 2nd example works fine, but you must insert SetGadgetState()

Code: Select all

If OpenWindow(0, 100, 180, 200, 100, "Test")
   OptionGadget(0, 10,  10,  80, 20, "option 1")
   ButtonGadget(1, 60,  50, 80, 20, "button")
   OptionGadget(2, 100, 10,  80, 20, "option 2") 
   SetGadgetState(0, 1)
   SetGadgetState(2, 0)

   Repeat
       EvID=WaitWindowEvent()
       If EvID=#PB_Event_Gadget
          Select EventGadget()
            Case 0
               SetGadgetState(0, 1)
               SetGadgetState(2, 0)
            Case 2
               SetGadgetState(0, 0)
               SetGadgetState(2, 1)
          EndSelect
       EndIf
    Until EvID = #PB_Event_CloseWindow
EndIf

End 

Re: bug or feature?

Posted: Thu Jan 28, 2010 9:38 am
by Fred