Send Parameters to dialogs

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
eldonfsr
In need of some credit
In need of some credit
Posts: 8
Joined: Fri Dec 27, 2013 11:24 pm

Send Parameters to dialogs

Post by eldonfsr »

Hello every body i just start with wx, I dont know if is possible of send parameters from dialog to another or access datas of dialogs

I have to dialogs one had the grid and buttons for add new register to sqlite but i need to know when is new or edit register something like that.

GpoDatdlg* dlgdats = new GpoDatdlg(this, lnew );

or
dlgdats.lnew = true or false

Hope some body can help me with that.
User avatar
xaviou
Super wx Problem Solver
Super wx Problem Solver
Posts: 437
Joined: Mon Aug 21, 2006 3:18 pm
Location: Annecy - France
Contact:

Re: Send Parameters to dialogs

Post by xaviou »

Hi.

As the dialog class will be yours, derived from wxDialog, you can make the constructor accept any parameters you'll need.
And / Or you can create accessors to set the parameter.

Code: Select all

class GpoDatdlg : public wxDialog
{
    public:
        GpoDatdlg(wxWindow *parent, bool lnew);
        ......
};

GpoDatdlg::GpoDatdlg(wxWindow *parent, bool lnew) : wxDialog(parent, -1, _T("Dialog title"))
{
    ......
    if (lnew)
        ....
}
Regards
Xav'
My wxWidgets stuff web page : X@v's wxStuff
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Send Parameters to dialogs

Post by ONEEYEMAN »

Hi,
Also keep in mind that it is not recommended to create a wxDialog-derived class on the heap.

Thank you.
Post Reply