I wish that we get the possibility to add "align = 'center'" (or "align = 'left' / 'right'") to each vbox/hbox/frame (and if really additionally needed: singlebox), and all child items will the placed like that... Thanks!
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='test' minwidth='auto' minheight='auto' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
" <vbox expand='item:2'>" +
" <hbox>" +
" <button text='button 1'/>" +
" <checkbox text='checkbox 1'/>" +
" <button text='button 2'/>" +
" </hbox>" +
" <vbox>" +
" <text align='center' text='content' height='150'/>" + ; align parameter is ignored
" <singlebox align='center' expand='vertical'>" +
" <text align='center' text='content' height='150'/>" + ; correct alignment
" </singlebox>" +
" <singlebox align='center' expand='horizontal'>" +
" <text align='center' text='content' height='150'/>" + ; no correct alignment, as the text is displayed only a bit to the right
" </singlebox>" +
" </vbox>" +
" </vbox>" +
"</window>"
If CatchXML(#Xml, @XML$, StringByteLength(XML$), 0, #XmlEncoding) And XMLStatus(#Xml) = #PB_XML_Success
If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "test")
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
Else
Debug "Dialog error: " + DialogError(#Dialog)
EndIf
Else
Debug "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIf