[Solved] Dialog library does not allow optiongadgets within different boxes

Just starting out? Need help? Post your questions and find answers here.
User avatar
jacdelad
Addict
Addict
Posts: 1432
Joined: Wed Feb 03, 2021 12:46 pm
Location: Planet Riesa
Contact:

[Solved] Dialog library does not allow optiongadgets within different boxes

Post by jacdelad »

I can't put optiongadgets into different boxes:

Code: Select all

Runtime Enumeration Gadget
  #Gadget_Option0
  #Gadget_Option1
EndEnumeration

XML$="<window id='#PB_Any' name='test' text='Gridbox' minwidth='auto' minheight='auto' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
     "<vbox>"+
     "<option id='#Gadget_Option0' text='One' group='2'/>"+
     "<hbox>"+
     "<option id='#Gadget_Option1' text='Two' group='2'/>"+
     "</hbox>"+
     "</vbox>"+
     "</window>"

ParseXML(0, XML$)
CreateDialog(0)
OpenXMLDialog(0, 0, "test")

Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow 

Removing the hbox makes it work. Because of this I cannot put a first option and then a second one which activates a stringgadget for additional input.

Is that wanted behaviour of the dialog library? Because I couldn't find info in the help about that specific topic (also the explanation of the parameters is a bit...mere).
Last edited by jacdelad on Fri Dec 02, 2022 10:32 pm, edited 1 time in total.
PureBasic 6.04/XProfan X4a/Embarcadero RAD Studio 11/Perl 5.2/Python 3.10
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
Cyllceaux
Enthusiast
Enthusiast
Posts: 458
Joined: Mon Jun 23, 2014 1:18 pm
Contact:

Re: Dialog library does not allow optiongadgets within different boxes

Post by Cyllceaux »

Hi,

Maybe the GridBox is working for you :?:
User avatar
Kiffi
Addict
Addict
Posts: 1353
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Dialog library does not allow optiongadgets within different boxes

Post by Kiffi »

Based on Cyllceaux's suggestion:

Code: Select all

Runtime Enumeration Gadget
  #Gadget_Option0
  #Gadget_Option1
EndEnumeration

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 id='#Gadget_Option0' text='One' group='2'/>"+
     "<option id='#Gadget_Option1' text='Two' group='2'/>"+
     "</gridbox>"+
     "</window>"

ParseXML(0, XML$)
CreateDialog(0)
OpenXMLDialog(0, 0, "test")

Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow 
Hygge
User avatar
jacdelad
Addict
Addict
Posts: 1432
Joined: Wed Feb 03, 2021 12:46 pm
Location: Planet Riesa
Contact:

Re: Dialog library does not allow optiongadgets within different boxes

Post by jacdelad »

Ah thanks!!! Using a gridbox indeed works. I wish the help would be a bit more specific about that.
PureBasic 6.04/XProfan X4a/Embarcadero RAD Studio 11/Perl 5.2/Python 3.10
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
Post Reply