Doubleclick on OptionGadget?
Doubleclick on OptionGadget?
I know it's non-standard, but is there an easy way to detect a left doubleclick on an OptionGadget?
hi
Well it's ugly fast stunt i could come up with, but it's a worke around for now.
i'am pretty sure one of the better coders can come up with something
better.
there is some win api stuf like
GetDoubleClickTime
SetDoubleClickTime
but i duno mush about you should look it up
nb. Dbc=gettickcount_()+150 ;<< ajust this for DoubleClickTime you want
best regards
Henrik
>edit inline asm didn't like Db so it was remaned to Dbc<
Well it's ugly fast stunt i could come up with, but it's a worke around for now.
i'am pretty sure one of the better coders can come up with something
better.
there is some win api stuf like
GetDoubleClickTime
SetDoubleClickTime
but i duno mush about you should look it up
nb. Dbc=gettickcount_()+150 ;<< ajust this for DoubleClickTime you want
Code: Select all
#Window_0 = 0
#Gadget_0 = 0
#Gadget_1 = 1
#Gadget_2 = 2
Procedure Open_Window_0()
If OpenWindow(#Window_0, 216, 0, 252, 196, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "DoubleClick")
If CreateGadgetList(WindowID())
OptionGadget(#Gadget_0, 37, 25, 54, 25, "Test")
OptionGadget(#Gadget_1, 104, 26, 54, 25, "Test2")
StringGadget(#Gadget_2, 34, 75, 137, 32, "nothing yet")
EndIf
EndIf
EndProcedure
Open_Window_0()
Repeat
If gettickcount_() >Dbc:DBClk=0:EndIf
EventID = WaitWindowEvent()
If EventID = #WM_LBUTTONDBLCLK
DBClk=1
Dbc=gettickcount_()+150 ;<< ajust this for DoubleClickTime you want
Else
EndIf
If EventID = #PB_EventGadget
GadgetID = EventGadgetID()
If GadgetID = #Gadget_0 And DBClk=0
SetGadgetText(#Gadget_2, "Test1 One Click")
ElseIf GadgetID = #Gadget_0 And DBClk=1
SetGadgetText(#Gadget_2, "Test1 DoubleClick**")
ElseIf GadgetID = #Gadget_1 And DBClk=0
SetGadgetText(#Gadget_2, "Test2 One Click")
ElseIf GadgetID = #Gadget_1 And DBClk=1
SetGadgetText(#Gadget_2, "Test2 DoubleClick**")
EndIf
EndIf
Until EventID = #PB_EventCloseWindow
Henrik
>edit inline asm didn't like Db so it was remaned to Dbc<
> Dbc=gettickcount_()+150 ;<< ajust this for DoubleClickTime you want
Just replace the above line with:

Just replace the above line with:
Code: Select all
Dbc=gettickcount_()+GetDoubleClickTime_()
Hehe
Why on earth did'nt i just try it out
/note to self: Sometimes, when it looks simple it maybe is simple. tsk tsk
Why on earth did'nt i just try it out
/note to self: Sometimes, when it looks simple it maybe is simple. tsk tsk
PB wrote: Just replace the above line with:
Code: Select all
Dbc=gettickcount_()+GetDoubleClickTime_()

