I designed two windows in a program. When I press "F1", the preference window will pop up or close(if it's opened). I also have some gadgets in the preference window, something like option gadget, combobox gadget, scrollbar gadget, trackbar gadget, etc. My problem is how could I get my previous setting in those gadgets, when I open the preference window again? Any help will be Appreciated.
Anka
How can I retrive setting of all gadgets in a window?
One way is to use static variables inside the prefs window procedure and
control it with flags.
control it with flags.
Code: Select all
Procedure PrefsWindow (flags.b); flags: 0-OpenWindow 1-CloseWindow, #PB_ANY-Swap
Static Value.b
If flags = #PB_Any
If IsWindow(...)
flags = 1
Else
flags = 0
EndIf
EndIf
If flags = 0
OpenWindow (...)
SetGadgetState( #CHECKBOX, Value )
Else
Value = GetGadgetState(#CHECKBOX)
CloseWindow(...)
EndIf
EndProcedure
- electrochrisso
- Addict
- Posts: 989
- Joined: Mon May 14, 2007 2:13 am
- Location: Darling River