I can't seem to distinguish between Checkboxes, RadioButtons, GroupBoxes and standard Buttons....
Please try out this code demonstrating my problem, and see if you can figure out what's wrong:
Code: Select all
OpenWindow(0,0,0,150,100,#PB_Window_SystemMenu,"Button Class Problems")
CreateGadgetList(WindowID())
ButtonGadget(0,0,0,150,20,"Button")
Frame3DGadget(1,0,25,150,20,"GroupBox")
CheckBoxGadget(2,0,50,150,20,"CheckBox")
OptionGadget(3,0,75,150,20,"RadioButton")
For GadgetNumber=0 To 3
handle=GadgetID(GadgetNumber)
ClassName$=Space(256)
GetClassName_(handle,@ClassName$,256)
Text$=Space(256)
GetWindowText_(handle,@Text$,256)
Style=GetWindowLong_(handle,#GWL_Style)
Select ClassName$
Case "Button"
If Style&#BS_CHECKBOX; Or Style&#BS_AUTOCHECKBOX
Debug "'"+Text$+"' is a Checkbox"
ElseIf Style&#BS_AUTORADIOBUTTON
Debug "'"+Text$+"' is a RadioButton"
ElseIf Style&#BS_GROUPBOX
Debug "'"+Text$+"' is a GroupBox"
Else
Debug "'"+Text$+"' is a Button"
EndIf
EndSelect
Next
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
