]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/windows2.i
Added comment about an untested code path...
[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
0122b7e3 82 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 83 %pragma(python) addtomethod = "wxPreNotebook:val._setOORInfo(val)"
0122b7e3 84
7bf85405
RD
85 int GetPageCount();
86 int SetSelection(int nPage);
87 void AdvanceSelection(bool bForward = TRUE);
88 int GetSelection();
89 bool SetPageText(int nPage, const wxString& strText);
90 wxString GetPageText(int nPage) const;
949853a4 91
7bf85405 92 void SetImageList(wxImageList* imageList);
949853a4
RD
93 void AssignImageList(wxImageList *imageList) ;
94 %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0"
95
7bf85405
RD
96 wxImageList* GetImageList();
97 int GetPageImage(int nPage);
98 bool SetPageImage(int nPage, int nImage);
99 int GetRowCount();
100
c368d904
RD
101 void SetPageSize(const wxSize& size);
102 void SetPadding(const wxSize& padding);
7bf85405 103 bool DeletePage(int nPage);
cf694132 104 bool RemovePage(int nPage);
7bf85405
RD
105 bool DeleteAllPages();
106 bool AddPage(/*wxNotebookPage*/ wxWindow *pPage,
107 const wxString& strText,
cf694132 108 int bSelect = FALSE,
7bf85405
RD
109 int imageId = -1);
110 bool InsertPage(int nPage,
111 /*wxNotebookPage*/ wxWindow *pPage,
112 const wxString& strText,
113 bool bSelect = FALSE,
114 int imageId = -1);
bb0054cd 115 /*wxNotebookPage*/ wxWindow *GetPage(int nPage);
7bf85405 116
cf694132
RD
117 %addmethods {
118 void ResizeChildren() {
119 wxSizeEvent evt(self->GetClientSize());
4cd9591a 120 self->GetEventHandler()->ProcessEvent(evt);
cf694132
RD
121 }
122 }
123
124
7bf85405
RD
125};
126
9c039d08
RD
127//---------------------------------------------------------------------------
128
f6bcfd97 129
1b62f00d
RD
130enum {
131 /* splitter window events */
132 wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING,
133 wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED,
134 wxEVT_COMMAND_SPLITTER_UNSPLIT,
135 wxEVT_COMMAND_SPLITTER_DOUBLECLICKED,
136};
137
138
f6bcfd97
BP
139enum
140{
141 wxSPLIT_HORIZONTAL,
142 wxSPLIT_VERTICAL,
143 wxSPLIT_DRAG_NONE,
144 wxSPLIT_DRAG_DRAGGING,
145 wxSPLIT_DRAG_LEFT_DOWN
f6bcfd97
BP
146};
147
148
bb0054cd
RD
149class wxSplitterEvent : public wxCommandEvent {
150public:
09f3d4e6
RD
151 wxSplitterEvent(wxEventType type = wxEVT_NULL,
152 wxSplitterWindow *splitter = NULL);
153
bb0054cd
RD
154 int GetSashPosition();
155 int GetX();
156 int GetY();
157 wxWindow* GetWindowBeingRemoved();
158 void SetSashPosition(int pos);
159}
160
161
162
163
9c039d08
RD
164class wxSplitterWindow : public wxWindow {
165public:
166 wxSplitterWindow(wxWindow* parent, wxWindowID id,
b68dc582
RD
167 const wxPoint& point = wxDefaultPosition,
168 const wxSize& size = wxDefaultSize,
b639c3c5 169 long style=wxSP_3D|wxCLIP_CHILDREN,
9c039d08 170 char* name = "splitterWindow");
09f3d4e6 171 %name(wxPreSplitterWindow)wxSplitterWindow();
9c039d08 172
09f3d4e6
RD
173 bool Create(wxWindow* parent, wxWindowID id,
174 const wxPoint& point = wxDefaultPosition,
175 const wxSize& size = wxDefaultSize,
176 long style=wxSP_3D|wxCLIP_CHILDREN,
177 char* name = "splitterWindow");
9c039d08 178
0122b7e3 179 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 180 %pragma(python) addtomethod = "wxPreSplitterWindow:val._setOORInfo(val)"
09f3d4e6
RD
181
182 // Gets the only or left/top pane
183 wxWindow *GetWindow1();
184
185 // Gets the right/bottom pane
186 wxWindow *GetWindow2();
187
188 // Sets the split mode
189 void SetSplitMode(int mode);
190
191 // Gets the split mode
9c039d08 192 int GetSplitMode();
09f3d4e6
RD
193
194 // Initialize with one window
195 void Initialize(wxWindow *window);
196
197 // Associates the given window with window 2, drawing the appropriate sash
198 // and changing the split mode.
199 // Does nothing and returns FALSE if the window is already split.
200 // A sashPosition of 0 means choose a default sash position,
201 // negative sashPosition specifies the size of right/lower pane as it's
202 // absolute value rather than the size of left/upper pane.
203 virtual bool SplitVertically(wxWindow *window1,
204 wxWindow *window2,
205 int sashPosition = 0);
206 virtual bool SplitHorizontally(wxWindow *window1,
207 wxWindow *window2,
208 int sashPosition = 0);
209
210 // Removes the specified (or second) window from the view
211 // Doesn't actually delete the window.
212 bool Unsplit(wxWindow *toRemove = NULL);
213
214 // Replaces one of the windows with another one (neither old nor new
215 // parameter should be NULL)
216 bool ReplaceWindow(wxWindow *winOld, wxWindow *winNew);
217
218 // Is the window split?
9c039d08
RD
219 bool IsSplit();
220
09f3d4e6 221 // Sets the sash size
b639c3c5 222 void SetSashSize(int width);
09f3d4e6
RD
223
224 // Sets the border size
225 void SetBorderSize(int width);
226
227 // Gets the sash size
228 int GetSashSize();
229
230 // Gets the border size
231 int GetBorderSize();
232
233 // Set the sash position
234 void SetSashPosition(int position, bool redraw = TRUE);
235
236 // Gets the sash position
237 int GetSashPosition();
238
239 // If this is zero, we can remove panes by dragging the sash.
240 void SetMinimumPaneSize(int min);
241 int GetMinimumPaneSize();
242
9c039d08
RD
243};
244
245//---------------------------------------------------------------------------
246
b639c3c5
RD
247#ifdef __WXMSW__
248
249enum {
250 wxEVT_TASKBAR_MOVE,
251 wxEVT_TASKBAR_LEFT_DOWN,
252 wxEVT_TASKBAR_LEFT_UP,
253 wxEVT_TASKBAR_RIGHT_DOWN,
254 wxEVT_TASKBAR_RIGHT_UP,
255 wxEVT_TASKBAR_LEFT_DCLICK,
256 wxEVT_TASKBAR_RIGHT_DCLICK
257};
9c039d08
RD
258
259
b639c3c5
RD
260class wxTaskBarIcon : public wxEvtHandler {
261public:
262 wxTaskBarIcon();
263 ~wxTaskBarIcon();
264
0122b7e3
RD
265 //%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
266
c368d904 267 // We still use the magic methods here since that is the way it is documented...
b8b8dda7
RD
268 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnMouseMove', wxEVT_TASKBAR_MOVE)"
269 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDown', wxEVT_TASKBAR_LEFT_DOWN)"
270 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonUp', wxEVT_TASKBAR_LEFT_UP)"
271 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDown', wxEVT_TASKBAR_RIGHT_DOWN)"
272 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonUp', wxEVT_TASKBAR_RIGHT_UP)"
273 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDClick',wxEVT_TASKBAR_LEFT_DCLICK)"
274 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDClick',wxEVT_TASKBAR_RIGHT_DCLICK)"
b639c3c5
RD
275
276 bool SetIcon(const wxIcon& icon, const char* tooltip = "");
277 bool RemoveIcon(void);
be4d9c1f 278 bool PopupMenu(wxMenu *menu);
c368d904
RD
279 bool IsIconInstalled();
280 bool IsOK();
b639c3c5
RD
281};
282#endif
283
7bf85405 284//---------------------------------------------------------------------------