1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions of various window classes
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
18 #include <wx/minifram.h>
19 #include <wx/splash.h>
22 //----------------------------------------------------------------------
25 %include my_typemaps.i
27 // Import some definitions of other classes, etc.
34 %pragma(python) code = "import wx"
36 //----------------------------------------------------------------------
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);
46 //----------------------------------------------------------------------
49 wxFULLSCREEN_NOMENUBAR,
50 wxFULLSCREEN_NOTOOLBAR,
51 wxFULLSCREEN_NOSTATUSBAR,
52 wxFULLSCREEN_NOBORDER,
53 wxFULLSCREEN_NOCAPTION,
60 //----------------------------------------------------------------------
63 class wxTopLevelWindow : public wxWindow
67 wxTopLevelWindow(wxWindow *parent,
69 const wxString& title,
70 const wxPoint& pos = wxDefaultPosition,
71 const wxSize& size = wxDefaultSize,
72 long style = wxDEFAULT_FRAME_STYLE,
73 const wxString& name = wxPyFrameNameStr);
74 %name(wxPreTopLevelWindow)wxTopLevelWindow();
76 bool Create(wxWindow *parent,
78 const wxString& title,
79 const wxPoint& pos = wxDefaultPosition,
80 const wxSize& size = wxDefaultSize,
81 long style = wxDEFAULT_FRAME_STYLE,
82 const wxString& name = wxPyFrameNameStr);
84 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
85 %pragma(python) addtomethod = "wxPreTopLevelWindow:val._setOORInfo(val)"
87 // maximize = TRUE => maximize, otherwise - restore
88 virtual void Maximize(bool maximize = TRUE);
90 // undo Maximize() or Iconize()
91 virtual void Restore();
93 // iconize = TRUE => iconize, otherwise - restore
94 virtual void Iconize(bool iconize = TRUE);
96 // return TRUE if the frame is maximized
97 virtual bool IsMaximized() const;
99 // return TRUE if the frame is iconized
100 virtual bool IsIconized() const;
102 // get the frame icon
103 wxIcon GetIcon() const;
105 // set the frame icon
106 virtual void SetIcon(const wxIcon& icon);
108 // set the frame icons
109 virtual void SetIcons(const wxIconBundle& icons );
111 // maximize the window to cover entire screen
112 virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
114 // return TRUE if the frame is in fullscreen mode
115 virtual bool IsFullScreen() const;
117 virtual void SetTitle(const wxString& title);
118 virtual wxString GetTitle() const;
120 // Set the shape of the window to the given region.
121 // Returns TRUE if the platform supports this feature (and the operation
123 virtual bool SetShape(const wxRegion& region);
127 //----------------------------------------------------------------------
130 class wxFrame : public wxTopLevelWindow {
132 wxFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
133 const wxPoint& pos = wxDefaultPosition,
134 const wxSize& size = wxDefaultSize,
135 long style = wxDEFAULT_FRAME_STYLE,
136 const wxString& name = wxPyFrameNameStr);
137 %name(wxPreFrame)wxFrame();
139 bool Create(wxWindow* parent, const wxWindowID id, const wxString& title,
140 const wxPoint& pos = wxDefaultPosition,
141 const wxSize& size = wxDefaultSize,
142 long style = wxDEFAULT_FRAME_STYLE,
143 const wxString& name = wxPyFrameNameStr);
145 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
146 %pragma(python) addtomethod = "wxPreFrame:val._setOORInfo(val)"
148 wxPoint GetClientAreaOrigin();
150 void SetMenuBar(wxMenuBar *menubar);
151 wxMenuBar *GetMenuBar();
154 // process menu command: returns TRUE if processed
155 bool ProcessCommand(int id);
156 %pragma(python) addtoclass = "Command = ProcessCommand"
158 // create the main status bar
159 wxStatusBar* CreateStatusBar(int number = 1,
160 long style = wxST_SIZEGRIP,
162 const wxString& name = wxPyStatusLineNameStr);
164 // get the main status bar
165 wxStatusBar *GetStatusBar();
167 // sets the main status bar
168 void SetStatusBar(wxStatusBar *statBar);
170 // forward these to status bar
171 virtual void SetStatusText(const wxString &text, int number = 0);
172 virtual void SetStatusWidths(int LCOUNT, int* choices); // uses typemap
173 void PushStatusText(const wxString &text, int number = 0);
174 void PopStatusText(int number = 0);
176 // show help text (typically in the statusbar); show is FALSE
177 // if you are hiding the help, TRUE otherwise
178 virtual void DoGiveHelp(const wxString& text, bool show);
180 // set the status bar pane the help will be shown in
181 void SetStatusBarPane(int n);
182 int GetStatusBarPane() const;
185 // create main toolbar
186 virtual wxToolBar* CreateToolBar(long style = -1, //wxNO_BORDER|wxTB_HORIZONTAL,
188 const wxString& name = wxPyToolBarNameStr);
190 // get/set the main toolbar
191 virtual wxToolBar *GetToolBar() const { return m_frameToolBar; }
192 virtual void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
194 // sends a size event to the window using its current size -- this has an
195 // effect of refreshing the window layout
196 virtual void SendSizeEvent();
199 // send wxUpdateUIEvents for all menu items in the menubar,
200 // or just for menu if non-NULL
201 void DoMenuUpdates(wxMenu* menu = NULL);
203 // do the UI update processing for this window
204 virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE);
207 //---------------------------------------------------------------------------
209 class wxDialog : public wxTopLevelWindow {
211 wxDialog(wxWindow* parent,
213 const wxString& title,
214 const wxPoint& pos = wxDefaultPosition,
215 const wxSize& size = wxDefaultSize,
216 long style = wxDEFAULT_DIALOG_STYLE,
217 const wxString& name = wxPyDialogNameStr);
218 %name(wxPreDialog)wxDialog();
220 bool Create(wxWindow* parent,
222 const wxString& title,
223 const wxPoint& pos = wxDefaultPosition,
224 const wxSize& size = wxDefaultSize,
225 long style = wxDEFAULT_DIALOG_STYLE,
226 const wxString& name = wxPyDialogNameStr);
228 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
229 %pragma(python) addtomethod = "wxPreDialog:val._setOORInfo(val)"
231 void Centre(int direction = wxBOTH);
232 void EndModal(int retCode);
233 void SetModal(bool flag);
238 void SetReturnCode(int retCode);
240 wxSizer* CreateTextSizer( const wxString &message );
241 wxSizer* CreateButtonSizer( long flags );
246 //---------------------------------------------------------------------------
248 class wxMiniFrame : public wxFrame {
250 wxMiniFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
251 const wxPoint& pos = wxDefaultPosition,
252 const wxSize& size = wxDefaultSize,
253 long style = wxDEFAULT_FRAME_STYLE,
254 const wxString& name = wxPyFrameNameStr);
255 %name(wxPreMiniFrame)wxMiniFrame();
257 bool Create(wxWindow* parent, const wxWindowID id, const wxString& title,
258 const wxPoint& pos = wxDefaultPosition,
259 const wxSize& size = wxDefaultSize,
260 long style = wxDEFAULT_FRAME_STYLE,
261 const wxString& name = wxPyFrameNameStr);
263 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
264 %pragma(python) addtomethod = "wxPreMiniFrame:val._setOORInfo(val)"
268 //---------------------------------------------------------------------------
271 wxSPLASH_CENTRE_ON_PARENT,
272 wxSPLASH_CENTRE_ON_SCREEN,
279 class wxSplashScreenWindow: public wxWindow
282 wxSplashScreenWindow(const wxBitmap& bitmap,
283 wxWindow* parent, wxWindowID id,
284 const wxPoint& pos = wxDefaultPosition,
285 const wxSize& size = wxDefaultSize,
286 long style = wxNO_BORDER);
288 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
290 void SetBitmap(const wxBitmap& bitmap);
291 wxBitmap& GetBitmap();
295 class wxSplashScreen : public wxFrame {
297 wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds,
298 wxWindow* parent, wxWindowID id,
299 const wxPoint& pos = wxDefaultPosition,
300 const wxSize& size = wxDefaultSize,
301 long style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP);
303 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
305 long GetSplashStyle() const;
306 wxSplashScreenWindow* GetSplashWindow() const;
307 int GetTimeout() const;
311 //---------------------------------------------------------------------------