Code::Blocks

User forums => Using Code::Blocks => Topic started by: Dr.Optix on June 26, 2009, 10:37:57 am

Title: [wxSmith] Multiple Dialogs
Post by: Dr.Optix on June 26, 2009, 10:37:57 am
Hello currently I'm working for a music player and I need to have multiple dialogs like (DlgMain, DlgSelectOutputDeviceDeckA,DlgSelectOutputDeviceDeckB etc).

My question is how I can do something like this using wxSmith:

One dialog have an button on it ("About"), when I click "About" I want a dialog to show up with information about my player. Also I want to note that I'm a beginner with wxWidgets and wxSmith, until now all I did were one dialog apps and the the about section was a simple MessageBox, but now I can't use this approch because my dialog needs to contain a photo with the team who was working on the

~Dr.Optix
Title: Re: [wxSmith] Multiple Dialogs
Post by: Dr.Optix on June 26, 2009, 12:21:30 pm
Well I solved this issue by looking at Code::Blocks source

Here is the code that is executed when clicking on Help->About, let's asume this code is in MainFrame.cpp
Code: [Select]
void MainFrame::OnHelpAbout(wxCommandEvent& WXUNUSED(event))
{
    dlgAbout dlg(this);
    PlaceWindow(&dlg, pdlHead);
    dlg.ShowModal();
}

Also the header where dlgAbout is declared have to be manually included the header where it is declared.

Hope this helps in case others face the same problem

~Dr.Optix

PS: i'm not so good at giving explanations :)

EDIT:
so maybe WE can add some option to wxSmith something like child dialogs for a dialog and then based on that list the main dialog include the needed headers. Maybe this is already implemented but i didn't seen it :-