Code: Select all
CompilerIf #PB_Compiler_Unicode
#XmlEncoding = #PB_UTF8
CompilerElse
#XmlEncoding = #PB_Ascii
CompilerEndIf
#Dialog = 0
#Xml = 0
XML$ = "<window id='#PB_Any' name='test' text='Gridbox' minwidth='auto' minheight='auto' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
" <gridbox columns='1'>" +
" <option name='opt1' text='Option 1' />" +
" <string name='strTest' minwidth='450' />" +
" <option name='opt2' text='Option 2' />" +
" <option name='opt3' text='Option 3' />" +
" </gridbox>" +
" </window>"
If CatchXML(#Xml, @XML$, StringByteLength(XML$), 0, #XmlEncoding) And XMLStatus(#Xml) = #PB_XML_Success
If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "test")
SetGadgetState(DialogGadget(#Dialog, "opt1"), 1); select opt1 by default
Repeat
Event = WaitWindowEvent()
EventType = EventType()
If Event = #PB_Event_Gadget
Gadget = EventGadget()
;{ Handle Option Group because PB does not...
If Gadget = DialogGadget(#Dialog, "opt1")
SetGadgetState(DialogGadget(#Dialog, "opt2"), 0)
SetGadgetState(DialogGadget(#Dialog, "opt3"), 0)
SetActiveGadget(DialogGadget(#Dialog, "strTest"))
EndIf
If Gadget = DialogGadget(#Dialog, "opt2")
SetGadgetState(DialogGadget(#Dialog, "opt1"), 0)
SetGadgetState(DialogGadget(#Dialog, "opt3"), 0)
EndIf
If Gadget = DialogGadget(#Dialog, "opt3")
SetGadgetState(DialogGadget(#Dialog, "opt1"), 0)
SetGadgetState(DialogGadget(#Dialog, "opt2"), 0)
EndIf
;}
EndIf
Until Event = #PB_Event_CloseWindow
Else
Debug "Dialog error: " + DialogError(#Dialog)
EndIf
Else
Debug "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIf
[EDIT]I forgot to mention that I need a quick solution to this

Kukulkan