]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/frames.i
correction for memory leak
[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>
4f3449b4 19#include <wx/tipwin.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
f6bcfd97
BP
38enum {
39 wxFULLSCREEN_NOMENUBAR,
40 wxFULLSCREEN_NOTOOLBAR,
41 wxFULLSCREEN_NOSTATUSBAR,
42 wxFULLSCREEN_NOBORDER,
43 wxFULLSCREEN_NOCAPTION,
ecc08ead
RD
44 wxFULLSCREEN_ALL,
45
46 wxTOPLEVEL_EX_DIALOG,
f6bcfd97
BP
47};
48
49
ecc08ead
RD
50//----------------------------------------------------------------------
51
52
53class wxTopLevelWindow : public wxWindow
54{
55public:
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
110class wxFrame : public wxTopLevelWindow {
9c039d08
RD
111public:
112 wxFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
b68dc582
RD
113 const wxPoint& pos = wxDefaultPosition,
114 const wxSize& size = wxDefaultSize,
9c039d08
RD
115 long style = wxDEFAULT_FRAME_STYLE,
116 char* name = "frame");
09f3d4e6 117 %name(wxPreFrame)wxFrame();
9c039d08 118
09f3d4e6
RD
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");
9c039d08 124
ecc08ead
RD
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
9c039d08
RD
138 wxStatusBar* CreateStatusBar(int number = 1,
139 long style = wxST_SIZEGRIP,
140 wxWindowID id = -1,
141 char* name = "statusBar");
ecc08ead
RD
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
9c039d08
RD
163};
164
ecc08ead
RD
165//---------------------------------------------------------------------------
166
167class wxDialog : public wxTopLevelWindow {
168public:
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
9c039d08
RD
201//---------------------------------------------------------------------------
202
9c039d08
RD
203class wxMiniFrame : public wxFrame {
204public:
205 wxMiniFrame(wxWindow* parent, const wxWindowID id, const wxString& title,
b68dc582
RD
206 const wxPoint& pos = wxDefaultPosition,
207 const wxSize& size = wxDefaultSize,
9c039d08
RD
208 long style = wxDEFAULT_FRAME_STYLE,
209 char* name = "frame");
09f3d4e6 210 %name(wxPreMiniFrame)wxMiniFrame();
9c039d08 211
09f3d4e6
RD
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");
9c039d08 217};
b8b8dda7
RD
218
219
220//---------------------------------------------------------------------------
b8b8dda7 221
4f3449b4
RD
222class wxTipWindow : public wxFrame
223{
224public:
225 wxTipWindow(wxWindow *parent,
226 const wxString& text,
227 wxCoord maxLength = 100);
228};
229
230
231//---------------------------------------------------------------------------
232
b8b8dda7
RD
233
234
235
9c039d08 236