]>
git.saurik.com Git - wxWidgets.git/blob - samples/layout/layout.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Layout sample
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // Define a new application
13 class MyApp
: public wxApp
24 class MyFrame
: public wxFrame
28 MyTextWindow
*text_window
;
30 MyFrame(wxFrame
*frame
, char *title
, int x
, int y
, int w
, int h
);
31 void OnSize(wxSizeEvent
& event
);
32 void Draw(wxDC
& dc
, bool draw_bitmaps
= TRUE
);
34 void LoadFile(wxCommandEvent
& event
);
35 void Quit(wxCommandEvent
& event
);
36 void TestSizers(wxCommandEvent
& event
);
37 void TestNewSizers(wxCommandEvent
& event
);
38 void About(wxCommandEvent
& event
);
43 // Define a new text subwindow that can respond to drag-and-drop
44 class MyTextWindow
: public wxTextCtrl
47 MyTextWindow(wxFrame
*frame
, int x
=-1, int y
=-1, int width
=-1, int height
=-1,
48 long style
=wxTE_MULTILINE
):
49 wxTextCtrl(frame
, -1, "", wxPoint(x
, y
), wxSize(width
, height
), style
)
54 // Define a new canvas which can receive some events
55 class MyWindow
: public wxWindow
58 MyWindow(wxFrame
*frame
, int x
, int y
, int w
, int h
, long style
= wxRETAINED
);
60 void OnPaint(wxPaintEvent
& event
);
65 class SizerFrame
: public wxFrame
69 SizerFrame(wxFrame
*frame
, char *title
, int x
, int y
, int w
, int h
);
70 void OnSize(wxSizeEvent
& event
);
75 class NewSizerFrame
: public wxFrame
80 NewSizerFrame(wxFrame
*frame
, char *title
, int x
, int y
);
81 void OnSize(wxSizeEvent
& event
);
86 #define LAYOUT_QUIT 100
87 #define LAYOUT_TEST 101
88 #define LAYOUT_ABOUT 102
89 #define LAYOUT_LOAD_FILE 103
90 #define LAYOUT_TEST_NEW 104