]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/frames.i
Added URL drag and drop sample to the wxPython demo
[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 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
75 %pragma(python) addtomethod = "wxPreTopLevelWindowXXX:val._setOORInfo(self)"
76
77 // maximize = TRUE => maximize, otherwise - restore
78 virtual void Maximize(bool maximize = TRUE);
79
80 // undo Maximize() or Iconize()
81 virtual void Restore();
82
83 // iconize = TRUE => iconize, otherwise - restore
84 virtual void Iconize(bool iconize = TRUE);
85
86 // return TRUE if the frame is maximized
87 virtual bool IsMaximized() const;
88
89 // return TRUE if the frame is iconized
90 virtual bool IsIconized() const;
91
92 // get the frame icon
93 const wxIcon& GetIcon() const;
94
95 // set the frame icon
96 virtual void SetIcon(const wxIcon& icon);
97
98
99 // maximize the window to cover entire screen
100 virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
101
102 // return TRUE if the frame is in fullscreen mode
103 virtual bool IsFullScreen() const;
104
105 virtual void SetTitle(const wxString& title);
106 virtual wxString GetTitle() const;
107 };
108
109 //----------------------------------------------------------------------
110
111
112 class wxFrame : public wxTopLevelWindow {
113 public:
114 wxFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
115 const wxPoint& pos = wxDefaultPosition,
116 const wxSize& size = wxDefaultSize,
117 long style = wxDEFAULT_FRAME_STYLE,
118 char* name = "frame");
119 %name(wxPreFrame)wxFrame();
120
121 bool Create(wxWindow* parent, const wxWindowID id, const wxString& title,
122 const wxPoint& pos = wxDefaultPosition,
123 const wxSize& size = wxDefaultSize,
124 long style = wxDEFAULT_FRAME_STYLE,
125 char* name = "frame");
126
127 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
128 %pragma(python) addtomethod = "wxPreFrame:val._setOORInfo(self)"
129
130 wxPoint GetClientAreaOrigin();
131
132 void SetMenuBar(wxMenuBar *menubar);
133 wxMenuBar *GetMenuBar();
134
135
136 // call this to simulate a menu command
137 bool Command(int id);
138
139 // process menu command: returns TRUE if processed
140 bool ProcessCommand(int id);
141
142 // create the main status bar
143 wxStatusBar* CreateStatusBar(int number = 1,
144 long style = wxST_SIZEGRIP,
145 wxWindowID id = -1,
146 char* name = "statusBar");
147
148 // get the main status bar
149 wxStatusBar *GetStatusBar();
150
151 // sets the main status bar
152 void SetStatusBar(wxStatusBar *statBar);
153
154 // forward these to status bar
155 virtual void SetStatusText(const wxString &text, int number = 0);
156 virtual void SetStatusWidths(int LCOUNT, int* choices); // uses typemap
157
158
159 // create main toolbar
160 virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL,
161 wxWindowID id = -1,
162 const char* name = "toolBar");
163
164 // get/set the main toolbar
165 virtual wxToolBar *GetToolBar() const { return m_frameToolBar; }
166 virtual void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
167
168 };
169
170 //---------------------------------------------------------------------------
171
172 class wxDialog : public wxTopLevelWindow {
173 public:
174 wxDialog(wxWindow* parent,
175 const wxWindowID id,
176 const wxString& title,
177 const wxPoint& pos = wxDefaultPosition,
178 const wxSize& size = wxDefaultSize,
179 long style = wxDEFAULT_DIALOG_STYLE,
180 const char* name = "dialogBox");
181 %name(wxPreDialog)wxDialog();
182
183 bool Create(wxWindow* parent,
184 const wxWindowID id,
185 const wxString& title,
186 const wxPoint& pos = wxDefaultPosition,
187 const wxSize& size = wxDefaultSize,
188 long style = wxDEFAULT_DIALOG_STYLE,
189 const char* name = "dialogBox");
190
191 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
192 %pragma(python) addtomethod = "wxPreDialog:val._setOORInfo(self)"
193
194 void Centre(int direction = wxBOTH);
195 void EndModal(int retCode);
196 void SetModal(bool flag);
197 bool IsModal();
198 int ShowModal();
199
200 int GetReturnCode();
201 void SetReturnCode(int retCode);
202
203 wxSizer* CreateTextSizer( const wxString &message );
204 wxSizer* CreateButtonSizer( long flags );
205
206 };
207
208
209 //---------------------------------------------------------------------------
210
211 class wxMiniFrame : public wxFrame {
212 public:
213 wxMiniFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
214 const wxPoint& pos = wxDefaultPosition,
215 const wxSize& size = wxDefaultSize,
216 long style = wxDEFAULT_FRAME_STYLE,
217 char* name = "frame");
218 %name(wxPreMiniFrame)wxMiniFrame();
219
220 bool Create(wxWindow* parent, const wxWindowID id, const wxString& title,
221 const wxPoint& pos = wxDefaultPosition,
222 const wxSize& size = wxDefaultSize,
223 long style = wxDEFAULT_FRAME_STYLE,
224 char* name = "frame");
225
226 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
227 %pragma(python) addtomethod = "wxPreMiniFrame:val._setOORInfo(self)"
228 };
229
230
231 //---------------------------------------------------------------------------
232
233 class wxTipWindow : public wxFrame
234 {
235 public:
236 wxTipWindow(wxWindow *parent,
237 const wxString& text,
238 wxCoord maxLength = 100);
239
240 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
241 };
242
243
244 //---------------------------------------------------------------------------
245
246
247
248
249