I'm trying to use the dialog library and again I have
some sort of problem.
Why does a with 'expand' marked part of a window
not expand after its available space has expanded?
I know I can do it manually, but I thought a dialog
would do it by itself in the same manner when the
window is manually resized by the user.
In my example I've got a progressbar below an edi-
tor, which is created with 'expand' set.
When freeing the progressbar, the editor is not using
the freed space.
Code: Select all
Runtime Enumeration
#MainWindow = 1
EndEnumeration
Runtime Enumeration
#Button1
#Text1
#Editor1
#Progressbar
EndEnumeration
Procedure ToggleProgressbar()
If IsGadget(#Progressbar)
FreeGadget(#Progressbar)
EndIf
EndProcedure
XML$="<?xml version='1.0' encoding='UTF-8'?>"+
"<dialogs>"+
" <window ID='#MainWindow' text='Test' name='myWindow'"+
" minwidth='640' minheight='480'"+
" flags='#PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_ScreenCentered |"+
" #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget'>"+
" <vbox expand='item:2'>"+
" <hbox expand='item:2'>"+
" <button ID='#Button1' width='12' height='12' text='?'>"+
" </button>"+
" <text ID='#Text1' height='12' text='- Delete progressbar'>"+
" </text>"+
" </hbox>"+
" <editor ID='#Editor1' text='Editor 1'>"+
" </editor>"+
" <progressbar ID='#Progressbar' height='8' min='0' max='100'>"+
" </progressbar>"+
" </vbox>"+
" </window>"+
"</dialogs>"
xmlGUI = ParseXML(#PB_Any, XML$)
If xmlGUI
If XMLStatus(xmlGUI) = #PB_XML_Success
dlgGUI = CreateDialog(#PB_Any)
If dlgGUI
If OpenXMLDialog(dlgGUI, xmlGUI, "myWindow")
BindGadgetEvent(#Button1, @ToggleProgressbar())
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
Else
Debug "Error in dialog definition: " + DialogError(dlgGUI)
EndIf
Else
Debug "Dialog could not be created!"
EndIf
Else
Debug "XML error: " + XMLError(xmlGUI)
Debug " in line " + Str(XMLErrorLine(xmlGUI)) + " at position " + Str(XMLErrorPosition(xmlGUI))
EndIf
FreeXML(xmlGUI)
Else
Debug "XML could not be catched from memory."
End
EndIf