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 // Put some wx default wxChar* values into wxStrings.
32 DECLARE_DEF_STRING(NOTEBOOK_NAME);
34 static const wxChar* wxSplitterNameStr = wxT("splitter");
35 DECLARE_DEF_STRING(SplitterNameStr);
36 static const wxString wxPyEmptyString(wxT(""));
39 //----------------------------------------------------------------------
42 %include my_typemaps.i
44 // Import some definitions of other classes, etc.
52 %pragma(python) code = "import wx"
54 //---------------------------------------------------------------------------
57 /* notebook control event types */
58 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
59 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING,
63 class wxNotebookEvent : public wxNotifyEvent {
65 wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
66 int nSel = -1, int nOldSel = -1);
69 int GetOldSelection();
70 void SetOldSelection(int page);
71 void SetSelection(int page);
76 class wxNotebook : public wxControl {
78 wxNotebook(wxWindow *parent,
80 const wxPoint& pos = wxDefaultPosition,
81 const wxSize& size = wxDefaultSize,
83 const wxString& name = wxPyNOTEBOOK_NAME);
84 %name(wxPreNotebook)wxNotebook();
86 bool Create(wxWindow *parent,
88 const wxPoint& pos = wxDefaultPosition,
89 const wxSize& size = wxDefaultSize,
91 const wxString& name = wxPyNOTEBOOK_NAME);
93 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
94 %pragma(python) addtomethod = "wxPreNotebook:val._setOORInfo(val)"
97 int SetSelection(int nPage);
98 void AdvanceSelection(bool bForward = TRUE);
100 bool SetPageText(int nPage, const wxString& strText);
101 wxString GetPageText(int nPage) const;
103 void SetImageList(wxImageList* imageList);
104 void AssignImageList(wxImageList *imageList) ;
105 %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0"
107 wxImageList* GetImageList();
108 int GetPageImage(int nPage);
109 bool SetPageImage(int nPage, int nImage);
112 void SetPageSize(const wxSize& size);
113 void SetPadding(const wxSize& padding);
114 bool DeletePage(int nPage);
115 bool RemovePage(int nPage);
116 bool DeleteAllPages();
117 bool AddPage(/*wxNotebookPage*/ wxWindow *pPage,
118 const wxString& strText,
121 bool InsertPage(int nPage,
122 /*wxNotebookPage*/ wxWindow *pPage,
123 const wxString& strText,
124 bool bSelect = FALSE,
126 /*wxNotebookPage*/ wxWindow *GetPage(int nPage);
129 void ResizeChildren() {
130 wxSizeEvent evt(self->GetClientSize());
131 self->GetEventHandler()->ProcessEvent(evt);
138 //---------------------------------------------------------------------------
142 /* splitter window events */
143 wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING,
144 wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED,
145 wxEVT_COMMAND_SPLITTER_UNSPLIT,
146 wxEVT_COMMAND_SPLITTER_DOUBLECLICKED,
155 wxSPLIT_DRAG_DRAGGING,
156 wxSPLIT_DRAG_LEFT_DOWN
160 class wxSplitterEvent : public wxCommandEvent {
162 wxSplitterEvent(wxEventType type = wxEVT_NULL,
163 wxSplitterWindow *splitter = NULL);
165 int GetSashPosition();
168 wxWindow* GetWindowBeingRemoved();
169 void SetSashPosition(int pos);
175 class wxSplitterWindow : public wxWindow {
177 wxSplitterWindow(wxWindow* parent, wxWindowID id,
178 const wxPoint& point = wxDefaultPosition,
179 const wxSize& size = wxDefaultSize,
180 long style=wxSP_3D|wxCLIP_CHILDREN,
181 const wxString& name = wxPySplitterNameStr);
182 %name(wxPreSplitterWindow)wxSplitterWindow();
184 bool Create(wxWindow* parent, wxWindowID id,
185 const wxPoint& point = wxDefaultPosition,
186 const wxSize& size = wxDefaultSize,
187 long style=wxSP_3D|wxCLIP_CHILDREN,
188 const wxString& name = wxPySplitterNameStr);
190 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
191 %pragma(python) addtomethod = "wxPreSplitterWindow:val._setOORInfo(val)"
193 // Gets the only or left/top pane
194 wxWindow *GetWindow1();
196 // Gets the right/bottom pane
197 wxWindow *GetWindow2();
199 // Sets the split mode
200 void SetSplitMode(int mode);
202 // Gets the split mode
205 // Initialize with one window
206 void Initialize(wxWindow *window);
208 // Associates the given window with window 2, drawing the appropriate sash
209 // and changing the split mode.
210 // Does nothing and returns FALSE if the window is already split.
211 // A sashPosition of 0 means choose a default sash position,
212 // negative sashPosition specifies the size of right/lower pane as it's
213 // absolute value rather than the size of left/upper pane.
214 virtual bool SplitVertically(wxWindow *window1,
216 int sashPosition = 0);
217 virtual bool SplitHorizontally(wxWindow *window1,
219 int sashPosition = 0);
221 // Removes the specified (or second) window from the view
222 // Doesn't actually delete the window.
223 bool Unsplit(wxWindow *toRemove = NULL);
225 // Replaces one of the windows with another one (neither old nor new
226 // parameter should be NULL)
227 bool ReplaceWindow(wxWindow *winOld, wxWindow *winNew);
229 // Is the window split?
232 // Sets the sash size
233 void SetSashSize(int width);
235 // Sets the border size
236 void SetBorderSize(int width);
238 // Gets the sash size
241 // Gets the border size
244 // Set the sash position
245 void SetSashPosition(int position, bool redraw = TRUE);
247 // Gets the sash position
248 int GetSashPosition();
250 // If this is zero, we can remove panes by dragging the sash.
251 void SetMinimumPaneSize(int min);
252 int GetMinimumPaneSize();
254 // Resizes subwindows
255 virtual void SizeWindows();
257 void SetNeedUpdating(bool needUpdating) { m_needUpdating = needUpdating; }
258 bool GetNeedUpdating() const { return m_needUpdating ; }
262 //---------------------------------------------------------------------------
268 wxEVT_TASKBAR_LEFT_DOWN,
269 wxEVT_TASKBAR_LEFT_UP,
270 wxEVT_TASKBAR_RIGHT_DOWN,
271 wxEVT_TASKBAR_RIGHT_UP,
272 wxEVT_TASKBAR_LEFT_DCLICK,
273 wxEVT_TASKBAR_RIGHT_DCLICK
277 class wxTaskBarIcon : public wxEvtHandler {
282 //%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
284 // We still use the magic methods here since that is the way it is documented...
285 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnMouseMove', wxEVT_TASKBAR_MOVE)"
286 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDown', wxEVT_TASKBAR_LEFT_DOWN)"
287 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonUp', wxEVT_TASKBAR_LEFT_UP)"
288 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDown', wxEVT_TASKBAR_RIGHT_DOWN)"
289 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonUp', wxEVT_TASKBAR_RIGHT_UP)"
290 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDClick',wxEVT_TASKBAR_LEFT_DCLICK)"
291 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDClick',wxEVT_TASKBAR_RIGHT_DCLICK)"
293 bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxPyEmptyString);
294 bool RemoveIcon(void);
295 bool PopupMenu(wxMenu *menu);
296 bool IsIconInstalled();
301 //---------------------------------------------------------------------------