Is there a trick to remove margins in Dialogs ?
Posted: Wed Jul 15, 2020 1:52 pm
See the differences between dialog (top) and no dialog (bottom).
Is there a solution ?
M.
Is there a solution ?
Code: Select all
#Dialog = 0
#Xml = 0
XML$ = ~"<dialogs>\n"
XML$ + ~" <window name='test' flags='#PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget'>\n"
XML$ + ~" <vbox spacing='0' expand='no'>\n"
XML$ + ~" <panel name='panel_1' height='100' margin='vertical:-5,horizontal:-5'>\n"
XML$ + ~" <tab text='Dialog=margins (panel and canvas)'>\n"
XML$ + ~" <canvas name='canvas_1' margin='left:-5,right:-5,bottom:-5,vertical:-5,horizontal:-5'/>\n"
XML$ + ~" </tab>\n"
XML$ + ~" </panel>\n"
XML$ + ~" </vbox>\n"
XML$ + ~" </window>\n"
XML$ + ~"</dialogs>\n"
XML$ + ~""
If ParseXML(#Xml, XML$) And XMLStatus(#Xml) = #PB_XML_Success
If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "test")
hwd=DialogWindow(#Dialog)
PanelGadget(0,0,150,600,100)
AddGadgetItem (0, -1, "No Dialog=No margins (panel and canvas)")
CanvasGadget(1,0,0,600,100)
CloseGadgetList()
ResizeWindow(hwd,#PB_Ignore,#PB_Ignore,600,400)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
Else
Debug "Error : " + DialogError(#Dialog)
EndIf
Else
Debug "Error XML : " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIf