The following is constructed using excerpts from my main project that I have been unable to share as a whole. NOTE: Debug should and does display 3 when both check-boxes are checked. Both boxes should be checked by default on first pass. Need to make sure both are checked before 2nd pass and line 50 is still ignored but atill returns the 3 value for "military".
Code: Select all
Global military
military = 3
#window_25 = 0
#ButtonLeft = 12
#ButtonRight = 13
Enumeration
#B1_25
#B2_25
#B3_25
#B4_25
#B5_25
#B6_25
#B7_25
#B8_25
#B9_25
#B10_25
#B11_25
#B12_25
#B13_25
EndEnumeration
Debug "#B12_25 = " + Str(#B12_25)
Global fontAri10B.l, skin.i, hBrush0, fontAri10B
LoadFont(1,"Arial",10)
Procedure settings()
If OpenWindow(#window_25,0,0,252,200,"Preferences",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
;SetGadgetFont(#PB_Default,FontID(fontAri10B))
SetGadgetFont(#PB_Default, FontID(1))
ButtonGadget(#B1_25, 10, 10, 60, 20, "default", #PB_Button_Toggle)
ButtonGadget(#B2_25, 10, 40, 60, 20, "color2", #PB_Button_Toggle)
ButtonGadget(#B3_25, 10, 70, 60, 20, "color3", #PB_Button_Toggle)
ButtonGadget(#B4_25, 10, 100, 60, 20, "color4", #PB_Button_Toggle)
ButtonGadget(#B5_25, 10, 130, 60, 20, "color5", #PB_Button_Toggle)
TextGadget(#B6_25,71,10,60,20,"")
TextGadget(#B7_25,71,40,60,20,"")
TextGadget(#B8_25,71,70,60,20,"")
TextGadget(#B9_25,71,100,60,20,"")
TextGadget(#B10_25,71,130,60,20,"")
ButtonGadget(#B11_25, 20, 170, 50, 20, "SAVE")
CheckBoxGadget(#B12_25, 100, 155, 200, 20, "24 hour remote time")
CheckBoxGadget(#B13_25, 100, 175, 200, 20, "24 hour Local time")
SetGadgetColor(#B6_25,#PB_Gadget_BackColor,$AACDAA)
SetGadgetColor(#B7_25,#PB_Gadget_BackColor,$FFCCCC)
SetGadgetColor(#B8_25,#PB_Gadget_BackColor,$CACAFF)
SetGadgetColor(#B9_25,#PB_Gadget_BackColor,$CCCCCC)
SetGadgetColor(#B10_25,#PB_Gadget_BackColor,$FFC0A0)
;SetActiveGadget(#B1_25)
SetGadgetState(#B1_25,1) ; Push first button in.
If military & 1 ; REMOTE time
Debug military
SetGadgetState(#B12_25,#False) ; <<<< IGNORED IGNORED IGNORED IGNORED IGNORED
EndIf
If military & 2 ; LOCAL time
SetGadgetState(#B13_25,#True)
EndIf
military = 0
sel = #B1_25
cur=#B1_25 ; Remember which gadget is currently pushed in.
SetGadgetState(#B1_25,1) ; Push first button in.
Repeat
ev=WaitWindowEvent()
If ev=#PB_Event_Gadget
id=EventGadget()
If id <> cur ;
;
Select id
Case #B1_25
;skin.i = $AACDAA ; green default
Case #B2_25
;skin.i = $FFCCCC ; green default
Case #B3_25
;skin.i = $CACAFF ; green default
Case #B4_25
; skin.i = $CCCCCC ; green default
Case #B5_25
; skin.i = $FFC0A0 ; green default
Case #B11_25
ev=#PB_Event_CloseWindow
Case #B12_25,#B13_25
SetGadgetState(sel,1)
SetActiveGadget(sel)
EndSelect
Select cur
Case #B1_25 To #B5_25
SetGadgetState(cur,#False) ; Push old button "out".
cur=id ; Remember new button
EndSelect
If GetGadgetState(#B1_25)
skin.i = $AACDAA ; green default
sel = #B1_25
EndIf
If GetGadgetState(#B2_25)
skin.i = $FFCCCC ; green default
sel = #B2_25
EndIf
If GetGadgetState(#B3_25)
skin.i = $CACAFF ; green default
sel = #B3_25
EndIf
If GetGadgetState(#B4_25)
skin.i = $CCCCCC ; green default
sel = #B4_25
EndIf
If GetGadgetState(#B5_25)
skin.i = $FFC0A0 ; green default
sel = #B5_25
EndIf
EndIf
EndIf
Until ev=#PB_Event_CloseWindow
EndIf
Debug military
If GetGadgetState(#B12_25) = #PB_Checkbox_Checked
military + 1
EndIf
If GetGadgetState(#B13_25) = #PB_Checkbox_Checked
military + 2
EndIf
hBrush0 = CreateSolidBrush_(skin.i)
SetClassLong_(HWND0, #GCL_HBRBACKGROUND, hBrush0)
InvalidateRect_(HWND0, #Null, #True)
CloseWindow(#window_25)
If CreateImage(#ButtonRight, 12, 24)
If StartDrawing(ImageOutput(#ButtonRight))
Box(0,0,12,26, skin.i)
LineXY(2,3,11,12,$000000)
LineXY(1,3,10,12,$000000)
LineXY(2,3,8,12,$000000)
LineXY(1,3,6,12,$000000)
LineXY(1,21,6,12,$000000)
LineXY(2,21,8,12,$000000)
LineXY(1,21,10,12,$000000)
LineXY(2,21,11,12,$000000)
StopDrawing()
EndIf
EndIf
If CreateImage(#ButtonLeft, 12, 24)
If StartDrawing(ImageOutput(#ButtonLeft))
Box(0,0,12,26, skin.i)
LineXY(0,12,9,3,$000000)
LineXY(1,12,10,3,$000000)
LineXY(3,12,9,3,$000000)
LineXY(5,12,10,3,$000000)
LineXY(5,12,10,21,$000000)
LineXY(3,12,9,21,$000000)
LineXY(1,12,10,21,$000000)
LineXY(0,12,9,21,$000000)
StopDrawing()
EndIf
EndIf
; SetGadgetColor(#StoreIDxt_0, #PB_Gadget_BackColor, skin.i)
; SetGadgetColor(#StoreIDxt2_0, #PB_Gadget_BackColor, skin.i)
; SetGadgetColor(#Container_0a, #PB_Gadget_BackColor, skin.i)
; SetGadgetColor(#Container_0b, #PB_Gadget_BackColor, skin.i)
; SetGadgetColor(#Support_0, #PB_Gadget_BackColor, skin.i)
; If IsZoomed_(HWND0) = 0
; Select wW0
; Case 830
; ; SetWindowPos_(HWND0, 0, wpx, wpy, 598, wH0+1, #SWP_SHOWWINDOW)
; ; ShowWindow_(HWND0,#SW_SHOWNA)
; SetGadgetAttribute(#Width_0,#PB_Button_Image, ImageID(#ButtonLeft))
; Case 609
; ; SetWindowPos_(HWND0, 0, wpx, wpy, 814, wH0+1, #SWP_SHOWWINDOW)
; ; ShowWindow_(HWND0,#SW_SHOWNA)
; SetGadgetAttribute(#Width_0, #PB_Button_Image, ImageID(#ButtonRight))
; EndSelect
; WindowSized = 1
; EndIf
; displayShort()
;MessageRequester("SKIN",Str(skin.i))
EndProcedure
settings()
Debug Hex(skin,#PB_Long)
Debug military
settings()
Debug Hex(skin,#PB_Long)
Debug military

