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