]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/frames.i
hopefully fixes focus assertion
[wxWidgets.git] / wxPython / src / frames.i
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"
18 #include <wx/minifram.h>
19 #include <wx/tipwin.h>
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
34 %pragma(python) code = "import wx"
35
36 //----------------------------------------------------------------------
37
38 enum {
39 wxFULLSCREEN_NOMENUBAR,
40 wxFULLSCREEN_NOTOOLBAR,
41 wxFULLSCREEN_NOSTATUSBAR,
42 wxFULLSCREEN_NOBORDER,
43 wxFULLSCREEN_NOCAPTION,
44 wxFULLSCREEN_ALL,
45
46 wxTOPLEVEL_EX_DIALOG,
47 };
48
49
50 //----------------------------------------------------------------------
51
52
53 class wxTopLevelWindow : public wxWindow
54 {
55 public:
56 // construction
57 wxTopLevelWindow(wxWindow *parent,
58 wxWindowID id,
59 const wxString& title,
60 const wxPoint& pos = wxDefaultPosition,
61 const wxSize& size = wxDefaultSize,
62 long style = wxDEFAULT_FRAME_STYLE,
63 const char* name = "frame");
64 %name(wxPreTopLevelWindow)wxTopLevelWindow();
65
66 bool Create(wxWindow *parent,
67 wxWindowID id,
68 const wxString& title,
69 const wxPoint& pos = wxDefaultPosition,
70 const wxSize& size = wxDefaultSize,
71 long style = wxDEFAULT_FRAME_STYLE,
72 const char* name = "frame");
73
74
75 // maximize = TRUE => maximize, otherwise - restore
76 virtual void Maximize(bool maximize = TRUE);
77
78 // undo Maximize() or Iconize()
79 virtual void Restore();
80
81 // iconize = TRUE => iconize, otherwise - restore
82 virtual void Iconize(bool iconize = TRUE);
83
84 // return TRUE if the frame is maximized
85 virtual bool IsMaximized() const;
86
87 // return TRUE if the frame is iconized
88 virtual bool IsIconized() const;
89
90 // get the frame icon
91 const wxIcon& GetIcon() const;
92
93 // set the frame icon
94 virtual void SetIcon(const wxIcon& icon);
95
96
97 // maximize the window to cover entire screen
98 virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
99
100 // return TRUE if the frame is in fullscreen mode
101 virtual bool IsFullScreen() const;
102
103 virtual void SetTitle(const wxString& title);
104 virtual wxString GetTitle() const;
105 };
106
107 //----------------------------------------------------------------------
108
109
110 class wxFrame : public wxTopLevelWindow {
111 public:
112 wxFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
113 const wxPoint& pos = wxDefaultPosition,
114 const wxSize& size = wxDefaultSize,
115 long style = wxDEFAULT_FRAME_STYLE,
116 char* name = "frame");
117 %name(wxPreFrame)wxFrame();
118
119 bool Create(wxWindow* parent, const wxWindowID id, const wxString& title,
120 const wxPoint& pos = wxDefaultPosition,
121 const wxSize& size = wxDefaultSize,
122 long style = wxDEFAULT_FRAME_STYLE,
123 char* name = "frame");
124
125 wxPoint GetClientAreaOrigin();
126
127 void SetMenuBar(wxMenuBar *menubar);
128 wxMenuBar *GetMenuBar();
129
130
131 // call this to simulate a menu command
132 bool Command(int id);
133
134 // process menu command: returns TRUE if processed
135 bool ProcessCommand(int id);
136
137 // create the main status bar
138 wxStatusBar* CreateStatusBar(int number = 1,
139 long style = wxST_SIZEGRIP,
140 wxWindowID id = -1,
141 char* name = "statusBar");
142
143 // get the main status bar
144 wxStatusBar *GetStatusBar();
145
146 // sets the main status bar
147 void SetStatusBar(wxStatusBar *statBar);
148
149 // forward these to status bar
150 virtual void SetStatusText(const wxString &text, int number = 0);
151 virtual void SetStatusWidths(int LCOUNT, int* choices); // uses typemap
152
153
154 // create main toolbar
155 virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL,
156 wxWindowID id = -1,
157 const char* name = "toolBar");
158
159 // get/set the main toolbar
160 virtual wxToolBar *GetToolBar() const { return m_frameToolBar; }
161 virtual void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
162
163 };
164
165 //---------------------------------------------------------------------------
166
167 class wxDialog : public wxTopLevelWindow {
168 public:
169 wxDialog(wxWindow* parent,
170 const wxWindowID id,
171 const wxString& title,
172 const wxPoint& pos = wxDefaultPosition,
173 const wxSize& size = wxDefaultSize,
174 long style = wxDEFAULT_DIALOG_STYLE,
175 const char* name = "dialogBox");
176 %name(wxPreDialog)wxDialog();
177
178 bool Create(wxWindow* parent,
179 const wxWindowID id,
180 const wxString& title,
181 const wxPoint& pos = wxDefaultPosition,
182 const wxSize& size = wxDefaultSize,
183 long style = wxDEFAULT_DIALOG_STYLE,
184 const char* name = "dialogBox");
185
186 void Centre(int direction = wxBOTH);
187 void EndModal(int retCode);
188 void SetModal(bool flag);
189 bool IsModal();
190 int ShowModal();
191
192 int GetReturnCode();
193 void SetReturnCode(int retCode);
194
195 wxSizer* CreateTextSizer( const wxString &message );
196 wxSizer* CreateButtonSizer( long flags );
197
198 };
199
200
201 //---------------------------------------------------------------------------
202
203 class wxMiniFrame : public wxFrame {
204 public:
205 wxMiniFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
206 const wxPoint& pos = wxDefaultPosition,
207 const wxSize& size = wxDefaultSize,
208 long style = wxDEFAULT_FRAME_STYLE,
209 char* name = "frame");
210 %name(wxPreMiniFrame)wxMiniFrame();
211
212 bool Create(wxWindow* parent, const wxWindowID id, const wxString& title,
213 const wxPoint& pos = wxDefaultPosition,
214 const wxSize& size = wxDefaultSize,
215 long style = wxDEFAULT_FRAME_STYLE,
216 char* name = "frame");
217 };
218
219
220 //---------------------------------------------------------------------------
221
222 class wxTipWindow : public wxFrame
223 {
224 public:
225 wxTipWindow(wxWindow *parent,
226 const wxString& text,
227 wxCoord maxLength = 100);
228 };
229
230
231 //---------------------------------------------------------------------------
232
233
234
235
236