DialogDesigner2 — a tool to compose XML dialogs

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

DialogDesigner2 — a tool to compose XML dialogs

Post by Lunasole »

There will be no long description here (unlike what I'm often writing in such cases ^_^), because I've got tired after finishing today tool code itself. So just a short story about utility:

- It's editor to design GUIs for PB "Dialog" library
- It does that exactly by "mouse programming", the results may be exported to XML or .pb source file
- It also provides some limits to follow PB dialog library rules, thus making things easier for someone who didn't know that library
- It also has some annoying limitations for now :)

Generally might be a good concept and I've seen that since I've posted it there were few more such editors here posted, so maybe useful a bit.

Here is download:
Something like a FAQ:
  • Q: I'm adding gadget to a window and it shows "container is full", why?
    A: Dialogs are made slightly different way than regular UI. First you should add a "container" to a window, then go on with adding gadgets (and additional containers for them)

    Q: How about Linux version, how about freedom?
    A: That's currently not possible as DD2 originally focused on WinAPI, maybe Wine can help

    Q: Why there is "Import" function disabled?
    A: Because I left it for own usage (too funny it was to say "for commercial"), I had planned some variants with that (but then abandoned at all for a long time.
Last edited by Lunasole on Wed Mar 22, 2023 5:15 am, edited 10 times in total.
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: DialogDesigner2 — a tool to compose XML dialogs

Post by Andre »

Because of limited time I just did a short test - and I must say your project looks promising! :D
(such a designer makes GUI designing with exported XML dialog code easier and often allow a speed-up in developing...)

For the moment I have one suggestion: when exporting the designed dialog into PB code - it would be good, if you could add some basic code for loading/opening the dialog and a basic event loop (at least optional).

Thank you for your effort! 8)
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: DialogDesigner2 — a tool to compose XML dialogs

Post by ts-soft »

@Lunasole
Can you add a hint, there is windows-executable only and no source!
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: DialogDesigner2 — a tool to compose XML dialogs

Post by Lunasole »

Andre wrote: For the moment I have one suggestion: when exporting the designed dialog into PB code - it would be good, if you could add some basic code for loading/opening the dialog and a basic event loop (at least optional).
Thanks for reply.
That's nice idea. going to add some option in future version [after fixing some of those limits of course. for example currently all items are ordered automatically and names are always lower-case ^^]

ts-soft wrote:@Lunasole
Can you add a hint, there is windows-executable only and no source!
What about windows-only, it is already added to "homepage"
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: DialogDesigner2 — a tool to compose XML dialogs

Post by infratec »

Since I always wanted to do something with this library...

I just tested your program :wink:

I was not able to add a second gadget to a window.
'New' at the window is greyed out.

Than it is a bit confusing that there are closing crosses at the two inner windows, but they does nothing.

So at the moment I'm a bit lost. I can only create a window with one gadget inside.
(0.0.0.6)

Bernd
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: DialogDesigner2 — a tool to compose XML dialogs

Post by srod »

@Infratec : a dialog window (in the PB sense) is a single element container (it can only contain a single item such as a gadget or a container element such as a vBox). Instead of adding a gadget, add a container such as a vBox which can contain multiple entitites. You can then add gadgets to the vBox etc. Once you get used to the way the dialogs work then they are very useful.

@Lunasole, this is not bad at all. Far from complete, but a bloody great start! :) For me, the first feature request is to be able to move elements up and down the tree and into and out of containers etc. Second, could we select individual items for expanding as we can with : expand='item:2' for example. Very useful when combined with empty elements which you already support.

But, this is really good. I really like it.

Thanks for sharing.
I may look like a mule, but I'm not a complete ass.
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: DialogDesigner2 — a tool to compose XML dialogs

Post by Lunasole »

infratec wrote: So at the moment I'm a bit lost. I can only create a window with one gadget inside.
(0.0.0.6)
That's because that library follows something like web-design rules, unlike "classical" ways of building UI. I.e. you not just adding controls, you first should add container for them (like <div> in CSS). There are lot of containers with different properties, see for example PB helpfile for OpenXMLDialog() function.
Generally you should add window, add some container and only then start adding "gadgets" (as @srod said already)

> Than it is a bit confusing that there are closing crosses at the two inner windows, but they does nothing.
Those controls are "for future" (if there will be ability to hide 2 tool windows, etc), but well should be better to remove them for now :))

srod wrote: @Lunasole, this is not bad at all. Far from complete, but a bloody great start! :) For me, the first feature request is to be able to move elements up and down the tree and into and out of containers etc. Second, could we select individual items for expanding as we can with : expand='item:2' for example. Very useful when combined with empty elements which you already support.

But, this is really good. I really like it.

Thanks for sharing.
Thanks you 2 for responce, both things you mentioned already planned, just not done yet because of their "relatively higher" complexity (or saying shorter, "это геморно)").
There also "min" "max" "value" properties are not supported yet (and maybe something else like this, don't remember exactly, as I didn't made any "true serious plan" for that ^^ well properties can be added quickly, will continue with that all when there will be some time&wish)
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: DialogDesigner2 — a tool to compose XML dialogs

Post by Lunasole »

Hi again, just spend some time reviewing code and here is update. However still not done with those two important things (with "expand" and items reordering), that will be somehow later ^^

0.0.0.7
- removed item names limits (they were always lowercase previously)
- now item names are filtered (no spec chars allowed for objects which have events support)
- added all specific properties missing before: option: "group"; scrollarea: "scrolling,innerheight,innerwidth,step"; scrollbar: "page", splitter: "firstmin,secondmin";
- added some another option to export code (with some init code, instead of embedded xml only)
- fixed stupid bug with tree (in some condition it was causing infinite loop or crash)
- removed those fake x-buttons from tool windows :)
- few internal improvements of property editing window
- improved tooltips of property editing window
- little-but-nice improvements of preview window
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
infratec
Always Here
Always Here
Posts: 6817
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: DialogDesigner2 — a tool to compose XML dialogs

Post by infratec »

Hi,

maybe it would be nice (for such beginners like me), if you can disable the gadgets if a window is selected.
Because it makes only sense to add a kind of a container.
This will avoid my first mistake: add a gadget to a window and then wondering why nothing else is possible.

Bernd
loulou2522
Enthusiast
Enthusiast
Posts: 495
Joined: Tue Oct 14, 2014 12:09 pm

Re: DialogDesigner2 — a tool to compose XML dialogs

Post by loulou2522 »

infratec wrote:Hi,

maybe it would be nice (for such beginners like me), if you can disable the gadgets if a window is selected.
Because it makes only sense to add a kind of a container.
This will avoid my first mistake: add a gadget to a window and then wondering why nothing else is possible.

Bernd
I don't understand because the exe file is considere by a virus and deleted by m antivirus. Can we have the source pb Please ?
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: DialogDesigner2 — a tool to compose XML dialogs

Post by Lunasole »

infratec wrote:Hi,

maybe it would be nice (for such beginners like me), if you can disable the gadgets if a window is selected.
Because it makes only sense to add a kind of a container.
Sometimes you may need just a window with a single control (for example one with just multi-line text on it), for such cases should be allowed to add control to a window directly.
But well, that disabling of "New" menu maybe really confusing, I'll add some other way to show that container is full.
loulou2522 wrote:the exe file is considere by a virus and deleted by m antivirus.
I can suggest you only to delete your "antivirus" as it is useless, if can't recognize file produced with PB compiler and packed with UPX ^_^
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: DialogDesigner2 — a tool to compose XML dialogs

Post by Lunasole »

Updated to 0.0.0.8

Code: Select all

- Interface Tree: added support of items move/sort (all this is done using "drag&drop")
- Interface Tree: added list icons also ^_^
- Interface Tree: improved menu
- fixed bug with event callbacks generation
Now I'm really glad to see how that drag'n'drop item sorting does, despite the fact that it cost me few hours last night [when finally decided to do it this way] and propably some of my precious long hair :)
Hope there wouldn't be any bug with this stuff
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: DialogDesigner2 — a tool to compose XML dialogs

Post by Lunasole »

Hope there wouldn't be any bug with this stuff
Hah, of course it was.
Just updated file again because of that

Code: Select all

ElseIf #WM_LBUTTONUP
This piece of mistake was causing drag'drop not work on WinXP (while worked well on Win7). Should be OK now, further going to add "item:" for expand, also maybe some other ideas to make this stuff close to "useful" and forget about it for a while.
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: DialogDesigner2 — a tool to compose XML dialogs

Post by Kwai chang caine »

Very nice and simple 8)
Just a question, i can't resize the the windows with the mouse, is it the normal behavior ? :|
ImageThe happiness is a road...
Not a destination
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: DialogDesigner2 — a tool to compose XML dialogs

Post by srod »

Nice. The drag/drop works well here, though the canvas is not refreshed after a drag until you select the dialog and then the window.

The thing is though such an implementation makes it difficult to move a control into an empty container. If you drop the control atop an empty container then of course it does not place the control into the container, but instead (and inevitably) just reorders things. How about adding a couple of 'left' and 'right' buttons so that, if we click the right button, for example, the currently selected entity is placed into the preceding container? That would be sweet! :)

One last thing, any chance of adding the max/min buttons to your main Window as the Window is initially sized larger than my desktop!

A great utility though, one which I would love to use. Just need the save and load from file and I'm good to go!
I may look like a mule, but I'm not a complete ass.
Post Reply