i have putted 3 buttons in the puebasic form designer...then i have made a second file.. to recall it...ok this work fine...i have added a timer for time to window..ok..but now i need to add a combobox gadget with 3 states.....when i select one i would like to do something by combobox...selection....
I enclose here my file that pilot the pbf...can somebody help me please??
Thanks a lot,
Lestroso
Code: Select all
XIncludeFile "test.pbf" ; Include the first window definition
Global Image_0
InitSound() ; Initialize Sound system
CatchSound(0, ?Music)
Procedure combo()
MyComboBox = ComboBoxGadget(#PB_Any, 10, 10, 100, 25)
AddGadgetItem(MyComboBox, 0, "One")
AddGadgetItem(MyComboBox, 1, "Two")
AddGadgetItem(MyComboBox, 2, "Three")
EndProcedure
Procedure Window_0_Events(event)
Select event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case Button_1
PlaySound(0, #PB_Sound_MultiChannel,20)
MessageRequester("Gatto OKKK!", a$, 0)
;
Case Button_2
MessageRequester("Ok Tasto2", a$, 0)
Case Button_3
MessageRequester("ciao a teeee!!!ahahahha", a$, 0)
Case MyComboBox <-----------------------this condition don't works
If EventType() = #PB_EventType_Change
Select GetGadgetState(MyComboBox)
Case 0 : MessageRequester("Combo", "One")
Case 1 : MessageRequester("Combo", "Two")
Case 2 : MessageRequester("Combo", "Three")
EndSelect
EndIf
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure
Procedure Tempo()
;Repeat
Delay(1000)
timelcl=Date()
If update<>timelcl
update=timelcl
hr=Hour(timelcl)
min=Minute(timelcl)
sec=Second(timelcl)
hr12=hr%12
If Not hr12
hr12=12
EndIf
If hr>11
ampm$=" pm"
Else
ampm$=" am"
EndIf
display$=Str(hr12)+":"+RSet(Str(min),2,"0")+":"+RSet(Str(sec),2,"0")+ampm$
SetGadgetText(Text_2,display$)
EndIf
;ForEver
EndProcedure
OpenWindow_0 () ;Open the window!!!
AddWindowTimer(Window_0, 1000, 1000)
combo()
Repeat
event= WaitWindowEvent()
If Event = #PB_Event_Timer And EventTimer() = 1000
tempo()
EndIf
Until Window_0_Events(Event)= #False
DataSection
Music:
IncludeBinary "Cat.wav"
EndDataSection