Page 1 of 1

Dialog margins

Posted: Fri Jun 16, 2023 11:38 am
by Torp
I don't know what I'm doing wrong, but I can't get 'margin' to work in the dialogs.
I've tried everything (singlebox/vbox/hbox/gridbox...) but nothing works.
If you set margin='20', you get the expected result all round.
However, all combinations of margin='top:xx, bottom:xx,...' don't work.
In this example I'd like to offset the tabs at the top of the screen but nothing works and I don't know why.
If you have any ideas, I'd love to hear from you.
Thanks

Code: Select all

#Xml = 0 : #Dialog = 0

XML$ = "<window id='#PB_Any' name='dialog1' text='test' flags='#PB_Window_Background'>" +
       "      <singlebox margin='top:100, bottom:20, horizontal:10'>" +
       "        <panel name='Tab'>" +
       "          <tab text='Tab1'/>" +
       "          <tab text='Tab2'/>" +
       "        </panel>" +
       "      </singlebox>" +
       "  </window>"

If ParseXML(#Xml, XML$) And XMLStatus(#Xml) = #PB_XML_Success

  If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "dialog1")
    Debug "Dialog successfully created"
  Else
    Debug "Dialog error: " + DialogError(#Dialog)
  EndIf
Else
  Debug "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIf 

Re: Dialog margins

Posted: Fri Jun 16, 2023 12:38 pm
by Peter
Looks like this is a feature not yet implemented, because the same code (slightly adapted) works in PureBasic.

Re: Dialog margins

Posted: Sun Jun 18, 2023 11:38 am
by Torp
That's a shame.
It complicates display management on the phone.