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");
83 int SetSelection(int nPage);
84 void AdvanceSelection(bool bForward = TRUE);
86 bool SetPageText(int nPage, const wxString& strText);
87 wxString GetPageText(int nPage) const;
89 void SetImageList(wxImageList* imageList);
90 void AssignImageList(wxImageList *imageList) ;
91 %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0"
93 wxImageList* GetImageList();
94 int GetPageImage(int nPage);
95 bool SetPageImage(int nPage, int nImage);
98 void SetPageSize(const wxSize& size);
99 void SetPadding(const wxSize& padding);
100 bool DeletePage(int nPage);
101 bool RemovePage(int nPage);
102 bool DeleteAllPages();
103 bool AddPage(/*wxNotebookPage*/ wxWindow *pPage,
104 const wxString& strText,
107 bool InsertPage(int nPage,
108 /*wxNotebookPage*/ wxWindow *pPage,
109 const wxString& strText,
110 bool bSelect = FALSE,
112 /*wxNotebookPage*/ wxWindow *GetPage(int nPage);
115 void ResizeChildren() {
116 wxSizeEvent evt(self->GetClientSize());
117 self->GetEventHandler()->ProcessEvent(evt);
124 //---------------------------------------------------------------------------
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,
141 wxSPLIT_DRAG_DRAGGING,
142 wxSPLIT_DRAG_LEFT_DOWN
146 class wxSplitterEvent : public wxCommandEvent {
148 wxSplitterEvent(wxEventType type = wxEVT_NULL,
149 wxSplitterWindow *splitter = NULL);
151 int GetSashPosition();
154 wxWindow* GetWindowBeingRemoved();
155 void SetSashPosition(int pos);
161 class wxSplitterWindow : public wxWindow {
163 wxSplitterWindow(wxWindow* parent, wxWindowID id,
164 const wxPoint& point = wxDefaultPosition,
165 const wxSize& size = wxDefaultSize,
166 long style=wxSP_3D|wxCLIP_CHILDREN,
167 char* name = "splitterWindow");
168 %name(wxPreSplitterWindow)wxSplitterWindow();
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");
177 // Gets the only or left/top pane
178 wxWindow *GetWindow1();
180 // Gets the right/bottom pane
181 wxWindow *GetWindow2();
183 // Sets the split mode
184 void SetSplitMode(int mode);
186 // Gets the split mode
189 // Initialize with one window
190 void Initialize(wxWindow *window);
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,
200 int sashPosition = 0);
201 virtual bool SplitHorizontally(wxWindow *window1,
203 int sashPosition = 0);
205 // Removes the specified (or second) window from the view
206 // Doesn't actually delete the window.
207 bool Unsplit(wxWindow *toRemove = NULL);
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);
213 // Is the window split?
216 // Sets the sash size
217 void SetSashSize(int width);
219 // Sets the border size
220 void SetBorderSize(int width);
222 // Gets the sash size
225 // Gets the border size
228 // Set the sash position
229 void SetSashPosition(int position, bool redraw = TRUE);
231 // Gets the sash position
232 int GetSashPosition();
234 // If this is zero, we can remove panes by dragging the sash.
235 void SetMinimumPaneSize(int min);
236 int GetMinimumPaneSize();
240 //---------------------------------------------------------------------------
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
255 class wxTaskBarIcon : public wxEvtHandler {
260 // We still use the magic methods here since that is the way it is documented...
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)"
269 bool SetIcon(const wxIcon& icon, const char* tooltip = "");
270 bool RemoveIcon(void);
271 bool PopupMenu(wxMenu *menu);
272 bool IsIconInstalled();
277 //---------------------------------------------------------------------------