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
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 » Sun Jan 28, 2018 2:37 am

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 );

dlgdats.lnew = true or false

Hope some body can help me with that.

User avatar
Super wx Problem Solver
Super wx Problem Solver
Posts: 436
Joined: Mon Aug 21, 2006 3:18 pm
Location: Annecy - France

Re: Send Parameters to dialogs

Post by xaviou » Sun Jan 28, 2018 9:11 am


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
        GpoDatdlg(wxWindow *parent, bool lnew);

GpoDatdlg::GpoDatdlg(wxWindow *parent, bool lnew) : wxDialog(parent, -1, _T("Dialog title"))
    if (lnew)
My wxWidgets stuff web page : [email protected]'s wxStuff

Part Of The Furniture
Part Of The Furniture
Posts: 4820
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Send Parameters to dialogs

Post by ONEEYEMAN » Mon Jan 29, 2018 3:26 pm

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

Thank you.

Post Reply