X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9230b62136ee786760375bf59292dabff6277aeb..db71eb0640221199170ac9ea83371c2d467fa456:/samples/layout/layout.h diff --git a/samples/layout/layout.h b/samples/layout/layout.h index 1a4923d4e9..965bcfc5ad 100644 --- a/samples/layout/layout.h +++ b/samples/layout/layout.h @@ -13,7 +13,7 @@ class MyApp: public wxApp { public: - MyApp(); + MyApp(){}; bool OnInit(); }; @@ -23,10 +23,12 @@ class MyFrame : public wxFrame public: MyFrame(); + void TestProportions(wxCommandEvent& event); void TestFlexSizers(wxCommandEvent& event); void TestNotebookSizers(wxCommandEvent& event); void TestGridBagSizer(wxCommandEvent& event); - + void TestSetMinimal(wxCommandEvent& event); + void OnAbout(wxCommandEvent& event); void OnQuit(wxCommandEvent& event); @@ -34,6 +36,22 @@ private: DECLARE_EVENT_TABLE() }; +// a frame showing the box sizer proportions +class MyProportionsFrame : public wxFrame +{ +public: + MyProportionsFrame(wxFrame *parent); + +protected: + void UpdateProportions(); + + void OnProportionChanged(wxSpinEvent& event); + void OnProportionUpdated(wxCommandEvent& event); + + wxSpinCtrl *m_spins[3]; // size can be changed without changing anything else + wxSizer *m_sizer; +}; + // a frame using flex sizers for layout class MyFlexSizerFrame : public wxFrame { @@ -41,7 +59,7 @@ public: MyFlexSizerFrame(const wxChar *title, int x, int y ); private: - void InitFlexSizer(wxFlexGridSizer *sizer); + void InitFlexSizer(wxFlexGridSizer *sizer, wxWindow* parent); }; @@ -62,7 +80,7 @@ public: void OnHideBtn(wxCommandEvent&); void OnShowBtn(wxCommandEvent&); void OnMoveBtn(wxCommandEvent&); - + private: wxGridBagSizer* m_gbs; wxPanel* m_panel; @@ -73,21 +91,36 @@ private: wxButton* m_moveBtn1; wxButton* m_moveBtn2; wxGBPosition m_lastPos; - + DECLARE_EVENT_TABLE() }; +// a frame for testing simple setting of "default size" +class MySimpleSizerFrame : public wxFrame +{ +public: + MySimpleSizerFrame(const wxChar *title, int x, int y ); + + void OnSetSmallSize( wxCommandEvent &event); + void OnSetBigSize( wxCommandEvent &event); + +private: + wxTextCtrl *m_target; + DECLARE_EVENT_TABLE() +}; // controls and menu constants enum { - LAYOUT_QUIT = 100, - LAYOUT_ABOUT, - LAYOUT_TEST_SIZER, + LAYOUT_TEST_SIZER = 101, LAYOUT_TEST_NB_SIZER, - LAYOUT_TEST_GB_SIZER + LAYOUT_TEST_GB_SIZER, + LAYOUT_TEST_PROPORTIONS, + LAYOUT_TEST_SET_MINIMAL, + LAYOUT_QUIT = wxID_EXIT, + LAYOUT_ABOUT = wxID_ABOUT };