Seems not to be that easy to get rid of the flickering, maybe some additional functions for the dialog lib would be fine (PB6?)...
...I never player around with xml dialogs, refreshing things in windows is easier
Here's a try to keep the main window in front and to use a "shadow" copy of the dialog to reduce the blending effect (in reality, it pulsates here which also doesn't look that fine):
Code: Select all
Enumeration
#Xml
#Dlg
EndEnumeration
Global Dim RefreshCounter(99)
Global xml.s
Procedure UpdateDialog(id)
Protected flag
flag=RefreshCounter(id)
RefreshCounter(id)+1
id=id<<1+flag&1
Debug id
CreateDialog(id)
OpenXMLDialog(id,#Xml,"Window_Main", 200, 200)
HideWindow(DialogWindow(id),0,#PB_Window_NoActivate)
If flag
HideWindow(DialogWindow(id!1),1)
EndIf
SetForegroundWindow_(WindowID(0))
EndProcedure
OpenWindow(0,800,400,600,200,"Main")
StickyWindow(0,1)
If LoadXML(#Xml,"Test.xml") And XMLStatus(#Xml) = #PB_XML_Success
Repeat
Select WaitWindowEvent()
Case #WM_CHAR
UpdateDialog(#Dlg)
Case #PB_Event_CloseWindow
End
EndSelect
ForEver
EndIf
Here's the demo xml:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<dialogs>
<window name="Window_Main" flags="#pb_window_invisible|#PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered" minwidth="800" minheight="680">
<vbox expand="item:2">
<hbox align="center" expand="no">
<buttonimage name="newfile" width="20" height="20" />
<buttonimage name="loadfile" width="20" height="20" />
<buttonimage name="savefile" width="20" height="20" />
<buttonimage name="savefileas" width="20" height="20" />
<empty width="35"/>
<buttonimage name="showall" width="20" height="20" />
<buttonimage name="hideall" width="20" height="20" />
<empty width="10"/>
<text text="Dialog Definition:"/>
<vbox>
<combobox width="100" name="definition" />
<empty/>
</vbox>
<text text="Dialog Refresh Time:"/>
<trackbar name="refreshdelay" width="100" min="1" max="10" flags="#PB_TrackBar_Ticks" value="2"/>
<text name="refreshtime" text="1000 ms"/>
</hbox>
<hbox>
<splitter flags="#PB_Splitter_Vertical | #PB_Splitter_Separator" name="splitter">
<frame text="Objects:" width="150">
<tree name="tree_objects" flags="#PB_Tree_AlwaysShowSelection" />
</frame>
<vbox width="400" expand="item:4">
<frame text="Properties">
<gridbox columns="4" colexpand="yes" rowexpand="no">
<text text="ID:"/>
<string name="_id" width="150"/>
<text text="Width:"/>
<string name="width" width="150"/>
<text text="Name:"/>
<string name="name"/>
<text text="Height:"/>
<string name="height"/>
<text text="Text:"/>
<string name="text"/>
<frame colspan="2" text="Flags" width="250" height="140" rowspan="6">
<tree name="flags" flags="#PB_Tree_NoLines | #PB_Tree_CheckBoxes" />
</frame>
<text text="Min:"/>
<string name="min"/>
<text text="Max:"/>
<string name="max"/>
<text text="Value:"/>
<string name="value"/>
<text text="Group:"/>
<string name="group"/>
<text text="Page:"/>
<string name="page"/>
<checkbox name="invisible" colspan="2" text="Invisible"/>
<frame text="Event Procedures" colspan="2" rowspan="3">
<vbox>
<combobox name="onevents"/>
<string name="onevent_proc"/>
</vbox>
</frame>
<checkbox name="disabled" text="Disabled" colspan="2"/>
<hbox colspan="2" align="" expand="no">
<buttonimage name="userattributes" width="24" height="24"/>
<buttonimage name="refresh" width="24" height="24"/>
<buttonimage name="move_up" width="24" height="24"/>
<buttonimage name="move_down" width="24" height="24"/>
</hbox>
</gridbox>
</frame>
<frame text="Special Properties">
<multibox>
<container name="container_window" invisible="yes">
<gridbox columns="4">
<text text="MinWidth:"/>
<string name="minwidth"/>
<text text="MinHeight:"/>
<string name="minheight"/>
<text text="MaxWidth:"/>
<string name="maxwidth"/>
<text text="MaxHeight:"/>
<string name="maxheight"/>
</gridbox>
</container>
<container name="container_boxes" invisible="yes">
<gridbox columns="4">
<text text="Spacing:"/>
<string name="spacing"/>
<text text="Align:"/>
<combobox name="alignbox"/>
<text text="Expand:"/>
<combobox name="expandbox"/>
<text text="Item:"/>
<string name="expandboxitem"/>
</gridbox>
</container>
<container name="container_gridbox" invisible="yes">
<gridbox columns="4">
<text text="Columns:"/>
<string name="columns"/>
<text text="Colspacing:"/>
<string name="colspacing"/>
<empty colspan="2"/>
<text text="Rowspacing:"/>
<string name="rowspacing"/>
<text text="Colexpand:"/>
<combobox name="colexpand"/>
<text text="Item:"/>
<string name="colexpanditem"/>
<text text="Rowexpand:"/>
<combobox name="rowexpand"/>
<text text="Item:"/>
<string name="rowexpanditem"/>
</gridbox>
</container>
<container name="container_multibox" invisible="yes"/>
<container name="container_singlebox" invisible="yes">
<gridbox columns="4">
<text text="Margin:"/>
<combobox name="margincombo"/>
<text text="Value:"/>
<string name="marginext"/>
<text text="Expand:"/>
<combobox name="expandsingle"/>
<text text="Align:"/>
<tree name="alignsingle" flags="#PB_Tree_NoButtons | #PB_Tree_CheckBoxes" rowspan="3"/>
<text text="ExpandWidth:"/>
<string name="expandwidth"/>
<empty/>
<text text="ExpandHeight:"/>
<string name="expandheight"/>
</gridbox>
</container>
<container name="container_splitter" invisible="yes">
<gridbox columns="4">
<text text="FirstMin:"/>
<string name="firstmin"/>
<text text="SecondMin:"/>
<string name="secondmin"/>
</gridbox>
</container>
<container name="container_scrollarea" invisible="yes">
<gridbox columns="4">
<text text="Scrolling:"/>
<combobox name="scrolling"/>
<empty colspan="2"/>
<text text="InnerHeight:"/>
<string name="innerheight"/>
<text text="InnerWidth:"/>
<string name="innerwidth"/>
</gridbox>
</container>
<container name="container_comment" invisible="yes">
<hbox expand="item:2">
<text text="Comment:"/>
<editor name="comment"/>
</hbox>
</container>
</multibox>
</frame>
<frame text="GridBox Childs">
<hbox expand="yes" alignbox="top/left">
<text text="Colspan:"/>
<string name="colspan" width="125"/>
<text text="Rowspan:"/>
<string name="rowspan" width="125"/>
</hbox>
</frame>
<frame text="Log:">
<editor name="log" flags="#PB_Editor_ReadOnly" height="60"/>
</frame>
</vbox>
</splitter>
</hbox>
</vbox>
</window>
</dialogs>