I have a few problems with the dialog library; I hope you can help me.
1. Handling list icon columns.
I see nothing about it either on forum or in the help file, but looking at the PB ide, I see it does:
Code: Select all
<listicon id="#GADGET_Preferences_ShortcutList" flags="#PB_ListIcon_FullRowSelect">
<column width="200" lang="Shortcuts:Action" />
<column width="90" lang="Shortcuts:Shortcut" />
</listicon>
What is the easiest way to create a listicon with multiple columns that would automatically resize themselves just like the gadget would?
2. Calling RefreshDialog reverts the window state, e.g., maximized.
Unless I don't understand how that function works, you're meant to call refresh dialog if the window changes, e.g., moved, resized, minimized, maximized, etc., but when I do that, and my window was maximized beforehand, it reverts that.
Code: Select all
EnableExplicit
#xml$="<window id='0' name='test' text='test' flags='#PB_Window_ScreenCentered|#PB_Window_SizeGadget|#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget' minwidth='auto' minheight='auto' maxwidth='auto' maxheight='auto'><hbox><vbox><button id='0' name='test' text='test'/></vbox></hbox></window>"
ParseXML(0, #xml$)
Define err.s=XMLError(0)
If err<>""
MessageRequester(err, ""+XMLErrorLine(0)+", "+XMLErrorPosition(0))
End
EndIf
CreateDialog(0)
OpenXMLDialog(0, 0, "test")
err=DialogError(0)
If err<>""
MessageRequester("error", err)
End
EndIf
; try to maximize the window, and it will automatically revert the maximized state thanks to RefreshDialog()
Repeat
Define e=WaitWindowEvent()
Select e
Case #PB_Event_SizeWindow, #PB_Event_MoveWindow, #PB_Event_MinimizeWindow, #PB_Event_MaximizeWindow, #PB_Event_RestoreWindow
Debug "before: "+GetWindowState(0)
RefreshDialog(0)
Debug "After: "+GetWindowState(0)
EndSelect
Until e=#PB_Event_CloseWindow
Thanks.