1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions of MORE window classes
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
20 #include <wx/notebook.h>
21 #include <wx/splitter.h>
22 #include <wx/imaglist.h>
24 #include <wx/msw/taskbar.h>
28 //----------------------------------------------------------------------
31 %include my_typemaps.i
33 // Import some definitions of other classes, etc.
41 %pragma(python) code = "import wx"
43 //---------------------------------------------------------------------------
46 /* notebook control event types */
47 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
48 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING,
52 class wxNotebookEvent : public wxNotifyEvent {
54 wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
55 int nSel = -1, int nOldSel = -1);
58 int GetOldSelection();
59 void SetOldSelection(int page);
60 void SetSelection(int page);
65 class wxNotebook : public wxControl {
67 wxNotebook(wxWindow *parent,
69 const wxPoint& pos = wxDefaultPosition,
70 const wxSize& size = wxDefaultSize,
72 char* name = "notebook");
73 %name(wxPreNotebook)wxNotebook();
75 bool Create(wxWindow *parent,
77 const wxPoint& pos = wxDefaultPosition,
78 const wxSize& size = wxDefaultSize,
80 char* name = "notebook");
82 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
83 %pragma(python) addtomethod = "wxPreNotebook:val._setOORInfo(self)"
86 int SetSelection(int nPage);
87 void AdvanceSelection(bool bForward = TRUE);
89 bool SetPageText(int nPage, const wxString& strText);
90 wxString GetPageText(int nPage) const;
92 void SetImageList(wxImageList* imageList);
93 void AssignImageList(wxImageList *imageList) ;
94 %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0"
96 wxImageList* GetImageList();
97 int GetPageImage(int nPage);
98 bool SetPageImage(int nPage, int nImage);
101 void SetPageSize(const wxSize& size);
102 void SetPadding(const wxSize& padding);
103 bool DeletePage(int nPage);
104 bool RemovePage(int nPage);
105 bool DeleteAllPages();
106 bool AddPage(/*wxNotebookPage*/ wxWindow *pPage,
107 const wxString& strText,
110 bool InsertPage(int nPage,
111 /*wxNotebookPage*/ wxWindow *pPage,
112 const wxString& strText,
113 bool bSelect = FALSE,
115 /*wxNotebookPage*/ wxWindow *GetPage(int nPage);
118 void ResizeChildren() {
119 wxSizeEvent evt(self->GetClientSize());
120 self->GetEventHandler()->ProcessEvent(evt);
127 //---------------------------------------------------------------------------
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,
144 wxSPLIT_DRAG_DRAGGING,
145 wxSPLIT_DRAG_LEFT_DOWN
149 class wxSplitterEvent : public wxCommandEvent {
151 wxSplitterEvent(wxEventType type = wxEVT_NULL,
152 wxSplitterWindow *splitter = NULL);
154 int GetSashPosition();
157 wxWindow* GetWindowBeingRemoved();
158 void SetSashPosition(int pos);
164 class wxSplitterWindow : public wxWindow {
166 wxSplitterWindow(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");
171 %name(wxPreSplitterWindow)wxSplitterWindow();
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");
179 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
180 %pragma(python) addtomethod = "wxPreSplitterWindow:val._setOORInfo(self)"
182 // Gets the only or left/top pane
183 wxWindow *GetWindow1();
185 // Gets the right/bottom pane
186 wxWindow *GetWindow2();
188 // Sets the split mode
189 void SetSplitMode(int mode);
191 // Gets the split mode
194 // Initialize with one window
195 void Initialize(wxWindow *window);
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,
205 int sashPosition = 0);
206 virtual bool SplitHorizontally(wxWindow *window1,
208 int sashPosition = 0);
210 // Removes the specified (or second) window from the view
211 // Doesn't actually delete the window.
212 bool Unsplit(wxWindow *toRemove = NULL);
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);
218 // Is the window split?
221 // Sets the sash size
222 void SetSashSize(int width);
224 // Sets the border size
225 void SetBorderSize(int width);
227 // Gets the sash size
230 // Gets the border size
233 // Set the sash position
234 void SetSashPosition(int position, bool redraw = TRUE);
236 // Gets the sash position
237 int GetSashPosition();
239 // If this is zero, we can remove panes by dragging the sash.
240 void SetMinimumPaneSize(int min);
241 int GetMinimumPaneSize();
245 //---------------------------------------------------------------------------
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
260 class wxTaskBarIcon : public wxEvtHandler {
265 //%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
267 // We still use the magic methods here since that is the way it is documented...
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)"
276 bool SetIcon(const wxIcon& icon, const char* tooltip = "");
277 bool RemoveIcon(void);
278 bool PopupMenu(wxMenu *menu);
279 bool IsIconInstalled();
284 //---------------------------------------------------------------------------