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:
|
|
|
|
MyApp();
|
|
|
|
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 TestConstraints(wxCommandEvent& event);
|
|
|
|
void TestFlexSizers(wxCommandEvent& event);
|
1999-12-11 10:07:14 -05:00
|
|
|
void TestNotebookSizers(wxCommandEvent& event);
|
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 constraints for layout
|
|
|
|
class MyConstraintsFrame : 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
|
|
|
MyConstraintsFrame(const wxChar *title, int x, int y );
|
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:
|
2003-02-27 07:02:22 -05:00
|
|
|
void InitFlexSizer(wxFlexGridSizer *sizer);
|
1998-05-20 10:01:55 -04: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);
|
|
|
|
};
|
|
|
|
|
|
|
|
// controls an menu constants
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
LAYOUT_QUIT = 100,
|
|
|
|
LAYOUT_ABOUT,
|
|
|
|
LAYOUT_TEST_CONSTRAINTS,
|
|
|
|
LAYOUT_TEST_SIZER,
|
|
|
|
LAYOUT_TEST_NB_SIZER
|
1999-08-08 12:45:57 -04:00
|
|
|
};
|
|
|
|
|