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);
33 DECLARE_DEF_STRING(PanelNameStr);
35 static const wxChar* wxSplitterNameStr = wxT("splitter");
36 DECLARE_DEF_STRING(SplitterNameStr);
37 static const wxString wxPyEmptyString(wxT(""));
40 //----------------------------------------------------------------------
43 %include my_typemaps.i
45 // Import some definitions of other classes, etc.
53 %pragma(python) code = "import wx"
55 //---------------------------------------------------------------------------
58 /* notebook control event types */
59 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
60 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING,
64 class wxNotebookEvent : public wxNotifyEvent {
66 wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
67 int nSel = -1, int nOldSel = -1);
70 int GetOldSelection();
71 void SetOldSelection(int page);
72 void SetSelection(int page);
77 class wxNotebook : public wxControl {
79 wxNotebook(wxWindow *parent,
81 const wxPoint& pos = wxDefaultPosition,
82 const wxSize& size = wxDefaultSize,
84 const wxString& name = wxPyNOTEBOOK_NAME);
85 %name(wxPreNotebook)wxNotebook();
87 bool Create(wxWindow *parent,
89 const wxPoint& pos = wxDefaultPosition,
90 const wxSize& size = wxDefaultSize,
92 const wxString& name = wxPyNOTEBOOK_NAME);
94 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
95 %pragma(python) addtomethod = "wxPreNotebook:val._setOORInfo(val)"
98 int SetSelection(int nPage);
99 void AdvanceSelection(bool bForward = TRUE);
101 bool SetPageText(int nPage, const wxString& strText);
102 wxString GetPageText(int nPage) const;
104 void SetImageList(wxImageList* imageList);
105 void AssignImageList(wxImageList *imageList) ;
106 %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0"
108 wxImageList* GetImageList();
109 int GetPageImage(int nPage);
110 bool SetPageImage(int nPage, int nImage);
113 void SetPageSize(const wxSize& size);
114 void SetPadding(const wxSize& padding);
115 bool DeletePage(int nPage);
116 bool RemovePage(int nPage);
117 bool DeleteAllPages();
118 bool AddPage(/*wxNotebookPage*/ wxWindow *pPage,
119 const wxString& strText,
122 bool InsertPage(int nPage,
123 /*wxNotebookPage*/ wxWindow *pPage,
124 const wxString& strText,
125 bool bSelect = FALSE,
127 /*wxNotebookPage*/ wxWindow *GetPage(int nPage);
130 void ResizeChildren() {
131 wxSizeEvent evt(self->GetClientSize());
132 self->GetEventHandler()->ProcessEvent(evt);
139 //---------------------------------------------------------------------------
143 /* splitter window events */
144 wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING,
145 wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED,
146 wxEVT_COMMAND_SPLITTER_UNSPLIT,
147 wxEVT_COMMAND_SPLITTER_DOUBLECLICKED,
156 wxSPLIT_DRAG_DRAGGING,
157 wxSPLIT_DRAG_LEFT_DOWN
161 class wxSplitterEvent : public wxNotifyEvent {
163 wxSplitterEvent(wxEventType type = wxEVT_NULL,
164 wxSplitterWindow *splitter = NULL);
166 int GetSashPosition();
169 wxWindow* GetWindowBeingRemoved();
170 void SetSashPosition(int pos);
176 class wxSplitterWindow : public wxWindow {
178 wxSplitterWindow(wxWindow* parent, wxWindowID id,
179 const wxPoint& point = wxDefaultPosition,
180 const wxSize& size = wxDefaultSize,
181 long style=wxSP_3D|wxCLIP_CHILDREN,
182 const wxString& name = wxPySplitterNameStr);
183 %name(wxPreSplitterWindow)wxSplitterWindow();
185 bool Create(wxWindow* parent, wxWindowID id,
186 const wxPoint& point = wxDefaultPosition,
187 const wxSize& size = wxDefaultSize,
188 long style=wxSP_3D|wxCLIP_CHILDREN,
189 const wxString& name = wxPySplitterNameStr);
191 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
192 %pragma(python) addtomethod = "wxPreSplitterWindow:val._setOORInfo(val)"
194 // Gets the only or left/top pane
195 wxWindow *GetWindow1();
197 // Gets the right/bottom pane
198 wxWindow *GetWindow2();
200 // Sets the split mode
201 void SetSplitMode(int mode);
203 // Gets the split mode
206 // Initialize with one window
207 void Initialize(wxWindow *window);
209 // Associates the given window with window 2, drawing the appropriate sash
210 // and changing the split mode.
211 // Does nothing and returns FALSE if the window is already split.
212 // A sashPosition of 0 means choose a default sash position,
213 // negative sashPosition specifies the size of right/lower pane as it's
214 // absolute value rather than the size of left/upper pane.
215 virtual bool SplitVertically(wxWindow *window1,
217 int sashPosition = 0);
218 virtual bool SplitHorizontally(wxWindow *window1,
220 int sashPosition = 0);
222 // Removes the specified (or second) window from the view
223 // Doesn't actually delete the window.
224 bool Unsplit(wxWindow *toRemove = NULL);
226 // Replaces one of the windows with another one (neither old nor new
227 // parameter should be NULL)
228 bool ReplaceWindow(wxWindow *winOld, wxWindow *winNew);
230 // Is the window split?
233 // Sets the sash size
234 void SetSashSize(int width);
236 // Sets the border size
237 void SetBorderSize(int width);
239 // Gets the sash size
242 // Gets the border size
245 // Set the sash position
246 void SetSashPosition(int position, bool redraw = TRUE);
248 // Gets the sash position
249 int GetSashPosition();
251 // If this is zero, we can remove panes by dragging the sash.
252 void SetMinimumPaneSize(int min);
253 int GetMinimumPaneSize();
255 // Resizes subwindows
256 virtual void SizeWindows();
258 void SetNeedUpdating(bool needUpdating) { m_needUpdating = needUpdating; }
259 bool GetNeedUpdating() const { return m_needUpdating ; }
263 //---------------------------------------------------------------------------
269 wxEVT_TASKBAR_LEFT_DOWN,
270 wxEVT_TASKBAR_LEFT_UP,
271 wxEVT_TASKBAR_RIGHT_DOWN,
272 wxEVT_TASKBAR_RIGHT_UP,
273 wxEVT_TASKBAR_LEFT_DCLICK,
274 wxEVT_TASKBAR_RIGHT_DCLICK
278 class wxTaskBarIcon : public wxEvtHandler {
283 //%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
285 // We still use the magic methods here since that is the way it is documented...
286 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnMouseMove', wxEVT_TASKBAR_MOVE)"
287 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDown', wxEVT_TASKBAR_LEFT_DOWN)"
288 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonUp', wxEVT_TASKBAR_LEFT_UP)"
289 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDown', wxEVT_TASKBAR_RIGHT_DOWN)"
290 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonUp', wxEVT_TASKBAR_RIGHT_UP)"
291 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDClick',wxEVT_TASKBAR_LEFT_DCLICK)"
292 %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDClick',wxEVT_TASKBAR_RIGHT_DCLICK)"
294 bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxPyEmptyString);
295 bool RemoveIcon(void);
296 bool PopupMenu(wxMenu *menu);
297 bool IsIconInstalled();
302 //---------------------------------------------------------------------------
303 //---------------------------------------------------------------------------
304 // wxPyWindow derives from wxWindow and adds support for overriding many of
305 // the virtual methods in Python derived classes.
307 // Do wxPyControl too.
310 // class wxPyWindow : public wxWindow
312 // DECLARE_DYNAMIC_CLASS(wxPyWindow)
314 // wxPyWindow(wxWindow* parent, const wxWindowID id,
315 // const wxPoint& pos = wxDefaultPosition,
316 // const wxSize& size = wxDefaultSize,
318 // const wxString& name = wxPyPanelNameStr)
319 // : wxWindow(parent, id, pos, size, style, name) {}
322 // // Which of these should be done???
331 // GetClientAreaOrigin
334 // SetVirtualSizeHints
341 // AcceptsFocusFromKeyboard
348 // TransferDataToWindow
349 // TransferDataFromWindow
351 // SetBackgroundColour
352 // SetForegroundColour
372 //---------------------------------------------------------------------------