Working through zetcode’s wxwidget tutorital: Dialogs

I’m sort getting anxious to get through this tutorial and start doing some actual coding…
I’ve been thinking about some of the projects I could do…. Ultimately, my goal is to get my C++ skill sets up to the point where I can start playing around with Opencascade effectively. I read somewhere that it could take a couple of years of experience to get dangerous with this stuff..
Anyway, I have a C++ time saving techniques for dummies that I’ve had checked out of the library for a while. I think I may have blogged about perhaps doing a Gui front ends for the examples.. That would be good learning practice…

Also, years ago I did a fun project in vb for 4 bar linkages in VB6. I think it would be an interesting exercise do convert this to C++ wxwidgets. I did a search on 4 bar linkages and happened to have ran into this site, which I think is pretty awesome. This guy is to say the least is very interesting:http://www.martindalecenter.com/Calculators4_2_Mech.html

So… Anyway my quiet time is almost up… It’s Christmas morning lets see if a can pop off a little of this section before the house wakes up…;)
Ok…
I’m looking through this section it show the following:

  • Predefined dialogs which you can tweak. Yes/No, OK kind of stuff.  Different icon’s can plopped on.
  • WxFileDialog which seems to be wxwidgets equivalent to a vb6 common dialog control… Very cool
  • WxFontDialog this is pretty much self explanatory.
  • Custom dialog control. todo (Need to understand difference/usage between wxDialog and wxFrame’s

Alrighty, I’m going to try to rip through this section in record time
Predefined dialogs points of interest:
This application shows for command buttons: info, error, question, Alert, which when pressed open up an appropriate dialog.
Note to self.. why no pretty icon on the main buttons?? Saw that somewhere in the tutorial.
This is pretty much the equivalent of a vb6 messagebox.  Documentation on usage is here.

WxFileDialogs point of interest:
This is sort of a cool simple example. Main window with a “file->Open” pulldown menu and a muli-line wxTextCtrl
Click on the file open the standard WxfileDialog opens up.
Now this is more vb’ish… Up to know it seems like you had to do many lines of code to get anything done. This seems to be far more terse:

void Openfile::OnOpen(wxCommandEvent& event)
{

wxFileDialog * openFileDialog = new wxFileDialog(this);

if (openFileDialog->ShowModal() == wxID_OK){
wxString fileName = openFileDialog->GetPath();
tc->LoadFile(fileName);
}
}

tc is defined in the constructor… This is more like it…

Ok… enough of that on to wxFontDialog. Well maybe a little later… The house has now awoken…

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *