]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/windows2.i
fix for wxStatusBar wrongly reporting field rects inside EVT_SIZE handler
[wxWidgets.git] / wxPython / src / windows2.i
CommitLineData
7bf85405
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: windows2.i
3// Purpose: SWIG definitions of MORE window classes
4//
5// Author: Robin Dunn
6//
7// Created: 6/2/98
8// RCS-ID: $Id$
9// Copyright: (c) 1998 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
03e9bead 13%module windows2
7bf85405 14
03e9bead 15%{
7bf85405 16#include "helpers.h"
f6bcfd97 17#ifdef OLD_GRID
7bf85405 18#include <wx/grid.h>
f6bcfd97 19#endif
7bf85405 20#include <wx/notebook.h>
9c039d08 21#include <wx/splitter.h>
9416aa89 22#include <wx/imaglist.h>
b639c3c5
RD
23#ifdef __WXMSW__
24#include <wx/msw/taskbar.h>
25#endif
7bf85405
RD
26%}
27
28//----------------------------------------------------------------------
29
30%include typemaps.i
31%include my_typemaps.i
32
33// Import some definitions of other classes, etc.
34%import _defs.i
35%import misc.i
36%import gdi.i
37%import windows.i
38%import controls.i
39%import events.i
40
b8b8dda7 41%pragma(python) code = "import wx"
9c039d08 42
7bf85405
RD
43//---------------------------------------------------------------------------
44
1b62f00d
RD
45enum {
46 /* notebook control event types */
47 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
48 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING,
49};
50
51
bb0054cd 52class wxNotebookEvent : public wxNotifyEvent {
7bf85405 53public:
09f3d4e6
RD
54 wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
55 int nSel = -1, int nOldSel = -1);
56
7bf85405
RD
57 int GetSelection();
58 int GetOldSelection();
bb0054cd
RD
59 void SetOldSelection(int page);
60 void SetSelection(int page);
7bf85405
RD
61};
62
63
64
65class wxNotebook : public wxControl {
66public:
67 wxNotebook(wxWindow *parent,
68 wxWindowID id,
b68dc582
RD
69 const wxPoint& pos = wxDefaultPosition,
70 const wxSize& size = wxDefaultSize,
7bf85405
RD
71 long style = 0,
72 char* name = "notebook");
09f3d4e6 73 %name(wxPreNotebook)wxNotebook();
7bf85405 74
09f3d4e6
RD
75 bool Create(wxWindow *parent,
76 wxWindowID id,
77 const wxPoint& pos = wxDefaultPosition,
78 const wxSize& size = wxDefaultSize,
79 long style = 0,
80 char* name = "notebook");
9c039d08 81
7bf85405
RD
82 int GetPageCount();
83 int SetSelection(int nPage);
84 void AdvanceSelection(bool bForward = TRUE);
85 int GetSelection();
86 bool SetPageText(int nPage, const wxString& strText);
87 wxString GetPageText(int nPage) const;
88 void SetImageList(wxImageList* imageList);
89 wxImageList* GetImageList();
90 int GetPageImage(int nPage);
91 bool SetPageImage(int nPage, int nImage);
92 int GetRowCount();
93
c368d904
RD
94 void SetPageSize(const wxSize& size);
95 void SetPadding(const wxSize& padding);
7bf85405 96 bool DeletePage(int nPage);
cf694132 97 bool RemovePage(int nPage);
7bf85405
RD
98 bool DeleteAllPages();
99 bool AddPage(/*wxNotebookPage*/ wxWindow *pPage,
100 const wxString& strText,
cf694132 101 int bSelect = FALSE,
7bf85405
RD
102 int imageId = -1);
103 bool InsertPage(int nPage,
104 /*wxNotebookPage*/ wxWindow *pPage,
105 const wxString& strText,
106 bool bSelect = FALSE,
107 int imageId = -1);
bb0054cd 108 /*wxNotebookPage*/ wxWindow *GetPage(int nPage);
7bf85405 109
cf694132
RD
110 %addmethods {
111 void ResizeChildren() {
112 wxSizeEvent evt(self->GetClientSize());
4cd9591a 113 self->GetEventHandler()->ProcessEvent(evt);
cf694132
RD
114 }
115 }
116
117
7bf85405
RD
118};
119
9c039d08
RD
120//---------------------------------------------------------------------------
121
f6bcfd97 122
1b62f00d
RD
123enum {
124 /* splitter window events */
125 wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING,
126 wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED,
127 wxEVT_COMMAND_SPLITTER_UNSPLIT,
128 wxEVT_COMMAND_SPLITTER_DOUBLECLICKED,
129};
130
131
f6bcfd97
BP
132enum
133{
134 wxSPLIT_HORIZONTAL,
135 wxSPLIT_VERTICAL,
136 wxSPLIT_DRAG_NONE,
137 wxSPLIT_DRAG_DRAGGING,
138 wxSPLIT_DRAG_LEFT_DOWN
f6bcfd97
BP
139};
140
141
bb0054cd
RD
142class wxSplitterEvent : public wxCommandEvent {
143public:
09f3d4e6
RD
144 wxSplitterEvent(wxEventType type = wxEVT_NULL,
145 wxSplitterWindow *splitter = NULL);
146
bb0054cd
RD
147 int GetSashPosition();
148 int GetX();
149 int GetY();
150 wxWindow* GetWindowBeingRemoved();
151 void SetSashPosition(int pos);
152}
153
154
155
156
9c039d08
RD
157class wxSplitterWindow : public wxWindow {
158public:
159 wxSplitterWindow(wxWindow* parent, wxWindowID id,
b68dc582
RD
160 const wxPoint& point = wxDefaultPosition,
161 const wxSize& size = wxDefaultSize,
b639c3c5 162 long style=wxSP_3D|wxCLIP_CHILDREN,
9c039d08 163 char* name = "splitterWindow");
09f3d4e6 164 %name(wxPreSplitterWindow)wxSplitterWindow();
9c039d08 165
09f3d4e6
RD
166 bool Create(wxWindow* parent, wxWindowID id,
167 const wxPoint& point = wxDefaultPosition,
168 const wxSize& size = wxDefaultSize,
169 long style=wxSP_3D|wxCLIP_CHILDREN,
170 char* name = "splitterWindow");
9c039d08 171
09f3d4e6
RD
172
173 // Gets the only or left/top pane
174 wxWindow *GetWindow1();
175
176 // Gets the right/bottom pane
177 wxWindow *GetWindow2();
178
179 // Sets the split mode
180 void SetSplitMode(int mode);
181
182 // Gets the split mode
9c039d08 183 int GetSplitMode();
09f3d4e6
RD
184
185 // Initialize with one window
186 void Initialize(wxWindow *window);
187
188 // Associates the given window with window 2, drawing the appropriate sash
189 // and changing the split mode.
190 // Does nothing and returns FALSE if the window is already split.
191 // A sashPosition of 0 means choose a default sash position,
192 // negative sashPosition specifies the size of right/lower pane as it's
193 // absolute value rather than the size of left/upper pane.
194 virtual bool SplitVertically(wxWindow *window1,
195 wxWindow *window2,
196 int sashPosition = 0);
197 virtual bool SplitHorizontally(wxWindow *window1,
198 wxWindow *window2,
199 int sashPosition = 0);
200
201 // Removes the specified (or second) window from the view
202 // Doesn't actually delete the window.
203 bool Unsplit(wxWindow *toRemove = NULL);
204
205 // Replaces one of the windows with another one (neither old nor new
206 // parameter should be NULL)
207 bool ReplaceWindow(wxWindow *winOld, wxWindow *winNew);
208
209 // Is the window split?
9c039d08
RD
210 bool IsSplit();
211
09f3d4e6 212 // Sets the sash size
b639c3c5 213 void SetSashSize(int width);
09f3d4e6
RD
214
215 // Sets the border size
216 void SetBorderSize(int width);
217
218 // Gets the sash size
219 int GetSashSize();
220
221 // Gets the border size
222 int GetBorderSize();
223
224 // Set the sash position
225 void SetSashPosition(int position, bool redraw = TRUE);
226
227 // Gets the sash position
228 int GetSashPosition();
229
230 // If this is zero, we can remove panes by dragging the sash.
231 void SetMinimumPaneSize(int min);
232 int GetMinimumPaneSize();
233
9c039d08
RD
234};
235
236//---------------------------------------------------------------------------
237
b639c3c5
RD
238#ifdef __WXMSW__
239
240enum {
241 wxEVT_TASKBAR_MOVE,
242 wxEVT_TASKBAR_LEFT_DOWN,
243 wxEVT_TASKBAR_LEFT_UP,
244 wxEVT_TASKBAR_RIGHT_DOWN,
245 wxEVT_TASKBAR_RIGHT_UP,
246 wxEVT_TASKBAR_LEFT_DCLICK,
247 wxEVT_TASKBAR_RIGHT_DCLICK
248};
9c039d08
RD
249
250
b639c3c5
RD
251class wxTaskBarIcon : public wxEvtHandler {
252public:
253 wxTaskBarIcon();
254 ~wxTaskBarIcon();
255
c368d904 256 // We still use the magic methods here since that is the way it is documented...
b8b8dda7
RD
257 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnMouseMove', wxEVT_TASKBAR_MOVE)"
258 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDown', wxEVT_TASKBAR_LEFT_DOWN)"
259 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonUp', wxEVT_TASKBAR_LEFT_UP)"
260 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDown', wxEVT_TASKBAR_RIGHT_DOWN)"
261 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonUp', wxEVT_TASKBAR_RIGHT_UP)"
262 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDClick',wxEVT_TASKBAR_LEFT_DCLICK)"
263 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDClick',wxEVT_TASKBAR_RIGHT_DCLICK)"
b639c3c5
RD
264
265 bool SetIcon(const wxIcon& icon, const char* tooltip = "");
266 bool RemoveIcon(void);
be4d9c1f 267 bool PopupMenu(wxMenu *menu);
c368d904
RD
268 bool IsIconInstalled();
269 bool IsOK();
b639c3c5
RD
270};
271#endif
272
7bf85405 273//---------------------------------------------------------------------------