Designing large amount of GUI elements

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
MagickPanda
Experienced Solver
Experienced Solver
Posts: 81
Joined: Wed Oct 19, 2016 1:41 pm

Designing large amount of GUI elements

Post 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.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Designing large amount of GUI elements

Post 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/
Use the source, Luke!
Nunki
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 235
Joined: Fri Sep 14, 2012 8:26 am
Location: Kontich, Belgium
Contact:

Re: Designing large amount of GUI elements

Post 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 3832 times
regards,
Nunki
coderrc
Earned some good credits
Earned some good credits
Posts: 141
Joined: Tue Nov 01, 2016 2:46 pm

Re: Designing large amount of GUI elements

Post 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:
Nunki
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 235
Joined: Fri Sep 14, 2012 8:26 am
Location: Kontich, Belgium
Contact:

Re: Designing large amount of GUI elements

Post 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
MagickPanda
Experienced Solver
Experienced Solver
Posts: 81
Joined: Wed Oct 19, 2016 1:41 pm

Re: Designing large amount of GUI elements

Post 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.
Gnawer
Experienced Solver
Experienced Solver
Posts: 65
Joined: Thu Jun 29, 2006 11:10 am
Location: Ahlen, Germany

Re: Designing large amount of GUI elements

Post 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.
Best regards
Gnawer
Post Reply