Tutorial for using XML Dialog?
- thinkitsimple
- User
- Posts: 89
- Joined: Mon Aug 13, 2012 6:12 pm
- Location: Berlin, Germany
- Contact:
Tutorial for using XML Dialog?
Hi,
i love the idea of separating code and UI using the XML based Dialog library.
The PureBasic help explains the commands, but is there a tutorial for people like me who are used to code the UI in PureBasic directly?
I would be nice, if someone who has already earned some experience in using the Dialog library in a complete app could give some introduction in this.
Thanks.
i love the idea of separating code and UI using the XML based Dialog library.
The PureBasic help explains the commands, but is there a tutorial for people like me who are used to code the UI in PureBasic directly?
I would be nice, if someone who has already earned some experience in using the Dialog library in a complete app could give some introduction in this.
Thanks.
Michael
PureBasic 5.51, macOS 10.12.2 Sierra
PureBasic 5.51, macOS 10.12.2 Sierra
Re: Tutorial for using XML Dialog?
I was thinking the same thing a long time ago. I do not understand XML and Dialog library. I understand that XML has been invented to make things easier in computerworld, but in my opinion it's not.
-
- Enthusiast
- Posts: 551
- Joined: Tue Oct 14, 2014 12:09 pm
Re: Tutorial for using XML Dialog?
Hi all,
If someone has a tuto about dialogs he will be welcome
Thanks in advance
If someone has a tuto about dialogs he will be welcome
Thanks in advance
- Andre
- PureBasic Team
- Posts: 2139
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: Tutorial for using XML Dialog?
Not really a tutorial, but a powerful framework to ease the creating of dialogs (pure XML code is generated by the framework) and several GUI/Dialog example codes:
DynamicDialogs - creating dynamic Dialogs the easy way ...
DynamicDialogs - creating dynamic Dialogs the easy way ...
-
- Enthusiast
- Posts: 551
- Joined: Tue Oct 14, 2014 12:09 pm
Re: Tutorial for using XML Dialog?
Thanks Andre,
I try this example , but i have some trouble to understand what is a vbox, an hbox a gridbox, singlebox and multiplebox and what case in using it ?
Is there a program like pureform which allow to create windows visually ?
Thanks
I try this example , but i have some trouble to understand what is a vbox, an hbox a gridbox, singlebox and multiplebox and what case in using it ?
Is there a program like pureform which allow to create windows visually ?
Thanks
- Andre
- PureBasic Team
- Posts: 2139
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: Tutorial for using XML Dialog?
If you mean for creating resizable dialogs (which use the functions/specifications of the Dialog library) I think not.loulou2522 wrote:Thanks Andre,
I try this example , but i have some trouble to understand what is a vbox, an hbox a gridbox, singlebox and multiplebox and what case in using it ?
Is there a program like pureform which allow to create windows visually ?
GUI designers for creating dialogs with the "standard" Gadget functions (of the Gadget library) are available in several forms, e.g. the mentioned PureForm. But most of them are not aware of different font sizes, resizing possibilities, etc. (except the PureVisionXP package I think).
With the mentioned 'DynamicDialogs' package and the included examples you should be able to find out the correct use, including the vbox (for arranging gadgets or further gadget groups vertically), the hbox (the same horizontally) or in a gridbox (table style).
Re: Tutorial for using XML Dialog?
My question is directed @Andre who seems to have experience using XML-based dialogs.
What advantage is there in using XML to create dialogs ?
I have no trouble reading and following standard PB code to create a window and populate it with gadgets that serve the application's goal.
But I'm completely befuddled when I look at XML code...
One thing i haven't done yet, however, is to follow Andre's suggestion to look at the Dynamic Dialog demos.
So I'm heading there right away.
But my question remains.
What advantage is there in using XML to create dialogs ?
I have no trouble reading and following standard PB code to create a window and populate it with gadgets that serve the application's goal.
But I'm completely befuddled when I look at XML code...

One thing i haven't done yet, however, is to follow Andre's suggestion to look at the Dynamic Dialog demos.
So I'm heading there right away.
But my question remains.
PB Forums : Proof positive that 2 heads (or more...) are better than one 

Re: Tutorial for using XML Dialog?
Allows you to, some extent, separate GUI layout from program logic and, once you get used to it, makes knocking up even a quite complex dialog a breeze. I find it much easier to read the XML representation of a dialog than a bunch of PB commands in the IDE (though maybe that's just my particular coding style!
)
There is also the fact that all layout/resizing and device independence logic is automatically handled for us which saves on a whole bunch of code, though of course that's really getting away from the 'why XML?' question.
Honestly, I am knocking out dialogs at a far more productive rate than I used to. Still use good old PB Window/Gadget functions mind for the main GUIs.
Probably not for everyone though, but I like being able to separate the dialog layout from the program logic. It's like the old form-designer/hand-coded GUI argument. I much prefer hand coding, but that's just me.

There is also the fact that all layout/resizing and device independence logic is automatically handled for us which saves on a whole bunch of code, though of course that's really getting away from the 'why XML?' question.
Honestly, I am knocking out dialogs at a far more productive rate than I used to. Still use good old PB Window/Gadget functions mind for the main GUIs.
Probably not for everyone though, but I like being able to separate the dialog layout from the program logic. It's like the old form-designer/hand-coded GUI argument. I much prefer hand coding, but that's just me.
I may look like a mule, but I'm not a complete ass.
Re: Tutorial for using XML Dialog?
I believe XML was chosen since it's already used in XUI (XML UI)srod wrote:that's really getting away from the 'why XML?' question
Re: Tutorial for using XML Dialog?
@srod: thank you for taking the time.
I appreciate even more the advantages you point out, now that I've experienced them first-hand after spending quite a few hours and effort to familiarize myself with XML-based dialog building. Indeed, i do see how much faster and simpler coding becomes with the XML approach.
It's been an interesting, albeit belated, discovery.
However, I still feel intimidated by all the XML 'wordiness'.
But that, I expect, will evaporate once I really start crafting my own, rather than simply reading and modifying other people's code.
I appreciate even more the advantages you point out, now that I've experienced them first-hand after spending quite a few hours and effort to familiarize myself with XML-based dialog building. Indeed, i do see how much faster and simpler coding becomes with the XML approach.
It's been an interesting, albeit belated, discovery.

However, I still feel intimidated by all the XML 'wordiness'.

But that, I expect, will evaporate once I really start crafting my own, rather than simply reading and modifying other people's code.
PB Forums : Proof positive that 2 heads (or more...) are better than one 

- Andre
- PureBasic Team
- Posts: 2139
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: Tutorial for using XML Dialog?
Hi blue,
while srod has already written about the general advantages of dialogs (for me this are automatically detecting/supporting different fonts, resizeable dialog windows+gadgets, manually calculation/coding of fixed gadget locations isn't needed) I initially had my problems with coding error-free XML dialog definitions. You can easily make simple errors (one char forgotten etc.), which you don't see before compiling and so executing the OpenXMLDialog() command with given XML dialog descriptions. So I needed a lot trial & error, before a dialog finally worked as expected...
That's why I tried and fully switched to the powerful DynamicDialogs framework, which not only makes the creation of Dialogs a lot more simpler, but also extend the regular functionality e.g. with easy support of different fonts in the same dialog, etc.
All in all I'm a lot more productive with DynamicDialogs, which also comes with several Dialog GUI examples (a very complex one also contributed by me).
while srod has already written about the general advantages of dialogs (for me this are automatically detecting/supporting different fonts, resizeable dialog windows+gadgets, manually calculation/coding of fixed gadget locations isn't needed) I initially had my problems with coding error-free XML dialog definitions. You can easily make simple errors (one char forgotten etc.), which you don't see before compiling and so executing the OpenXMLDialog() command with given XML dialog descriptions. So I needed a lot trial & error, before a dialog finally worked as expected...
That's why I tried and fully switched to the powerful DynamicDialogs framework, which not only makes the creation of Dialogs a lot more simpler, but also extend the regular functionality e.g. with easy support of different fonts in the same dialog, etc.
All in all I'm a lot more productive with DynamicDialogs, which also comes with several Dialog GUI examples (a very complex one also contributed by me).

Re: Tutorial for using XML Dialog?
Hello Andre.
Thank you your input and for pointing out the existence of DynamicDialogs. Indeed, as you say, it makes life as a coder much simpler. Curious as I am, I went looking into the include file... and I started having fainting spells.
Incredibly complex stuff
... to my feeble mind anyway!
So, for the time being, I'll stick to using it as a black box.
Understanding will eventually come to me, along with wisdom and other goodies of old age !
Same, same here. You're quite right.Andre wrote:You can easily make simple errors (one char forgotten etc.)... So I needed a lot trial & error, before a dialog finally worked as expected...
Thank you your input and for pointing out the existence of DynamicDialogs. Indeed, as you say, it makes life as a coder much simpler. Curious as I am, I went looking into the include file... and I started having fainting spells.

Incredibly complex stuff

So, for the time being, I'll stick to using it as a black box.

Understanding will eventually come to me, along with wisdom and other goodies of old age !
PB Forums : Proof positive that 2 heads (or more...) are better than one 
