Don't create multiple parent-less top level frames in layout sample.

This resulted in unexpected behaviour if the main frame was closed while the
other ones were still shown as they remained shown and had to be hunted and
closed one by one to make the application exit.

Fix this simply by creating all the other frames as children of the main one.
This also results in better UI when minimizing and restoring the main frame.

Also get rid of unused position parameters in child frame constructors and get
rid of the title parameter which is not really needed as it's always the same
too.

See #11923.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74070 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-05-31 23:21:21 +00:00
parent 1054bcb21f
commit 438959cca8
2 changed files with 21 additions and 26 deletions

View File

@@ -58,7 +58,7 @@ protected:
class MyFlexSizerFrame : public wxFrame
{
public:
MyFlexSizerFrame(const wxString &title, int x, int y );
MyFlexSizerFrame(wxFrame* parent);
private:
void InitFlexSizer(wxFlexGridSizer *sizer, wxWindow* parent);
@@ -77,7 +77,7 @@ public:
class MyGridBagSizerFrame : public wxFrame
{
public:
MyGridBagSizerFrame(const wxString &title, int x, int y );
MyGridBagSizerFrame(wxFrame* parent);
void OnHideBtn(wxCommandEvent&);
void OnShowBtn(wxCommandEvent&);
@@ -102,7 +102,7 @@ private:
class MySimpleSizerFrame : public wxFrame
{
public:
MySimpleSizerFrame(const wxString &title, int x, int y );
MySimpleSizerFrame(wxFrame* parent);
void OnSetSmallSize( wxCommandEvent &event);
void OnSetBigSize( wxCommandEvent &event);
@@ -120,7 +120,7 @@ private:
class MyNestedSizerFrame : public wxFrame
{
public:
MyNestedSizerFrame(const wxString &title, int x, int y );
MyNestedSizerFrame(wxFrame* parent);
private:
@@ -132,7 +132,7 @@ private:
class MyWrapSizerFrame: public wxFrame
{
public:
MyWrapSizerFrame(const wxString &title, int x, int y );
MyWrapSizerFrame(wxFrame* parent);
private:
void OnAddCheckbox(wxCommandEvent& event);