Newbee question: How to get started in DialogBlocks / wxWidgets

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
JOHI
In need of some credit
In need of some credit
Posts: 3
Joined: Fri Jul 20, 2018 8:25 pm

Newbee question: How to get started in DialogBlocks / wxWidgets

Postby JOHI » Sat Jul 21, 2018 7:53 am

Hello forum members,

I have been using MFC and VC for more than 25 years, but recently i decided to look at wxWidgets and dialogBlocks.
I got WxWidgets "hello world" running on VC without much problems.
I can compile and run sample projects on DialogBlocks and run them succesffully from time to time, but I am unable to make a new application in DialogBlocks.

Is there any decent manual available that explains step by step how to use the IDE together with wxWidgets ?
I read the wiki pages, eventhandlers, device contexts, app classes, frames, i all do understand them because they are close to what MFC did, but how to use the tool so it does not keep on nagging i have not found yet.
I also read the getting started manual from DialogBlocks, this document is plenty of publicity what is all possible, but it does not explain how to get started with making a real application.

Best Regards,
Johi.

User avatar
doublemax
Moderator
Moderator
Posts: 12889
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Newbee question: How to get started in DialogBlocks / wxWidgets

Postby doublemax » Sat Jul 21, 2018 1:13 pm

I don't use any GUI editor myself, so i can't go into any detail. But what do you mean with "real application"? E.g. if you create an empty wxWidgets project in CodeBlocks, it already compiles and runs.

However, even if you plan to use a GUI editor, i would suggest to study the "minimal" sample that comes with wxWidgets first. In a single file you have everything that makes the "architecture" of a wxWidgets application. You should be able to read it top to bottom and have a general idea about what every single line does.

It's also essential to understand the "sizer" concept, because even if all GUI editors use sizers, they won't explain the concept behind them.
http://neume.sourceforge.net/sizerdemo/
Use the source, Luke!

JOHI
In need of some credit
In need of some credit
Posts: 3
Joined: Fri Jul 20, 2018 8:25 pm

Re: Newbee question: How to get started in DialogBlocks / wxWidgets

Postby JOHI » Sun Jul 22, 2018 7:11 pm

Hello Doublemax,
Thank you for the reaction. I think your analysis is 100% correct:
I found a tutorial within the DialogBlocks help that shows how to make a dialog box using some kind of resource editor that generated C++ code.
However, I got stuck in the end again because I could not find if the basic idea of that IDE is to add the code to construct the dialog class to the app myself or by some kind of wizzard. This step was omitted from the tutorial. On top of that, the point where I thought I could add the necessary code was blocked by DialogBlocks...
So I threw DialogBlocks overboard and switched back to my old workhorse VisualStudio2008. With good result: My first wxWidgets application (an online watch window to monitor variables of a DE10-Standard fpga board over an RS232C interface using wxGrid and wxThread) is ready for debugging.
The wxWidgets library is really amazing and versatile, everything fits very well, respect for those who build and maintain it!
Best Regards,
Johi.

I

Bill Heitler
In need of some credit
In need of some credit
Posts: 3
Joined: Mon Apr 30, 2018 2:02 pm

Re: Newbee question: How to get started in DialogBlocks / wxWidgets

Postby Bill Heitler » Wed Sep 26, 2018 8:40 am

I was in very much the same situation a few months ago - porting a fairly large MFC program that I have built over the years, to wxWidgets to try to get source code compatibility with a Mac (haven't actually tried that yet...)

Anyway, I agree it is difficult getting started with DialogBlocks, and there is no "book" that I am aware of. However, I do think it's worth persisting with it, although I'm definitely still a newbie myself. So far, I've found it very useful indeed for constructing complex dialog boxes and other visual resources.

Here are 4 random bits of advice:

First, I would construct a bare-bones program following the DB tutorial, and then I would switch to using using Visual Studio as the "main" controller. I do nearly all of the actual coding and all the compiling from there rather than using the code-editing facilities in DB. I use DialogBlocks almost purely as a resource editor.

Second, make sure that you keep the two things synchronized. In particular, if you add any non-GUI files to the project in VS, then make sure you add them in the Sources section in DB too, or DB will merrily remove them from the project next time you save from DB after editing some GUI element.

Third, personally, I wouldn't bother with setting up member variables in DB. I tried it, but found it easier to do it in VS, and to code the widget validators myself rather than trying to get DB to do it.

Finally, I have found Julian Smart, who is the original author of widgets itself, and is both the author and current maintainer of DB, to be incredibly helpful and responsive. He probably won't thank me for saying this if it gives him more work, but I have asked him several newbie questions about DialogBlocks, and have always had a rapid, polite, and very useful (!) response.

Good luck.
Last edited by doublemax on Wed Sep 26, 2018 6:28 pm, edited 1 time in total.
Reason: added some newlines to make it more readable

Nunki
I live to help wx-kind
I live to help wx-kind
Posts: 190
Joined: Fri Sep 14, 2012 8:26 am
Location: Kontich, Belgium
Contact:

Re: Newbee question: How to get started in DialogBlocks / wxWidgets

Postby Nunki » Sun Sep 30, 2018 3:13 pm

Hi Johi,

I've been using wxWidgets for some years now and I'm still learning. So newbie or more experienced, your question is a valid one. I too use DialogBlocks, quite heavily I may say so. But after some time I started using DB purely as a GUI editor, not so much as a code generator. So to me the logical step to take was using XRC files. I don't bother about the generated code. I only use the XRC file, let the application load them and display them. I try to have as little 'create windows/widget' stuff as possible in my code. But I would not go as far as to throw DB overboard. It does save you lots of time designing a screen (GUI stuff) with such an application.

Anyway, have fun. wxWidgets is indeed great and offers a true multi-platform solution (no virtual machines or interpreters).

with regards,
Nunki


Return to “Compiler / Linking / IDE Related”

Who is online

Users browsing this forum: No registered users and 5 guests