]>
Commit | Line | Data |
---|---|---|
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> |
b5a5d647 | 19 | #include <wx/splash.h> |
9c039d08 RD |
20 | %} |
21 | ||
22 | //---------------------------------------------------------------------- | |
23 | ||
24 | %include typemaps.i | |
25 | %include my_typemaps.i | |
26 | ||
27 | // Import some definitions of other classes, etc. | |
28 | %import _defs.i | |
29 | %import misc.i | |
30 | %import gdi.i | |
31 | %import windows.i | |
32 | %import stattool.i | |
33 | ||
b8b8dda7 | 34 | %pragma(python) code = "import wx" |
9c039d08 RD |
35 | |
36 | //---------------------------------------------------------------------- | |
37 | ||
137b5242 RD |
38 | %{ |
39 | // Put some wx default wxChar* values into wxStrings. | |
40 | DECLARE_DEF_STRING(FrameNameStr); | |
41 | DECLARE_DEF_STRING(DialogNameStr); | |
42 | DECLARE_DEF_STRING(StatusLineNameStr); | |
43 | DECLARE_DEF_STRING(ToolBarNameStr); | |
44 | %} | |
45 | ||
46 | //---------------------------------------------------------------------- | |
47 | ||
f6bcfd97 BP |
48 | enum { |
49 | wxFULLSCREEN_NOMENUBAR, | |
50 | wxFULLSCREEN_NOTOOLBAR, | |
51 | wxFULLSCREEN_NOSTATUSBAR, | |
52 | wxFULLSCREEN_NOBORDER, | |
53 | wxFULLSCREEN_NOCAPTION, | |
ecc08ead RD |
54 | wxFULLSCREEN_ALL, |
55 | ||
56 | wxTOPLEVEL_EX_DIALOG, | |
f6bcfd97 BP |
57 | }; |
58 | ||
59 | ||
ecc08ead RD |
60 | //---------------------------------------------------------------------- |
61 | ||
62 | ||
63 | class wxTopLevelWindow : public wxWindow | |
64 | { | |
65 | public: | |
66 | // construction | |
67 | wxTopLevelWindow(wxWindow *parent, | |
68 | wxWindowID id, | |
69 | const wxString& title, | |
70 | const wxPoint& pos = wxDefaultPosition, | |
71 | const wxSize& size = wxDefaultSize, | |
72 | long style = wxDEFAULT_FRAME_STYLE, | |
137b5242 | 73 | const wxString& name = wxPyFrameNameStr); |
ecc08ead RD |
74 | %name(wxPreTopLevelWindow)wxTopLevelWindow(); |
75 | ||
76 | bool Create(wxWindow *parent, | |
77 | wxWindowID id, | |
78 | const wxString& title, | |
79 | const wxPoint& pos = wxDefaultPosition, | |
80 | const wxSize& size = wxDefaultSize, | |
81 | long style = wxDEFAULT_FRAME_STYLE, | |
137b5242 | 82 | const wxString& name = wxPyFrameNameStr); |
ecc08ead | 83 | |
0122b7e3 | 84 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
17c0e08c | 85 | %pragma(python) addtomethod = "wxPreTopLevelWindow:val._setOORInfo(val)" |
ecc08ead RD |
86 | |
87 | // maximize = TRUE => maximize, otherwise - restore | |
88 | virtual void Maximize(bool maximize = TRUE); | |
89 | ||
90 | // undo Maximize() or Iconize() | |
91 | virtual void Restore(); | |
92 | ||
93 | // iconize = TRUE => iconize, otherwise - restore | |
94 | virtual void Iconize(bool iconize = TRUE); | |
95 | ||
96 | // return TRUE if the frame is maximized | |
97 | virtual bool IsMaximized() const; | |
98 | ||
99 | // return TRUE if the frame is iconized | |
100 | virtual bool IsIconized() const; | |
101 | ||
102 | // get the frame icon | |
c5943253 | 103 | wxIcon GetIcon() const; |
ecc08ead RD |
104 | |
105 | // set the frame icon | |
106 | virtual void SetIcon(const wxIcon& icon); | |
107 | ||
0e9b78ce RD |
108 | // set the frame icons |
109 | virtual void SetIcons(const wxIconBundle& icons ); | |
ecc08ead RD |
110 | |
111 | // maximize the window to cover entire screen | |
112 | virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); | |
113 | ||
114 | // return TRUE if the frame is in fullscreen mode | |
115 | virtual bool IsFullScreen() const; | |
116 | ||
117 | virtual void SetTitle(const wxString& title); | |
118 | virtual wxString GetTitle() const; | |
119 | }; | |
120 | ||
121 | //---------------------------------------------------------------------- | |
122 | ||
123 | ||
124 | class wxFrame : public wxTopLevelWindow { | |
9c039d08 RD |
125 | public: |
126 | wxFrame(wxWindow* parent, const wxWindowID id, const wxString& title, | |
b68dc582 RD |
127 | const wxPoint& pos = wxDefaultPosition, |
128 | const wxSize& size = wxDefaultSize, | |
9c039d08 | 129 | long style = wxDEFAULT_FRAME_STYLE, |
137b5242 | 130 | const wxString& name = wxPyFrameNameStr); |
09f3d4e6 | 131 | %name(wxPreFrame)wxFrame(); |
9c039d08 | 132 | |
09f3d4e6 RD |
133 | bool Create(wxWindow* parent, const wxWindowID id, const wxString& title, |
134 | const wxPoint& pos = wxDefaultPosition, | |
135 | const wxSize& size = wxDefaultSize, | |
136 | long style = wxDEFAULT_FRAME_STYLE, | |
137b5242 | 137 | const wxString& name = wxPyFrameNameStr); |
9c039d08 | 138 | |
0122b7e3 | 139 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
17c0e08c | 140 | %pragma(python) addtomethod = "wxPreFrame:val._setOORInfo(val)" |
0122b7e3 | 141 | |
ecc08ead RD |
142 | wxPoint GetClientAreaOrigin(); |
143 | ||
144 | void SetMenuBar(wxMenuBar *menubar); | |
145 | wxMenuBar *GetMenuBar(); | |
146 | ||
147 | ||
148 | // call this to simulate a menu command | |
149 | bool Command(int id); | |
150 | ||
151 | // process menu command: returns TRUE if processed | |
152 | bool ProcessCommand(int id); | |
153 | ||
154 | // create the main status bar | |
9c039d08 RD |
155 | wxStatusBar* CreateStatusBar(int number = 1, |
156 | long style = wxST_SIZEGRIP, | |
157 | wxWindowID id = -1, | |
137b5242 | 158 | const wxString& name = wxPyStatusLineNameStr); |
ecc08ead RD |
159 | |
160 | // get the main status bar | |
161 | wxStatusBar *GetStatusBar(); | |
162 | ||
163 | // sets the main status bar | |
164 | void SetStatusBar(wxStatusBar *statBar); | |
165 | ||
166 | // forward these to status bar | |
167 | virtual void SetStatusText(const wxString &text, int number = 0); | |
168 | virtual void SetStatusWidths(int LCOUNT, int* choices); // uses typemap | |
94e36a51 RD |
169 | void PushStatusText(const wxString &text, int number = 0); |
170 | void PopStatusText(int number = 0); | |
171 | ||
172 | // show help text (typically in the statusbar); show is FALSE | |
173 | // if you are hiding the help, TRUE otherwise | |
174 | virtual void DoGiveHelp(const wxString& text, bool show); | |
175 | ||
176 | // set the status bar pane the help will be shown in | |
177 | void SetStatusBarPane(int n); | |
178 | int GetStatusBarPane() const; | |
ecc08ead RD |
179 | |
180 | ||
181 | // create main toolbar | |
182 | virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL, | |
183 | wxWindowID id = -1, | |
137b5242 | 184 | const wxString& name = wxPyToolBarNameStr); |
ecc08ead RD |
185 | |
186 | // get/set the main toolbar | |
187 | virtual wxToolBar *GetToolBar() const { return m_frameToolBar; } | |
188 | virtual void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; } | |
189 | ||
f725aedb RD |
190 | // sends a size event to the window using its current size -- this has an |
191 | // effect of refreshing the window layout | |
192 | virtual void SendSizeEvent(); | |
9c039d08 RD |
193 | }; |
194 | ||
ecc08ead RD |
195 | //--------------------------------------------------------------------------- |
196 | ||
197 | class wxDialog : public wxTopLevelWindow { | |
198 | public: | |
199 | wxDialog(wxWindow* parent, | |
200 | const wxWindowID id, | |
201 | const wxString& title, | |
202 | const wxPoint& pos = wxDefaultPosition, | |
203 | const wxSize& size = wxDefaultSize, | |
204 | long style = wxDEFAULT_DIALOG_STYLE, | |
137b5242 | 205 | const wxString& name = wxPyDialogNameStr); |
ecc08ead RD |
206 | %name(wxPreDialog)wxDialog(); |
207 | ||
208 | bool Create(wxWindow* parent, | |
209 | const wxWindowID id, | |
210 | const wxString& title, | |
211 | const wxPoint& pos = wxDefaultPosition, | |
212 | const wxSize& size = wxDefaultSize, | |
213 | long style = wxDEFAULT_DIALOG_STYLE, | |
137b5242 | 214 | const wxString& name = wxPyDialogNameStr); |
ecc08ead | 215 | |
0122b7e3 | 216 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
17c0e08c | 217 | %pragma(python) addtomethod = "wxPreDialog:val._setOORInfo(val)" |
0122b7e3 | 218 | |
ecc08ead RD |
219 | void Centre(int direction = wxBOTH); |
220 | void EndModal(int retCode); | |
221 | void SetModal(bool flag); | |
222 | bool IsModal(); | |
223 | int ShowModal(); | |
224 | ||
225 | int GetReturnCode(); | |
226 | void SetReturnCode(int retCode); | |
227 | ||
228 | wxSizer* CreateTextSizer( const wxString &message ); | |
229 | wxSizer* CreateButtonSizer( long flags ); | |
230 | ||
231 | }; | |
232 | ||
233 | ||
9c039d08 RD |
234 | //--------------------------------------------------------------------------- |
235 | ||
9c039d08 RD |
236 | class wxMiniFrame : public wxFrame { |
237 | public: | |
238 | wxMiniFrame(wxWindow* parent, const wxWindowID id, const wxString& title, | |
b68dc582 RD |
239 | const wxPoint& pos = wxDefaultPosition, |
240 | const wxSize& size = wxDefaultSize, | |
9c039d08 | 241 | long style = wxDEFAULT_FRAME_STYLE, |
137b5242 | 242 | const wxString& name = wxPyFrameNameStr); |
09f3d4e6 | 243 | %name(wxPreMiniFrame)wxMiniFrame(); |
9c039d08 | 244 | |
09f3d4e6 RD |
245 | bool Create(wxWindow* parent, const wxWindowID id, const wxString& title, |
246 | const wxPoint& pos = wxDefaultPosition, | |
247 | const wxSize& size = wxDefaultSize, | |
248 | long style = wxDEFAULT_FRAME_STYLE, | |
137b5242 | 249 | const wxString& name = wxPyFrameNameStr); |
0122b7e3 RD |
250 | |
251 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" | |
17c0e08c | 252 | %pragma(python) addtomethod = "wxPreMiniFrame:val._setOORInfo(val)" |
9c039d08 | 253 | }; |
b8b8dda7 RD |
254 | |
255 | ||
256 | //--------------------------------------------------------------------------- | |
b8b8dda7 | 257 | |
b5a5d647 RD |
258 | enum { |
259 | wxSPLASH_CENTRE_ON_PARENT, | |
260 | wxSPLASH_CENTRE_ON_SCREEN, | |
261 | wxSPLASH_NO_CENTRE, | |
262 | wxSPLASH_TIMEOUT, | |
263 | wxSPLASH_NO_TIMEOUT, | |
264 | }; | |
265 | ||
266 | ||
267 | class wxSplashScreenWindow: public wxWindow | |
268 | { | |
269 | public: | |
270 | wxSplashScreenWindow(const wxBitmap& bitmap, | |
271 | wxWindow* parent, wxWindowID id, | |
272 | const wxPoint& pos = wxDefaultPosition, | |
273 | const wxSize& size = wxDefaultSize, | |
274 | long style = wxNO_BORDER); | |
275 | ||
aacd7bb6 RD |
276 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
277 | ||
b5a5d647 RD |
278 | void SetBitmap(const wxBitmap& bitmap); |
279 | wxBitmap& GetBitmap(); | |
280 | }; | |
281 | ||
282 | ||
283 | class wxSplashScreen : public wxFrame { | |
284 | public: | |
285 | wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds, | |
286 | wxWindow* parent, wxWindowID id, | |
287 | const wxPoint& pos = wxDefaultPosition, | |
288 | const wxSize& size = wxDefaultSize, | |
479101ca | 289 | long style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP); |
b5a5d647 | 290 | |
aacd7bb6 RD |
291 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
292 | ||
b5a5d647 RD |
293 | long GetSplashStyle() const; |
294 | wxSplashScreenWindow* GetSplashWindow() const; | |
295 | int GetTimeout() const; | |
296 | }; | |
297 | ||
298 | ||
299 | //--------------------------------------------------------------------------- | |
300 | ||
4f3449b4 | 301 | |
b8b8dda7 RD |
302 | |
303 | ||
304 | ||
9c039d08 | 305 |