which panel gadget is active?

Just starting out? Need help? Post your questions and find answers here.
muab256
User
User
Posts: 43
Joined: Mon Apr 28, 2003 4:57 pm

which panel gadget is active?

Post by muab256 »

hi ho =)

is there a way to find out which panel gadget is currently active (or alternatively getting an event when it gets activated)?

thx
muaB
Henrik
Enthusiast
Enthusiast
Posts: 404
Joined: Sat Apr 26, 2003 5:08 pm
Location: Denmark

Post by Henrik »

Hi
if you mean Panelitem?

Code: Select all

; PureBasic Visual Designer v3.63c Beta


;- Window Constants
;
#Window_0 = 0

;- Gadget Constants
;
#Gadget_0 = 0


Procedure Open_Window_0()
    If OpenWindow(#Window_0, 216, 0, 600, 300,  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "New window ( 0 )")
        If CreateGadgetList(WindowID())
            
            ;- Panel2000
            PanelGadget(#Gadget_0, 15, 30, 555, 185)
            AddGadgetItem(#Gadget_0, -1, "Tab 1")
            AddGadgetItem(#Gadget_0, -1, "Tab 2")
            AddGadgetItem(#Gadget_0, -1, "Tab 3")
            AddGadgetItem(#Gadget_0, -1, "Tab 4")
            AddGadgetItem(#Gadget_0, -1, "Tab 5")
            AddGadgetItem(#Gadget_0, -1, "Tab 6")
            ClosePanelGadget()
            
        EndIf
    EndIf
EndProcedure


Open_Window_0()

Repeat
    Event = WaitWindowEvent()
    If Event=#PB_EventGadget
        AdNum =GetGadgetState(#Gadget_0)
        Result$ = GetGadgetItemText(#Gadget_0, AdNum,0)
        SetWindowText_(WindowID(),"Pannel now activ: "+ Result$)
    EndIf
    
Until Event = #PB_EventCloseWindow
End
Regards
Henrik
Post Reply