1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: layout.h
|
|
|
|
// Purpose: Layout sample
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 04/01/98
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 11:55:54 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2002-03-17 14:16:03 +00:00
|
|
|
// Licence: wxWindows license
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// Define a new application
|
|
|
|
class MyApp: public wxApp
|
|
|
|
{
|
1999-12-11 15:07:14 +00:00
|
|
|
public:
|
2004-10-06 20:54:57 +00:00
|
|
|
MyApp(){};
|
1999-12-11 15:07:14 +00:00
|
|
|
bool OnInit();
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2003-02-27 12:02:22 +00:00
|
|
|
// the main frame class
|
|
|
|
class MyFrame : public wxFrame
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-12-11 15:07:14 +00:00
|
|
|
public:
|
2003-02-27 12:02:22 +00:00
|
|
|
MyFrame();
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2003-02-27 12:02:22 +00:00
|
|
|
void TestFlexSizers(wxCommandEvent& event);
|
1999-12-11 15:07:14 +00:00
|
|
|
void TestNotebookSizers(wxCommandEvent& event);
|
2003-11-06 01:31:44 +00:00
|
|
|
void TestGridBagSizer(wxCommandEvent& event);
|
2004-10-06 20:54:57 +00:00
|
|
|
|
2003-02-27 12:02:22 +00:00
|
|
|
void OnAbout(wxCommandEvent& event);
|
|
|
|
void OnQuit(wxCommandEvent& event);
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-12-11 15:07:14 +00:00
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2003-02-27 12:02:22 +00:00
|
|
|
// a frame using flex sizers for layout
|
|
|
|
class MyFlexSizerFrame : public wxFrame
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-12-11 15:07:14 +00:00
|
|
|
public:
|
2003-02-27 12:02:22 +00:00
|
|
|
MyFlexSizerFrame(const wxChar *title, int x, int y );
|
1999-12-11 15:07:14 +00:00
|
|
|
|
2002-12-04 14:11:26 +00:00
|
|
|
private:
|
2005-01-18 21:21:57 +00:00
|
|
|
void InitFlexSizer(wxFlexGridSizer *sizer, wxWindow* parent);
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2003-11-06 01:31:44 +00:00
|
|
|
|
2003-02-27 12:02:22 +00:00
|
|
|
// a dialog using notebook sizer for layout
|
|
|
|
class MySizerDialog : public wxDialog
|
1999-08-08 16:45:57 +00:00
|
|
|
{
|
1999-12-11 15:07:14 +00:00
|
|
|
public:
|
2003-02-27 12:02:22 +00:00
|
|
|
MySizerDialog(wxWindow *parent, const wxChar *title);
|
|
|
|
};
|
|
|
|
|
2003-11-06 01:31:44 +00: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 20:54:57 +00:00
|
|
|
|
2003-11-06 01:31:44 +00: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 20:54:57 +00:00
|
|
|
|
2003-11-06 01:31:44 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// controls and menu constants
|
2003-02-27 12:02:22 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
LAYOUT_QUIT = 100,
|
|
|
|
LAYOUT_ABOUT,
|
|
|
|
LAYOUT_TEST_SIZER,
|
2003-11-06 01:31:44 +00:00
|
|
|
LAYOUT_TEST_NB_SIZER,
|
|
|
|
LAYOUT_TEST_GB_SIZER
|
1999-08-08 16:45:57 +00:00
|
|
|
};
|
|
|
|
|