]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/frames.i
Added SplitTree sample to the demo
[wxWidgets.git] / wxPython / src / frames.i
CommitLineData
9c039d08
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: frames.i
3// Purpose: SWIG definitions of various window classes
4//
5// Author: Robin Dunn
6//
7// Created: 8/27/98
8// RCS-ID: $Id$
9// Copyright: (c) 1998 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13
14%module frames
15
16%{
17#include "helpers.h"
9c039d08 18#include <wx/minifram.h>
9c039d08
RD
19%}
20
21//----------------------------------------------------------------------
22
23%include typemaps.i
24%include my_typemaps.i
25
26// Import some definitions of other classes, etc.
27%import _defs.i
28%import misc.i
29%import gdi.i
30%import windows.i
31%import stattool.i
32
b8b8dda7 33%pragma(python) code = "import wx"
9c039d08
RD
34
35//----------------------------------------------------------------------
36
f6bcfd97
BP
37enum {
38 wxFULLSCREEN_NOMENUBAR,
39 wxFULLSCREEN_NOTOOLBAR,
40 wxFULLSCREEN_NOSTATUSBAR,
41 wxFULLSCREEN_NOBORDER,
42 wxFULLSCREEN_NOCAPTION,
ecc08ead
RD
43 wxFULLSCREEN_ALL,
44
45 wxTOPLEVEL_EX_DIALOG,
f6bcfd97
BP
46};
47
48
ecc08ead
RD
49//----------------------------------------------------------------------
50
51
52class wxTopLevelWindow : public wxWindow
53{
54public:
55 // construction
56 wxTopLevelWindow(wxWindow *parent,
57 wxWindowID id,
58 const wxString& title,
59 const wxPoint& pos = wxDefaultPosition,
60 const wxSize& size = wxDefaultSize,
61 long style = wxDEFAULT_FRAME_STYLE,
62 const char* name = "frame");
63 %name(wxPreTopLevelWindow)wxTopLevelWindow();
64
65 bool Create(wxWindow *parent,
66 wxWindowID id,
67 const wxString& title,
68 const wxPoint& pos = wxDefaultPosition,
69 const wxSize& size = wxDefaultSize,
70 long style = wxDEFAULT_FRAME_STYLE,
71 const char* name = "frame");
72
0122b7e3 73 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 74 %pragma(python) addtomethod = "wxPreTopLevelWindow:val._setOORInfo(val)"
ecc08ead
RD
75
76 // maximize = TRUE => maximize, otherwise - restore
77 virtual void Maximize(bool maximize = TRUE);
78
79 // undo Maximize() or Iconize()
80 virtual void Restore();
81
82 // iconize = TRUE => iconize, otherwise - restore
83 virtual void Iconize(bool iconize = TRUE);
84
85 // return TRUE if the frame is maximized
86 virtual bool IsMaximized() const;
87
88 // return TRUE if the frame is iconized
89 virtual bool IsIconized() const;
90
91 // get the frame icon
c5943253 92 wxIcon GetIcon() const;
ecc08ead
RD
93
94 // set the frame icon
95 virtual void SetIcon(const wxIcon& icon);
96
97
98 // maximize the window to cover entire screen
99 virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
100
101 // return TRUE if the frame is in fullscreen mode
102 virtual bool IsFullScreen() const;
103
104 virtual void SetTitle(const wxString& title);
105 virtual wxString GetTitle() const;
106};
107
108//----------------------------------------------------------------------
109
110
111class wxFrame : public wxTopLevelWindow {
9c039d08
RD
112public:
113 wxFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
b68dc582
RD
114 const wxPoint& pos = wxDefaultPosition,
115 const wxSize& size = wxDefaultSize,
9c039d08
RD
116 long style = wxDEFAULT_FRAME_STYLE,
117 char* name = "frame");
09f3d4e6 118 %name(wxPreFrame)wxFrame();
9c039d08 119
09f3d4e6
RD
120 bool Create(wxWindow* parent, const wxWindowID id, const wxString& title,
121 const wxPoint& pos = wxDefaultPosition,
122 const wxSize& size = wxDefaultSize,
123 long style = wxDEFAULT_FRAME_STYLE,
124 char* name = "frame");
9c039d08 125
0122b7e3 126 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 127 %pragma(python) addtomethod = "wxPreFrame:val._setOORInfo(val)"
0122b7e3 128
ecc08ead
RD
129 wxPoint GetClientAreaOrigin();
130
131 void SetMenuBar(wxMenuBar *menubar);
132 wxMenuBar *GetMenuBar();
133
134
135 // call this to simulate a menu command
136 bool Command(int id);
137
138 // process menu command: returns TRUE if processed
139 bool ProcessCommand(int id);
140
141 // create the main status bar
9c039d08
RD
142 wxStatusBar* CreateStatusBar(int number = 1,
143 long style = wxST_SIZEGRIP,
144 wxWindowID id = -1,
145 char* name = "statusBar");
ecc08ead
RD
146
147 // get the main status bar
148 wxStatusBar *GetStatusBar();
149
150 // sets the main status bar
151 void SetStatusBar(wxStatusBar *statBar);
152
153 // forward these to status bar
154 virtual void SetStatusText(const wxString &text, int number = 0);
155 virtual void SetStatusWidths(int LCOUNT, int* choices); // uses typemap
156
157
158 // create main toolbar
159 virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL,
160 wxWindowID id = -1,
161 const char* name = "toolBar");
162
163 // get/set the main toolbar
164 virtual wxToolBar *GetToolBar() const { return m_frameToolBar; }
165 virtual void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
166
9c039d08
RD
167};
168
ecc08ead
RD
169//---------------------------------------------------------------------------
170
171class wxDialog : public wxTopLevelWindow {
172public:
173 wxDialog(wxWindow* parent,
174 const wxWindowID id,
175 const wxString& title,
176 const wxPoint& pos = wxDefaultPosition,
177 const wxSize& size = wxDefaultSize,
178 long style = wxDEFAULT_DIALOG_STYLE,
179 const char* name = "dialogBox");
180 %name(wxPreDialog)wxDialog();
181
182 bool Create(wxWindow* parent,
183 const wxWindowID id,
184 const wxString& title,
185 const wxPoint& pos = wxDefaultPosition,
186 const wxSize& size = wxDefaultSize,
187 long style = wxDEFAULT_DIALOG_STYLE,
188 const char* name = "dialogBox");
189
0122b7e3 190 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 191 %pragma(python) addtomethod = "wxPreDialog:val._setOORInfo(val)"
0122b7e3 192
ecc08ead
RD
193 void Centre(int direction = wxBOTH);
194 void EndModal(int retCode);
195 void SetModal(bool flag);
196 bool IsModal();
197 int ShowModal();
198
199 int GetReturnCode();
200 void SetReturnCode(int retCode);
201
202 wxSizer* CreateTextSizer( const wxString &message );
203 wxSizer* CreateButtonSizer( long flags );
204
205};
206
207
9c039d08
RD
208//---------------------------------------------------------------------------
209
9c039d08
RD
210class wxMiniFrame : public wxFrame {
211public:
212 wxMiniFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
b68dc582
RD
213 const wxPoint& pos = wxDefaultPosition,
214 const wxSize& size = wxDefaultSize,
9c039d08
RD
215 long style = wxDEFAULT_FRAME_STYLE,
216 char* name = "frame");
09f3d4e6 217 %name(wxPreMiniFrame)wxMiniFrame();
9c039d08 218
09f3d4e6
RD
219 bool Create(wxWindow* parent, const wxWindowID id, const wxString& title,
220 const wxPoint& pos = wxDefaultPosition,
221 const wxSize& size = wxDefaultSize,
222 long style = wxDEFAULT_FRAME_STYLE,
223 char* name = "frame");
0122b7e3
RD
224
225 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 226 %pragma(python) addtomethod = "wxPreMiniFrame:val._setOORInfo(val)"
9c039d08 227};
b8b8dda7
RD
228
229
230//---------------------------------------------------------------------------
b8b8dda7 231
4f3449b4 232
b8b8dda7
RD
233
234
235
9c039d08 236