]>
Commit | Line | Data |
---|---|---|
1 | ////////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/aui/auibook.h | |
3 | // Purpose: wxaui: wx advanced user interface - notebook | |
4 | // Author: Benjamin I. Williams | |
5 | // Modified by: Jens Lody | |
6 | // Created: 2006-06-28 | |
7 | // Copyright: (C) Copyright 2006, Kirix Corporation, All Rights Reserved. | |
8 | // Licence: wxWindows Library Licence, Version 3.1 | |
9 | /////////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | ||
12 | ||
13 | #ifndef _WX_AUINOTEBOOK_H_ | |
14 | #define _WX_AUINOTEBOOK_H_ | |
15 | ||
16 | // ---------------------------------------------------------------------------- | |
17 | // headers | |
18 | // ---------------------------------------------------------------------------- | |
19 | ||
20 | #include "wx/defs.h" | |
21 | ||
22 | #if wxUSE_AUI | |
23 | ||
24 | #include "wx/aui/tabart.h" | |
25 | #include "wx/aui/framemanager.h" | |
26 | #include "wx/bookctrl.h" | |
27 | #include "wx/containr.h" | |
28 | ||
29 | ||
30 | class wxAuiNotebook; | |
31 | ||
32 | ||
33 | enum wxAuiNotebookOption | |
34 | { | |
35 | wxAUI_NB_TOP = 1 << 0, | |
36 | wxAUI_NB_LEFT = 1 << 1, // not implemented yet | |
37 | wxAUI_NB_RIGHT = 1 << 2, // not implemented yet | |
38 | wxAUI_NB_BOTTOM = 1 << 3, | |
39 | wxAUI_NB_TAB_SPLIT = 1 << 4, | |
40 | wxAUI_NB_TAB_MOVE = 1 << 5, | |
41 | wxAUI_NB_TAB_EXTERNAL_MOVE = 1 << 6, | |
42 | wxAUI_NB_TAB_FIXED_WIDTH = 1 << 7, | |
43 | wxAUI_NB_SCROLL_BUTTONS = 1 << 8, | |
44 | wxAUI_NB_WINDOWLIST_BUTTON = 1 << 9, | |
45 | wxAUI_NB_CLOSE_BUTTON = 1 << 10, | |
46 | wxAUI_NB_CLOSE_ON_ACTIVE_TAB = 1 << 11, | |
47 | wxAUI_NB_CLOSE_ON_ALL_TABS = 1 << 12, | |
48 | wxAUI_NB_MIDDLE_CLICK_CLOSE = 1 << 13, | |
49 | ||
50 | wxAUI_NB_DEFAULT_STYLE = wxAUI_NB_TOP | | |
51 | wxAUI_NB_TAB_SPLIT | | |
52 | wxAUI_NB_TAB_MOVE | | |
53 | wxAUI_NB_SCROLL_BUTTONS | | |
54 | wxAUI_NB_CLOSE_ON_ACTIVE_TAB | | |
55 | wxAUI_NB_MIDDLE_CLICK_CLOSE | |
56 | }; | |
57 | ||
58 | ||
59 | ||
60 | ||
61 | // aui notebook event class | |
62 | ||
63 | class WXDLLIMPEXP_AUI wxAuiNotebookEvent : public wxBookCtrlEvent | |
64 | { | |
65 | public: | |
66 | wxAuiNotebookEvent(wxEventType commandType = wxEVT_NULL, | |
67 | int winId = 0) | |
68 | : wxBookCtrlEvent(commandType, winId) | |
69 | { | |
70 | m_dragSource = NULL; | |
71 | } | |
72 | #ifndef SWIG | |
73 | wxAuiNotebookEvent(const wxAuiNotebookEvent& c) : wxBookCtrlEvent(c) | |
74 | { | |
75 | m_dragSource = c.m_dragSource; | |
76 | } | |
77 | #endif | |
78 | wxEvent *Clone() const { return new wxAuiNotebookEvent(*this); } | |
79 | ||
80 | void SetDragSource(wxAuiNotebook* s) { m_dragSource = s; } | |
81 | wxAuiNotebook* GetDragSource() const { return m_dragSource; } | |
82 | ||
83 | private: | |
84 | wxAuiNotebook* m_dragSource; | |
85 | ||
86 | #ifndef SWIG | |
87 | private: | |
88 | DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxAuiNotebookEvent) | |
89 | #endif | |
90 | }; | |
91 | ||
92 | ||
93 | class WXDLLIMPEXP_AUI wxAuiNotebookPage | |
94 | { | |
95 | public: | |
96 | wxWindow* window; // page's associated window | |
97 | wxString caption; // caption displayed on the tab | |
98 | wxString tooltip; // tooltip displayed when hovering over tab title | |
99 | wxBitmap bitmap; // tab's bitmap | |
100 | wxRect rect; // tab's hit rectangle | |
101 | bool active; // true if the page is currently active | |
102 | }; | |
103 | ||
104 | class WXDLLIMPEXP_AUI wxAuiTabContainerButton | |
105 | { | |
106 | public: | |
107 | ||
108 | int id; // button's id | |
109 | int curState; // current state (normal, hover, pressed, etc.) | |
110 | int location; // buttons location (wxLEFT, wxRIGHT, or wxCENTER) | |
111 | wxBitmap bitmap; // button's hover bitmap | |
112 | wxBitmap disBitmap; // button's disabled bitmap | |
113 | wxRect rect; // button's hit rectangle | |
114 | }; | |
115 | ||
116 | ||
117 | #ifndef SWIG | |
118 | WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiNotebookPage, wxAuiNotebookPageArray, WXDLLIMPEXP_AUI); | |
119 | WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiTabContainerButton, wxAuiTabContainerButtonArray, WXDLLIMPEXP_AUI); | |
120 | #endif | |
121 | ||
122 | ||
123 | class WXDLLIMPEXP_AUI wxAuiTabContainer | |
124 | { | |
125 | public: | |
126 | ||
127 | wxAuiTabContainer(); | |
128 | virtual ~wxAuiTabContainer(); | |
129 | ||
130 | void SetArtProvider(wxAuiTabArt* art); | |
131 | wxAuiTabArt* GetArtProvider() const; | |
132 | ||
133 | void SetFlags(unsigned int flags); | |
134 | unsigned int GetFlags() const; | |
135 | ||
136 | bool AddPage(wxWindow* page, const wxAuiNotebookPage& info); | |
137 | bool InsertPage(wxWindow* page, const wxAuiNotebookPage& info, size_t idx); | |
138 | bool MovePage(wxWindow* page, size_t newIdx); | |
139 | bool RemovePage(wxWindow* page); | |
140 | bool SetActivePage(wxWindow* page); | |
141 | bool SetActivePage(size_t page); | |
142 | void SetNoneActive(); | |
143 | int GetActivePage() const; | |
144 | bool TabHitTest(int x, int y, wxWindow** hit) const; | |
145 | bool ButtonHitTest(int x, int y, wxAuiTabContainerButton** hit) const; | |
146 | wxWindow* GetWindowFromIdx(size_t idx) const; | |
147 | int GetIdxFromWindow(wxWindow* page) const; | |
148 | size_t GetPageCount() const; | |
149 | wxAuiNotebookPage& GetPage(size_t idx); | |
150 | const wxAuiNotebookPage& GetPage(size_t idx) const; | |
151 | wxAuiNotebookPageArray& GetPages(); | |
152 | void SetNormalFont(const wxFont& normalFont); | |
153 | void SetSelectedFont(const wxFont& selectedFont); | |
154 | void SetMeasuringFont(const wxFont& measuringFont); | |
155 | void SetColour(const wxColour& colour); | |
156 | void SetActiveColour(const wxColour& colour); | |
157 | void DoShowHide(); | |
158 | void SetRect(const wxRect& rect); | |
159 | ||
160 | void RemoveButton(int id); | |
161 | void AddButton(int id, | |
162 | int location, | |
163 | const wxBitmap& normalBitmap = wxNullBitmap, | |
164 | const wxBitmap& disabledBitmap = wxNullBitmap); | |
165 | ||
166 | size_t GetTabOffset() const; | |
167 | void SetTabOffset(size_t offset); | |
168 | ||
169 | // Is the tab visible? | |
170 | bool IsTabVisible(int tabPage, int tabOffset, wxDC* dc, wxWindow* wnd); | |
171 | ||
172 | // Make the tab visible if it wasn't already | |
173 | void MakeTabVisible(int tabPage, wxWindow* win); | |
174 | ||
175 | protected: | |
176 | ||
177 | virtual void Render(wxDC* dc, wxWindow* wnd); | |
178 | ||
179 | protected: | |
180 | ||
181 | wxAuiTabArt* m_art; | |
182 | wxAuiNotebookPageArray m_pages; | |
183 | wxAuiTabContainerButtonArray m_buttons; | |
184 | wxAuiTabContainerButtonArray m_tabCloseButtons; | |
185 | wxRect m_rect; | |
186 | size_t m_tabOffset; | |
187 | unsigned int m_flags; | |
188 | }; | |
189 | ||
190 | ||
191 | ||
192 | class WXDLLIMPEXP_AUI wxAuiTabCtrl : public wxControl, | |
193 | public wxAuiTabContainer | |
194 | { | |
195 | public: | |
196 | ||
197 | wxAuiTabCtrl(wxWindow* parent, | |
198 | wxWindowID id = wxID_ANY, | |
199 | const wxPoint& pos = wxDefaultPosition, | |
200 | const wxSize& size = wxDefaultSize, | |
201 | long style = 0); | |
202 | ||
203 | ~wxAuiTabCtrl(); | |
204 | ||
205 | bool IsDragging() const { return m_isDragging; } | |
206 | ||
207 | protected: | |
208 | // choose the default border for this window | |
209 | virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } | |
210 | ||
211 | void OnPaint(wxPaintEvent& evt); | |
212 | void OnEraseBackground(wxEraseEvent& evt); | |
213 | void OnSize(wxSizeEvent& evt); | |
214 | void OnLeftDown(wxMouseEvent& evt); | |
215 | void OnLeftDClick(wxMouseEvent& evt); | |
216 | void OnLeftUp(wxMouseEvent& evt); | |
217 | void OnMiddleDown(wxMouseEvent& evt); | |
218 | void OnMiddleUp(wxMouseEvent& evt); | |
219 | void OnRightDown(wxMouseEvent& evt); | |
220 | void OnRightUp(wxMouseEvent& evt); | |
221 | void OnMotion(wxMouseEvent& evt); | |
222 | void OnLeaveWindow(wxMouseEvent& evt); | |
223 | void OnButton(wxAuiNotebookEvent& evt); | |
224 | void OnSetFocus(wxFocusEvent& event); | |
225 | void OnKillFocus(wxFocusEvent& event); | |
226 | void OnChar(wxKeyEvent& event); | |
227 | void OnCaptureLost(wxMouseCaptureLostEvent& evt); | |
228 | ||
229 | protected: | |
230 | ||
231 | wxPoint m_clickPt; | |
232 | wxWindow* m_clickTab; | |
233 | bool m_isDragging; | |
234 | wxAuiTabContainerButton* m_hoverButton; | |
235 | wxAuiTabContainerButton* m_pressedButton; | |
236 | ||
237 | #ifndef SWIG | |
238 | DECLARE_CLASS(wxAuiTabCtrl) | |
239 | DECLARE_EVENT_TABLE() | |
240 | #endif | |
241 | }; | |
242 | ||
243 | ||
244 | ||
245 | ||
246 | class WXDLLIMPEXP_AUI wxAuiNotebook : public wxNavigationEnabled<wxBookCtrlBase> | |
247 | { | |
248 | ||
249 | public: | |
250 | ||
251 | wxAuiNotebook() { Init(); } | |
252 | ||
253 | wxAuiNotebook(wxWindow* parent, | |
254 | wxWindowID id = wxID_ANY, | |
255 | const wxPoint& pos = wxDefaultPosition, | |
256 | const wxSize& size = wxDefaultSize, | |
257 | long style = wxAUI_NB_DEFAULT_STYLE) | |
258 | { | |
259 | Init(); | |
260 | Create(parent, id, pos, size, style); | |
261 | } | |
262 | ||
263 | virtual ~wxAuiNotebook(); | |
264 | ||
265 | bool Create(wxWindow* parent, | |
266 | wxWindowID id = wxID_ANY, | |
267 | const wxPoint& pos = wxDefaultPosition, | |
268 | const wxSize& size = wxDefaultSize, | |
269 | long style = 0); | |
270 | ||
271 | void SetWindowStyleFlag(long style); | |
272 | void SetArtProvider(wxAuiTabArt* art); | |
273 | wxAuiTabArt* GetArtProvider() const; | |
274 | ||
275 | virtual void SetUniformBitmapSize(const wxSize& size); | |
276 | virtual void SetTabCtrlHeight(int height); | |
277 | ||
278 | bool AddPage(wxWindow* page, | |
279 | const wxString& caption, | |
280 | bool select = false, | |
281 | const wxBitmap& bitmap = wxNullBitmap); | |
282 | ||
283 | bool InsertPage(size_t pageIdx, | |
284 | wxWindow* page, | |
285 | const wxString& caption, | |
286 | bool select = false, | |
287 | const wxBitmap& bitmap = wxNullBitmap); | |
288 | ||
289 | bool DeletePage(size_t page); | |
290 | bool RemovePage(size_t page); | |
291 | ||
292 | virtual size_t GetPageCount() const; | |
293 | virtual wxWindow* GetPage(size_t pageIdx) const; | |
294 | int GetPageIndex(wxWindow* pageWnd) const; | |
295 | ||
296 | bool SetPageText(size_t page, const wxString& text); | |
297 | wxString GetPageText(size_t pageIdx) const; | |
298 | ||
299 | bool SetPageToolTip(size_t page, const wxString& text); | |
300 | wxString GetPageToolTip(size_t pageIdx) const; | |
301 | ||
302 | bool SetPageBitmap(size_t page, const wxBitmap& bitmap); | |
303 | wxBitmap GetPageBitmap(size_t pageIdx) const; | |
304 | ||
305 | int SetSelection(size_t newPage); | |
306 | int GetSelection() const; | |
307 | ||
308 | virtual void Split(size_t page, int direction); | |
309 | ||
310 | const wxAuiManager& GetAuiManager() const { return m_mgr; } | |
311 | ||
312 | // Sets the normal font | |
313 | void SetNormalFont(const wxFont& font); | |
314 | ||
315 | // Sets the selected tab font | |
316 | void SetSelectedFont(const wxFont& font); | |
317 | ||
318 | // Sets the measuring font | |
319 | void SetMeasuringFont(const wxFont& font); | |
320 | ||
321 | // Sets the tab font | |
322 | virtual bool SetFont(const wxFont& font); | |
323 | ||
324 | // Gets the tab control height | |
325 | int GetTabCtrlHeight() const; | |
326 | ||
327 | // Gets the height of the notebook for a given page height | |
328 | int GetHeightForPageHeight(int pageHeight); | |
329 | ||
330 | // Shows the window menu | |
331 | bool ShowWindowMenu(); | |
332 | ||
333 | // we do have multiple pages | |
334 | virtual bool HasMultiplePages() const { return true; } | |
335 | ||
336 | // we don't want focus for ourselves | |
337 | // virtual bool AcceptsFocus() const { return false; } | |
338 | ||
339 | //wxBookCtrlBase functions | |
340 | ||
341 | virtual void SetPageSize (const wxSize &size); | |
342 | virtual int HitTest (const wxPoint &pt, long *flags=NULL) const; | |
343 | ||
344 | virtual int GetPageImage(size_t n) const; | |
345 | virtual bool SetPageImage(size_t n, int imageId); | |
346 | ||
347 | virtual int ChangeSelection(size_t n); | |
348 | ||
349 | virtual bool AddPage(wxWindow *page, const wxString &text, bool select, | |
350 | int imageId); | |
351 | virtual bool DeleteAllPages(); | |
352 | virtual bool InsertPage(size_t index, wxWindow *page, const wxString &text, | |
353 | bool select, int imageId); | |
354 | ||
355 | protected: | |
356 | // Common part of all ctors. | |
357 | void Init(); | |
358 | ||
359 | // choose the default border for this window | |
360 | virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } | |
361 | ||
362 | // Redo sizing after thawing | |
363 | virtual void DoThaw(); | |
364 | ||
365 | // these can be overridden | |
366 | ||
367 | // update the height, return true if it was done or false if the new height | |
368 | // calculated by CalculateTabCtrlHeight() is the same as the old one | |
369 | virtual bool UpdateTabCtrlHeight(); | |
370 | ||
371 | virtual int CalculateTabCtrlHeight(); | |
372 | virtual wxSize CalculateNewSplitSize(); | |
373 | ||
374 | // remove the page and return a pointer to it | |
375 | virtual wxWindow *DoRemovePage(size_t WXUNUSED(page)) { return NULL; } | |
376 | ||
377 | //A general selection function | |
378 | virtual int DoModifySelection(size_t n, bool events); | |
379 | ||
380 | protected: | |
381 | ||
382 | void DoSizing(); | |
383 | void InitNotebook(long style); | |
384 | wxAuiTabCtrl* GetTabCtrlFromPoint(const wxPoint& pt); | |
385 | wxWindow* GetTabFrameFromTabCtrl(wxWindow* tabCtrl); | |
386 | wxAuiTabCtrl* GetActiveTabCtrl(); | |
387 | bool FindTab(wxWindow* page, wxAuiTabCtrl** ctrl, int* idx); | |
388 | void RemoveEmptyTabFrames(); | |
389 | void UpdateHintWindowSize(); | |
390 | ||
391 | protected: | |
392 | ||
393 | void OnChildFocusNotebook(wxChildFocusEvent& evt); | |
394 | void OnRender(wxAuiManagerEvent& evt); | |
395 | void OnSize(wxSizeEvent& evt); | |
396 | void OnTabClicked(wxAuiNotebookEvent& evt); | |
397 | void OnTabBeginDrag(wxAuiNotebookEvent& evt); | |
398 | void OnTabDragMotion(wxAuiNotebookEvent& evt); | |
399 | void OnTabEndDrag(wxAuiNotebookEvent& evt); | |
400 | void OnTabCancelDrag(wxAuiNotebookEvent& evt); | |
401 | void OnTabButton(wxAuiNotebookEvent& evt); | |
402 | void OnTabMiddleDown(wxAuiNotebookEvent& evt); | |
403 | void OnTabMiddleUp(wxAuiNotebookEvent& evt); | |
404 | void OnTabRightDown(wxAuiNotebookEvent& evt); | |
405 | void OnTabRightUp(wxAuiNotebookEvent& evt); | |
406 | void OnTabBgDClick(wxAuiNotebookEvent& evt); | |
407 | void OnNavigationKeyNotebook(wxNavigationKeyEvent& event); | |
408 | ||
409 | // set selection to the given window (which must be non-NULL and be one of | |
410 | // our pages, otherwise an assert is raised) | |
411 | void SetSelectionToWindow(wxWindow *win); | |
412 | void SetSelectionToPage(const wxAuiNotebookPage& page) | |
413 | { | |
414 | SetSelectionToWindow(page.window); | |
415 | } | |
416 | ||
417 | protected: | |
418 | ||
419 | wxAuiManager m_mgr; | |
420 | wxAuiTabContainer m_tabs; | |
421 | int m_curPage; | |
422 | int m_tabIdCounter; | |
423 | wxWindow* m_dummyWnd; | |
424 | ||
425 | wxSize m_requestedBmpSize; | |
426 | int m_requestedTabCtrlHeight; | |
427 | wxFont m_selectedFont; | |
428 | wxFont m_normalFont; | |
429 | int m_tabCtrlHeight; | |
430 | ||
431 | int m_lastDragX; | |
432 | unsigned int m_flags; | |
433 | ||
434 | #ifndef SWIG | |
435 | DECLARE_CLASS(wxAuiNotebook) | |
436 | DECLARE_EVENT_TABLE() | |
437 | #endif | |
438 | }; | |
439 | ||
440 | ||
441 | ||
442 | ||
443 | // wx event machinery | |
444 | ||
445 | #ifndef SWIG | |
446 | ||
447 | wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEvent); | |
448 | wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEvent); | |
449 | wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, wxAuiNotebookEvent); | |
450 | wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, wxAuiNotebookEvent); | |
451 | wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_BUTTON, wxAuiNotebookEvent); | |
452 | wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, wxAuiNotebookEvent); | |
453 | wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, wxAuiNotebookEvent); | |
454 | wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, wxAuiNotebookEvent); | |
455 | wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, wxAuiNotebookEvent); | |
456 | wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, wxAuiNotebookEvent); | |
457 | wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, wxAuiNotebookEvent); | |
458 | wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, wxAuiNotebookEvent); | |
459 | wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, wxAuiNotebookEvent); | |
460 | wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, wxAuiNotebookEvent); | |
461 | wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, wxAuiNotebookEvent); | |
462 | ||
463 | typedef void (wxEvtHandler::*wxAuiNotebookEventFunction)(wxAuiNotebookEvent&); | |
464 | ||
465 | #define wxAuiNotebookEventHandler(func) \ | |
466 | wxEVENT_HANDLER_CAST(wxAuiNotebookEventFunction, func) | |
467 | ||
468 | #define EVT_AUINOTEBOOK_PAGE_CLOSE(winid, fn) \ | |
469 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, winid, wxAuiNotebookEventHandler(fn)) | |
470 | #define EVT_AUINOTEBOOK_PAGE_CLOSED(winid, fn) \ | |
471 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, winid, wxAuiNotebookEventHandler(fn)) | |
472 | #define EVT_AUINOTEBOOK_PAGE_CHANGED(winid, fn) \ | |
473 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, winid, wxAuiNotebookEventHandler(fn)) | |
474 | #define EVT_AUINOTEBOOK_PAGE_CHANGING(winid, fn) \ | |
475 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, winid, wxAuiNotebookEventHandler(fn)) | |
476 | #define EVT_AUINOTEBOOK_BUTTON(winid, fn) \ | |
477 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_BUTTON, winid, wxAuiNotebookEventHandler(fn)) | |
478 | #define EVT_AUINOTEBOOK_BEGIN_DRAG(winid, fn) \ | |
479 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, winid, wxAuiNotebookEventHandler(fn)) | |
480 | #define EVT_AUINOTEBOOK_END_DRAG(winid, fn) \ | |
481 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, winid, wxAuiNotebookEventHandler(fn)) | |
482 | #define EVT_AUINOTEBOOK_DRAG_MOTION(winid, fn) \ | |
483 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, winid, wxAuiNotebookEventHandler(fn)) | |
484 | #define EVT_AUINOTEBOOK_ALLOW_DND(winid, fn) \ | |
485 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, winid, wxAuiNotebookEventHandler(fn)) | |
486 | #define EVT_AUINOTEBOOK_DRAG_DONE(winid, fn) \ | |
487 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, winid, wxAuiNotebookEventHandler(fn)) | |
488 | #define EVT_AUINOTEBOOK_TAB_MIDDLE_DOWN(winid, fn) \ | |
489 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, winid, wxAuiNotebookEventHandler(fn)) | |
490 | #define EVT_AUINOTEBOOK_TAB_MIDDLE_UP(winid, fn) \ | |
491 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, winid, wxAuiNotebookEventHandler(fn)) | |
492 | #define EVT_AUINOTEBOOK_TAB_RIGHT_DOWN(winid, fn) \ | |
493 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, winid, wxAuiNotebookEventHandler(fn)) | |
494 | #define EVT_AUINOTEBOOK_TAB_RIGHT_UP(winid, fn) \ | |
495 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, winid, wxAuiNotebookEventHandler(fn)) | |
496 | #define EVT_AUINOTEBOOK_BG_DCLICK(winid, fn) \ | |
497 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, winid, wxAuiNotebookEventHandler(fn)) | |
498 | #else | |
499 | ||
500 | // wxpython/swig event work | |
501 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE; | |
502 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED; | |
503 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED; | |
504 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING; | |
505 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_BUTTON; | |
506 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG; | |
507 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_END_DRAG; | |
508 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION; | |
509 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND; | |
510 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE; | |
511 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN; | |
512 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP; | |
513 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN; | |
514 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP; | |
515 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK; | |
516 | ||
517 | %pythoncode { | |
518 | EVT_AUINOTEBOOK_PAGE_CLOSE = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, 1 ) | |
519 | EVT_AUINOTEBOOK_PAGE_CLOSED = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, 1 ) | |
520 | EVT_AUINOTEBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, 1 ) | |
521 | EVT_AUINOTEBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, 1 ) | |
522 | EVT_AUINOTEBOOK_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_BUTTON, 1 ) | |
523 | EVT_AUINOTEBOOK_BEGIN_DRAG = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, 1 ) | |
524 | EVT_AUINOTEBOOK_END_DRAG = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, 1 ) | |
525 | EVT_AUINOTEBOOK_DRAG_MOTION = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, 1 ) | |
526 | EVT_AUINOTEBOOK_ALLOW_DND = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, 1 ) | |
527 | EVT_AUINOTEBOOK_DRAG_DONE = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, 1 ) | |
528 | EVT__AUINOTEBOOK_TAB_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, 1 ) | |
529 | EVT__AUINOTEBOOK_TAB_MIDDLE_UP = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, 1 ) | |
530 | EVT__AUINOTEBOOK_TAB_RIGHT_DOWN = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, 1 ) | |
531 | EVT__AUINOTEBOOK_TAB_RIGHT_UP = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, 1 ) | |
532 | EVT_AUINOTEBOOK_BG_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, 1 ) | |
533 | } | |
534 | #endif | |
535 | ||
536 | ||
537 | #endif // wxUSE_AUI | |
538 | #endif // _WX_AUINOTEBOOK_H_ |