1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: layout.h
|
|
|
|
// Purpose: Layout sample
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 04/01/98
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 06:55:54 -05:00
|
|
|
// Copyright: (c) Julian Smart
|
2002-03-17 09:16:03 -05:00
|
|
|
// Licence: wxWindows license
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// Define a new application
|
|
|
|
class MyApp: public wxApp
|
|
|
|
{
|
1999-12-11 10:07:14 -05:00
|
|
|
public:
|
2004-10-06 16:54:57 -04:00
|
|
|
MyApp(){};
|
1999-12-11 10:07:14 -05:00
|
|
|
bool OnInit();
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2003-02-27 07:02:22 -05:00
|
|
|
// the main frame class
|
|
|
|
class MyFrame : public wxFrame
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-12-11 10:07:14 -05:00
|
|
|
public:
|
2003-02-27 07:02:22 -05:00
|
|
|
MyFrame();
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2003-02-27 07:02:22 -05:00
|
|
|
void TestFlexSizers(wxCommandEvent& event);
|
1999-12-11 10:07:14 -05:00
|
|
|
void TestNotebookSizers(wxCommandEvent& event);
|
2003-11-05 20:31:44 -05:00
|
|
|
void TestGridBagSizer(wxCommandEvent& event);
|
2004-10-06 16:54:57 -04:00
|
|
|
|
2003-02-27 07:02:22 -05:00
|
|
|
void OnAbout(wxCommandEvent& event);
|
|
|
|
void OnQuit(wxCommandEvent& event);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-12-11 10:07:14 -05:00
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2003-02-27 07:02:22 -05:00
|
|
|
// a frame using flex sizers for layout
|
|
|
|
class MyFlexSizerFrame : public wxFrame
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-12-11 10:07:14 -05:00
|
|
|
public:
|
2003-02-27 07:02:22 -05:00
|
|
|
MyFlexSizerFrame(const wxChar *title, int x, int y );
|
1999-12-11 10:07:14 -05:00
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
private:
|
2005-01-18 16:21:57 -05:00
|
|
|
void InitFlexSizer(wxFlexGridSizer *sizer, wxWindow* parent);
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2003-11-05 20:31:44 -05:00
|
|
|
|
2003-02-27 07:02:22 -05:00
|
|
|
// a dialog using notebook sizer for layout
|
|
|
|
class MySizerDialog : public wxDialog
|
1999-08-08 12:45:57 -04:00
|
|
|
{
|
1999-12-11 10:07:14 -05:00
|
|
|
public:
|
2003-02-27 07:02:22 -05:00
|
|
|
MySizerDialog(wxWindow *parent, const wxChar *title);
|
|
|
|
};
|
|
|
|
|
2003-11-05 20:31:44 -05:00
|
|
|
|
|
|
|
// a frame using wxGridBagSizer for layout
|
|
|
|
class MyGridBagSizerFrame : public wxFrame
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MyGridBagSizerFrame(const wxChar *title, int x, int y );
|
|
|
|
|
|
|
|
void OnHideBtn(wxCommandEvent&);
|
|
|
|
void OnShowBtn(wxCommandEvent&);
|
|
|
|
void OnMoveBtn(wxCommandEvent&);
|
2004-10-06 16:54:57 -04:00
|
|
|
|
2003-11-05 20:31:44 -05:00
|
|
|
private:
|
|
|
|
wxGridBagSizer* m_gbs;
|
|
|
|
wxPanel* m_panel;
|
|
|
|
wxButton* m_hideBtn;
|
|
|
|
wxButton* m_showBtn;
|
|
|
|
wxTextCtrl* m_hideTxt;
|
|
|
|
|
|
|
|
wxButton* m_moveBtn1;
|
|
|
|
wxButton* m_moveBtn2;
|
|
|
|
wxGBPosition m_lastPos;
|
2004-10-06 16:54:57 -04:00
|
|
|
|
2003-11-05 20:31:44 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// controls and menu constants
|
2003-02-27 07:02:22 -05:00
|
|
|
enum
|
|
|
|
{
|
2005-06-02 08:04:48 -04:00
|
|
|
LAYOUT_QUIT = wxID_EXIT,
|
|
|
|
LAYOUT_ABOUT = wxID_ABOUT,
|
|
|
|
LAYOUT_TEST_SIZER = 101,
|
|
|
|
LAYOUT_TEST_NB_SIZER = 102,
|
|
|
|
LAYOUT_TEST_GB_SIZE = 103
|
1999-08-08 12:45:57 -04:00
|
|
|
};
|
|
|
|
|