Page 1 of 1

Designing large amount of GUI elements

Posted: Wed Apr 19, 2017 1:46 am
by MagickPanda
I am wonder if there is an easy way to design large amount of GUI elements, e.g:buttons, labels, static texts etc.
It seems to be a bit PITA to edit layout of a certain window/frame with plain coords and.. imagination
I looked at that wxwidget gui editor, but it seems the tool is rather dated and unmaintained, and sometime errors out/crash at some point and generated bugged code.

Thanks.

Re: Designing large amount of GUI elements

Posted: Wed Apr 19, 2017 5:36 am
by doublemax
Define "large amount".

If you're talking about many, repeating objects or group of objects it might be easier to create them dynamically at runtime.

Otherwise, there are several GUI editors and i haven't heard about them being unstable. Maybe try another one.

And you're not supposed to use fixed coordinates in wxWidgets, layouts are usually done with sizers. But you have to understand the concept behind them in order to build a proper layout, even with a GUI editor.
http://neume.sourceforge.net/sizerdemo/

Re: Designing large amount of GUI elements

Posted: Wed Apr 19, 2017 6:23 pm
by Nunki
Hi,
I use the Dialogblocks GUI editor written by Julian Smart, the man who started the wxWidgets project. A tool with a reasonable price that has reduced development time considerably. So it's worth every penny, dollarcent or eurocent if you like. The reason I like this tool is because it allowed me to separate to a certain level the GUI from the C++ code. The editor even generates C++ code if you like, but after some experiments I decided it was better to use the generated xrc files (XML) instead of the C++ code. In that way I now have separate directories for the GUI xrc files for every language in a project. It has proven to be a very stable editor, giving you a drag and drop interface so that you can quickly build dialogs, frames with lots and lots of controls. As you may see on the screenimage below even relative complex dialog is not that hard to make. Also it may help that all your screens are kept together in a project file, simply open it in DB and you get a treeview with all your frames, windows and dialogs.
personen.png
personen.png (24.62 KiB) Viewed 3886 times
regards,
Nunki

Re: Designing large amount of GUI elements

Posted: Wed Apr 19, 2017 8:40 pm
by coderrc
+1 for dialog blocks. I came for the windows RC file import function and stayed for the awesomeness.

The savefile is a fairly straightforward XML file, so it's very easy to write a program that does bulk edits on the project file. Like say you have a custom button that gets used 1000+ times and you want to update all of them, its dead easy to script the change instead of clicking on every button and changing it in the editor.

You can also run it from the command line rather than gui to do stuff in a more scripty way.

There a a few niggles though. Chiefly the fact that you cant drag items around the gui to reposition them, you have to use the sidebar instead. :roll:

Re: Designing large amount of GUI elements

Posted: Wed Apr 19, 2017 10:10 pm
by Nunki
coderrc wrote: There a a few niggles though. Chiefly the fact that you cant drag items around the gui to reposition them, you have to use the sidebar instead. :roll:
There you got a point on editing the xml file outside the editor for a bulk change, haven't tried that one yet.
If you refer to the repositioning on TAB order of elements, that needs to be done by re-dropping controls in it's parent sizer or panel in the right order, that's true. But once you know that it's not that bad. If you refer to the positioning of controls on a parent frame, I use a combination of a wxGridBagSizer and wxBoxSizer H or V. And then of course the use of spacers to add some spacing 'cause sometimes I want more space on the left and right than on the top and bottom.
And of course you can copy part of a dialog to another dialog, that saves time too.

regards,
Nunki

Re: Designing large amount of GUI elements

Posted: Wed Apr 19, 2017 11:23 pm
by MagickPanda
Thanks for the replies.

I will take a look at the demo doublemax mentioned. And download the DialogBlocks tool Nunki and codeerr posted.

Re: Designing large amount of GUI elements

Posted: Fri Apr 21, 2017 7:20 am
by Gnawer
For years I used the free software "wxFormBuilder" and I'm quite satisfied with it.
The biggest GUI I created contains dozens of dialogs with notebook-controls, panels, bitmaps, grids, buttons and almost all what is available.

Beside any GUI Builder you have to understand how the sizer system in wx works.