- little bugfix on WebGadget (URL-Param was not working right)
- changed include-Path in Demos, to work on Linux as well (now using '/' instead of '\')
- added Support for Menus and StatusBars (see HERE how to use).
[Update 21.01.2017]
- little bugfix on TrackBar-Gadget
- added massive GUI-Example from André to Demo-Folder.
[Update 28.12.2016]
- fixed a little bug, which could cause problems while using container-gadgets (update available at orig. Link see below).
- cleaned up command overview in this post (see below)
- added info for 'CloseDialogWindow(DialogNr)' in command overview (see below), which should be used to close a dialog or window
[original post]
Hi there,
I'm glad to publicize my finished 'DynamicDialogs' - a Module that enables you to create professional looking and resizeable GUIs in a very easy way.
It is already in use by some users from the german-forum (like André, matbal and me) and it really helps a lot if you develop applications with dynamic and resizeable GUI.
It has also been testet under Linux and MaxOS by matbal and seems to work fine there as well.
It's based on PBs Dialog-Library, but it bypasses a lot of it's drawbacks (such as: no AutoComplete, no SyntaxCheck, no Command-Help, no Font- or Image-Support, etc.).
But it provides you with all the great benefits the Dialog-Library offers (such as: easy lineup and resize of Gadgets, extremely easy and clever (weblike) way to create complex layoutet GUIs).
If you already had a look at PBs Dialog-Library, you should be able to use DynamicDialogs within a few Minutes.
If you have never used the Dialog-Library just have a look at the description to get a general understanding about the Layout-Elements such as vBox(), GridBox(), ...
I've included some Demos. So may have a look at them to get a closer understanding of how to use DynamicDialogs.
Once you get used to it, it's quite easy and very handy.
Because the Source and the Demos are too big to post in this thread, you can download the zipped-folder HERE.
Example of a resizeable GUI (inspiderd by Michael Vogel):
General way to use:
-------------------------------
1. Just include the AddOn which provides the syntax of your choise (see description later on about the available AddOns)
2. Use "UseModule ..." to activate Modul Commands
3. Create your Dialog (your Window / Form / GUI ... or whatever you would like to call it)
4. Open your Dialog-Window (with Function: OpenDialogWindow())
The XML-Dialog Elements:
---------------------------------------------------------------------
DynamicDialogs provides all XML-Elements which are supported by PBs Dialog-Libray.
Further on it has additional support for 'Font'-Elements (see below), ImageIDs in ImageGadgets and it does support Menus and StatusBars.
During the development and use of DynamicDialogs I become aware, that it could be handy to have different syntax-types, to fit ones actual needs.
So the Command-Syntax for the XML-Elements has been splittet from the Main-Module and outsourced into separate 'AddOns'.
Each AddOn provides a slightly different Syntax, so you can choose the AddOn with the Syntax that fits your needs most.
Available AddOns (the AddOns will XInclude the Main-Module automatically):
Code: Select all
DynamicDialogs_plain - Functions have a plain syntax (e.g. Button(ID, Name$,...))
DynamicDialogs_suffixed - same Syntax as the 'plain'-Version, but with a suffix of '__' (e.g. Button__(ID, Name$, ...).
So they differ more from existing commands or functions.
Further I includet a little tool ('DynamicDialogs_Suffix Indentation-Injector.exe') which
teaches the PB-Editor to indent these 'suffixed' commands correctly.
DynamicDialogs_suffixed_IDonly - also with a suffix, but Syntax requires/supports the ID only, not the Name$ - (e.g. Button__(ID, ...)
DynamicDialogs_suffixed_NameOnly - also with a suffix, but Syntax requires/supports the Name$ only, not the ID - (e.g. Button__(Name$, ...)
Here is a List of the supported XML-Elements (with Syntax-Type from the AddOn: 'DynamicDialogs_suffixed') and some general Functions:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
[HINT:] Nearly all Parameters are optional. For more Information about the Parameters, have a look at the next post in this thread.
Code: Select all
; ===== General-Functions =====
OpenDialogWindow(DialogNr, XML$ [, ...]) ; opens a Window from a generated XML-Dialog
CloseDialogWindow(DialogNr) ; closes the Dialog-Window and cleans up all parameters and pointers
CheckDialog(XML$ [, ErrorMessageType]) ; to check, if a Dialog-Definition is OK (not really necessary, also done by OpenDialogWindow())
ClearXML() ; clears or resets the so far created XML-Code
GetXML() ; Get the so far created XML-Code
SetXMLOutputFormat(Attribut, Value) ; defines, how the generated XML-Code will be formated (indent-size, tab or space, ...)
; ===== ordinary Gadgets =====
Button__ (ID, Name$, Text$, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
ButtonImage__ (ID, Name$, Image1, Image2, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
Calendar__ (ID, Name$, Date , Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
Canvas__ (ID, Name$, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
CheckBox__ (ID, Name$, Text$, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
ComboBox__ (ID, Name$, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
DateTime__ (ID, Name$, Mask$, Date, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
Editor__ (ID, Name$, Text$, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
ExplorerCombo__(ID, Name$, Path$, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
ExplorerList__ (ID, Name$, Path$, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
ExplorerTree__ (ID, Name$, Path$, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
HyperLink__ (ID, Name$, Text$, Color, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
IPAddress__ (ID, Name$, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
Image__ (ID, Name$, ImageID , Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
ListIcon__ (ID, Name$, FirstColumnTitle$ , FirstColumnWidth, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
ListView__ (ID, Name$, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
Option__ (ID, Name$, Text$, Group, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
ProgressBar__ (ID, Name$, Min, Max=100, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
ScrollBar__ (ID, Name$, Min, Max=100, Value, PageLength=50, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
Spin__ (ID, Name$, Min, Max=100, Value, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
String__ (ID, Name$, Text$, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
Text__ (ID, Name$, Text$, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
TrackBar__ (ID, Name$, Min, Max=100, Value, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
Tree__ (ID, Name$, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
Web__ (ID, Name$, URL$, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
Scintilla__ (ID, Name$, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
Font__ (FontName, Height, Style=0)
FontByID__ (FontID)
; ===== Layout Elements (need 'End...'-Command to close) =====
Dialogs__ ()
Window__ (ID, Name$, Titel$, Flags, Width, Height, MinWidth=0, MinHeight=0, MaxWidth=0, MaxHeight=0, XmlParam$)
vBox__ (Expand, Align, Spacing, XmlParam$)
hBox__ (Expand, Align, Spacing, XmlParam$)
GridBox__ (Columns, ColSpacing, RowSpacing, ColExpand, RowExpand, XmlParam$)
MultiBox__ (Expand, Align, Margin$, XmlParam$)
SingleBox__ (Expand, Align, Margin$, Expandwidth, Expandheight, XmlParam$)
Empty__ (Width, Height, XmlParam$)
EndDialogs__ ()
EndWindow__ ()
EndVBox__ ()
EndHBox__ ()
EndGridBox__ ()
EndMultiBox__ ()
EndSingleBox__ ()
; ===== Container Elements (PureBasic Gadgets, which can contain other Gadgets - need 'End...'-Command to close) =====
Container__ (ID, Name$, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
Frame__ (ID, Name$, Text$, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
Panel__ (ID, Name$, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
ScrollArea__ (ID, Name$, ScrollAreaWidth, ScrollAreaHeight, ScrollStep, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
Splitter__ (ID, Name$, FirstMinSize, SecondMinSize, Flags, Width, Height, Align, Margin$, ColSpan, RowSpan, XmlParam$)
Tab__ (Text$, Margin$)
EndContainer__ ()
EndFrame__ ()
EndPanel__ ()
EndTab__ ()
EndScrollArea__()
EndSplitter__ ()
HINT: Instead of using the specific 'End...'-Command , you could use 'CloseNode__()' in any Case.
Maybe it could be of some use for you.
Any questions or comments are welcome.