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;
88 void SetImageList(wxImageList* imageList);
89 wxImageList* GetImageList();
90 int GetPageImage(int nPage);
91 bool SetPageImage(int nPage, int nImage);
94 void SetPageSize(const wxSize& size);
95 void SetPadding(const wxSize& padding);
96 bool DeletePage(int nPage);
97 bool RemovePage(int nPage);
98 bool DeleteAllPages();
99 bool AddPage(/*wxNotebookPage*/ wxWindow *pPage,
100 const wxString& strText,
103 bool InsertPage(int nPage,
104 /*wxNotebookPage*/ wxWindow *pPage,
105 const wxString& strText,
106 bool bSelect = FALSE,
108 /*wxNotebookPage*/ wxWindow *GetPage(int nPage);
111 void ResizeChildren() {
112 wxSizeEvent evt(self->GetClientSize());
113 self->GetEventHandler()->ProcessEvent(evt);
120 //---------------------------------------------------------------------------
124 /* splitter window events */
125 wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING,
126 wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED,
127 wxEVT_COMMAND_SPLITTER_UNSPLIT,
128 wxEVT_COMMAND_SPLITTER_DOUBLECLICKED,
137 wxSPLIT_DRAG_DRAGGING,
138 wxSPLIT_DRAG_LEFT_DOWN
142 class wxSplitterEvent : public wxCommandEvent {
144 wxSplitterEvent(wxEventType type = wxEVT_NULL,
145 wxSplitterWindow *splitter = NULL);
147 int GetSashPosition();
150 wxWindow* GetWindowBeingRemoved();
151 void SetSashPosition(int pos);
157 class wxSplitterWindow : public wxWindow {
159 wxSplitterWindow(wxWindow* parent, wxWindowID id,
160 const wxPoint& point = wxDefaultPosition,
161 const wxSize& size = wxDefaultSize,
162 long style=wxSP_3D|wxCLIP_CHILDREN,
163 char* name = "splitterWindow");
164 %name(wxPreSplitterWindow)wxSplitterWindow();
166 bool Create(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");
173 // Gets the only or left/top pane
174 wxWindow *GetWindow1();
176 // Gets the right/bottom pane
177 wxWindow *GetWindow2();
179 // Sets the split mode
180 void SetSplitMode(int mode);
182 // Gets the split mode
185 // Initialize with one window
186 void Initialize(wxWindow *window);
188 // Associates the given window with window 2, drawing the appropriate sash
189 // and changing the split mode.
190 // Does nothing and returns FALSE if the window is already split.
191 // A sashPosition of 0 means choose a default sash position,
192 // negative sashPosition specifies the size of right/lower pane as it's
193 // absolute value rather than the size of left/upper pane.
194 virtual bool SplitVertically(wxWindow *window1,
196 int sashPosition = 0);
197 virtual bool SplitHorizontally(wxWindow *window1,
199 int sashPosition = 0);
201 // Removes the specified (or second) window from the view
202 // Doesn't actually delete the window.
203 bool Unsplit(wxWindow *toRemove = NULL);
205 // Replaces one of the windows with another one (neither old nor new
206 // parameter should be NULL)
207 bool ReplaceWindow(wxWindow *winOld, wxWindow *winNew);
209 // Is the window split?
212 // Sets the sash size
213 void SetSashSize(int width);
215 // Sets the border size
216 void SetBorderSize(int width);
218 // Gets the sash size
221 // Gets the border size
224 // Set the sash position
225 void SetSashPosition(int position, bool redraw = TRUE);
227 // Gets the sash position
228 int GetSashPosition();
230 // If this is zero, we can remove panes by dragging the sash.
231 void SetMinimumPaneSize(int min);
232 int GetMinimumPaneSize();
236 //---------------------------------------------------------------------------
242 wxEVT_TASKBAR_LEFT_DOWN,
243 wxEVT_TASKBAR_LEFT_UP,
244 wxEVT_TASKBAR_RIGHT_DOWN,
245 wxEVT_TASKBAR_RIGHT_UP,
246 wxEVT_TASKBAR_LEFT_DCLICK,
247 wxEVT_TASKBAR_RIGHT_DCLICK
251 class wxTaskBarIcon : public wxEvtHandler {
256 // We still use the magic methods here since that is the way it is documented...
257 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnMouseMove', wxEVT_TASKBAR_MOVE)"
258 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDown', wxEVT_TASKBAR_LEFT_DOWN)"
259 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonUp', wxEVT_TASKBAR_LEFT_UP)"
260 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDown', wxEVT_TASKBAR_RIGHT_DOWN)"
261 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonUp', wxEVT_TASKBAR_RIGHT_UP)"
262 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDClick',wxEVT_TASKBAR_LEFT_DCLICK)"
263 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDClick',wxEVT_TASKBAR_RIGHT_DCLICK)"
265 bool SetIcon(const wxIcon& icon, const char* tooltip = "");
266 bool RemoveIcon(void);
267 bool PopupMenu(wxMenu *menu);
268 bool IsIconInstalled();
273 //---------------------------------------------------------------------------