]>
Commit | Line | Data |
---|---|---|
a3219eea | 1 | /////////////////////////////////////////////////////////////////////////////// |
4444d148 | 2 | // Name: wx/aui/auibook.h |
a3219eea BW |
3 | // Purpose: wxaui: wx advanced user interface - notebook |
4 | // Author: Benjamin I. Williams | |
5 | // Modified by: | |
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" | |
a3219eea BW |
21 | |
22 | #if wxUSE_AUI | |
23 | ||
4444d148 WS |
24 | #include "wx/aui/framemanager.h" |
25 | #include "wx/aui/dockart.h" | |
26 | #include "wx/aui/floatpane.h" | |
4107600f | 27 | #include "wx/control.h" |
a3219eea BW |
28 | |
29 | ||
5d3aeb0f BW |
30 | class wxAuiNotebook; |
31 | ||
702b1c7e BW |
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, // not implemented yet | |
39 | wxAUI_NB_TAB_SPLIT = 1 << 4, | |
40 | wxAUI_NB_TAB_MOVE = 1 << 5, | |
5d3aeb0f | 41 | wxAUI_NB_TAB_EXTERNAL_MOVE = 1 << 6, |
b0d17f7c BW |
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, | |
5d3aeb0f | 48 | |
702b1c7e BW |
49 | |
50 | wxAUI_NB_DEFAULT_STYLE = wxAUI_NB_TOP | | |
51 | wxAUI_NB_TAB_SPLIT | | |
52 | wxAUI_NB_TAB_MOVE | | |
41b76acd BW |
53 | wxAUI_NB_SCROLL_BUTTONS | |
54 | wxAUI_NB_CLOSE_ON_ACTIVE_TAB | |
702b1c7e BW |
55 | }; |
56 | ||
3f69756e BW |
57 | |
58 | ||
702b1c7e | 59 | |
702b1c7e BW |
60 | // tab art class |
61 | ||
a3a5df9d | 62 | class WXDLLIMPEXP_AUI wxAuiTabArt |
3f69756e BW |
63 | { |
64 | public: | |
65 | ||
a3a5df9d BW |
66 | wxAuiTabArt() { } |
67 | virtual ~wxAuiTabArt() { } | |
a4c8fc23 | 68 | |
b0d17f7c BW |
69 | virtual wxAuiTabArt* Clone() = 0; |
70 | virtual void SetFlags(unsigned int flags) = 0; | |
71 | ||
72 | virtual void SetSizingInfo(const wxSize& tab_ctrl_size, | |
73 | size_t tab_count) = 0; | |
74 | ||
a4c8fc23 BW |
75 | virtual void SetNormalFont(const wxFont& font) = 0; |
76 | virtual void SetSelectedFont(const wxFont& font) = 0; | |
77 | virtual void SetMeasuringFont(const wxFont& font) = 0; | |
488e50ee | 78 | |
3f69756e | 79 | virtual void DrawBackground( |
a6b0e5bd | 80 | wxDC& dc, |
01372b8f | 81 | wxWindow* wnd, |
3f69756e BW |
82 | const wxRect& rect) = 0; |
83 | ||
a6b0e5bd | 84 | virtual void DrawTab(wxDC& dc, |
01372b8f | 85 | wxWindow* wnd, |
3f69756e BW |
86 | const wxRect& in_rect, |
87 | const wxString& caption, | |
88 | bool active, | |
41b76acd BW |
89 | int close_button_state, |
90 | wxRect* out_tab_rect, | |
91 | wxRect* out_button_rect, | |
3f69756e | 92 | int* x_extent) = 0; |
4953f8cf BW |
93 | |
94 | virtual void DrawButton( | |
a6b0e5bd | 95 | wxDC& dc, |
01372b8f | 96 | wxWindow* wnd, |
4953f8cf BW |
97 | const wxRect& in_rect, |
98 | int bitmap_id, | |
99 | int button_state, | |
100 | int orientation, | |
101 | const wxBitmap& bitmap_override, | |
102 | wxRect* out_rect) = 0; | |
b0d17f7c BW |
103 | |
104 | virtual int GetIndentSize() = 0; | |
105 | ||
4953f8cf | 106 | virtual wxSize GetTabSize( |
a6b0e5bd | 107 | wxDC& dc, |
01372b8f | 108 | wxWindow* wnd, |
4953f8cf BW |
109 | const wxString& caption, |
110 | bool active, | |
41b76acd | 111 | int close_button_state, |
4953f8cf | 112 | int* x_extent) = 0; |
a6b0e5bd BW |
113 | |
114 | virtual int ShowWindowList( | |
115 | wxWindow* wnd, | |
116 | const wxArrayString& items, | |
117 | int active_idx) = 0; | |
01372b8f BW |
118 | |
119 | virtual int GetBestTabCtrlSize(wxWindow* wnd) = 0; | |
3f69756e BW |
120 | }; |
121 | ||
122 | ||
b0d17f7c BW |
123 | class WXDLLIMPEXP_AUI wxAuiSimpleTabArt : public wxAuiTabArt |
124 | { | |
125 | ||
126 | public: | |
127 | ||
128 | wxAuiSimpleTabArt(); | |
129 | virtual ~wxAuiSimpleTabArt(); | |
130 | ||
131 | wxAuiTabArt* Clone(); | |
132 | void SetFlags(unsigned int flags); | |
133 | ||
134 | void SetSizingInfo(const wxSize& tab_ctrl_size, | |
135 | size_t tab_count); | |
136 | ||
137 | void SetNormalFont(const wxFont& font); | |
138 | void SetSelectedFont(const wxFont& font); | |
139 | void SetMeasuringFont(const wxFont& font); | |
140 | ||
141 | void DrawBackground( | |
142 | wxDC& dc, | |
143 | wxWindow* wnd, | |
144 | const wxRect& rect); | |
145 | ||
146 | void DrawTab(wxDC& dc, | |
147 | wxWindow* wnd, | |
148 | const wxRect& in_rect, | |
149 | const wxString& caption, | |
150 | bool active, | |
151 | int close_button_state, | |
152 | wxRect* out_tab_rect, | |
153 | wxRect* out_button_rect, | |
154 | int* x_extent); | |
155 | ||
156 | void DrawButton( | |
157 | wxDC& dc, | |
158 | wxWindow* wnd, | |
159 | const wxRect& in_rect, | |
160 | int bitmap_id, | |
161 | int button_state, | |
162 | int orientation, | |
163 | const wxBitmap& bitmap_override, | |
164 | wxRect* out_rect); | |
165 | ||
166 | int GetIndentSize(); | |
167 | ||
168 | wxSize GetTabSize( | |
169 | wxDC& dc, | |
170 | wxWindow* wnd, | |
171 | const wxString& caption, | |
172 | bool active, | |
173 | int close_button_state, | |
174 | int* x_extent); | |
175 | ||
176 | int ShowWindowList( | |
177 | wxWindow* wnd, | |
178 | const wxArrayString& items, | |
179 | int active_idx); | |
180 | ||
181 | int GetBestTabCtrlSize(wxWindow* wnd); | |
182 | ||
183 | private: | |
184 | ||
185 | wxFont m_normal_font; | |
186 | wxFont m_selected_font; | |
187 | wxFont m_measuring_font; | |
188 | wxPen m_normal_bkpen; | |
189 | wxPen m_selected_bkpen; | |
190 | wxBrush m_normal_bkbrush; | |
191 | wxBrush m_selected_bkbrush; | |
192 | wxBrush m_bkbrush; | |
193 | wxBitmap m_active_close_bmp; | |
194 | wxBitmap m_disabled_close_bmp; | |
195 | wxBitmap m_active_left_bmp; | |
196 | wxBitmap m_disabled_left_bmp; | |
197 | wxBitmap m_active_right_bmp; | |
198 | wxBitmap m_disabled_right_bmp; | |
199 | wxBitmap m_active_windowlist_bmp; | |
200 | wxBitmap m_disabled_windowlist_bmp; | |
201 | ||
202 | int m_fixed_tab_width; | |
203 | unsigned int m_flags; | |
204 | }; | |
205 | ||
206 | ||
a3a5df9d | 207 | class WXDLLIMPEXP_AUI wxAuiDefaultTabArt : public wxAuiTabArt |
3f69756e BW |
208 | { |
209 | ||
210 | public: | |
211 | ||
a3a5df9d BW |
212 | wxAuiDefaultTabArt(); |
213 | virtual ~wxAuiDefaultTabArt(); | |
3f69756e | 214 | |
b0d17f7c BW |
215 | wxAuiTabArt* Clone(); |
216 | void SetFlags(unsigned int flags); | |
217 | void SetSizingInfo(const wxSize& tab_ctrl_size, | |
218 | size_t tab_count); | |
219 | ||
a4c8fc23 BW |
220 | void SetNormalFont(const wxFont& font); |
221 | void SetSelectedFont(const wxFont& font); | |
222 | void SetMeasuringFont(const wxFont& font); | |
b0d17f7c | 223 | |
3f69756e | 224 | void DrawBackground( |
a6b0e5bd | 225 | wxDC& dc, |
01372b8f | 226 | wxWindow* wnd, |
3f69756e | 227 | const wxRect& rect); |
b0d17f7c | 228 | |
a6b0e5bd | 229 | void DrawTab(wxDC& dc, |
01372b8f | 230 | wxWindow* wnd, |
3f69756e BW |
231 | const wxRect& in_rect, |
232 | const wxString& caption, | |
233 | bool active, | |
41b76acd BW |
234 | int close_button_state, |
235 | wxRect* out_tab_rect, | |
236 | wxRect* out_button_rect, | |
3f69756e | 237 | int* x_extent); |
4953f8cf BW |
238 | |
239 | void DrawButton( | |
a6b0e5bd | 240 | wxDC& dc, |
01372b8f | 241 | wxWindow* wnd, |
4953f8cf BW |
242 | const wxRect& in_rect, |
243 | int bitmap_id, | |
244 | int button_state, | |
245 | int orientation, | |
246 | const wxBitmap& bitmap_override, | |
247 | wxRect* out_rect); | |
b0d17f7c BW |
248 | |
249 | int GetIndentSize(); | |
a6b0e5bd | 250 | |
4953f8cf | 251 | wxSize GetTabSize( |
a6b0e5bd | 252 | wxDC& dc, |
01372b8f | 253 | wxWindow* wnd, |
4953f8cf BW |
254 | const wxString& caption, |
255 | bool active, | |
41b76acd | 256 | int close_button_state, |
4953f8cf | 257 | int* x_extent); |
a6b0e5bd BW |
258 | |
259 | int ShowWindowList( | |
260 | wxWindow* wnd, | |
261 | const wxArrayString& items, | |
262 | int active_idx); | |
263 | ||
01372b8f | 264 | int GetBestTabCtrlSize(wxWindow* wnd); |
a4c8fc23 | 265 | |
3f69756e BW |
266 | private: |
267 | ||
268 | wxFont m_normal_font; | |
269 | wxFont m_selected_font; | |
270 | wxFont m_measuring_font; | |
271 | wxPen m_normal_bkpen; | |
272 | wxPen m_selected_bkpen; | |
273 | wxBrush m_normal_bkbrush; | |
274 | wxBrush m_selected_bkbrush; | |
275 | wxBrush m_bkbrush; | |
4953f8cf BW |
276 | wxBitmap m_active_close_bmp; |
277 | wxBitmap m_disabled_close_bmp; | |
278 | wxBitmap m_active_left_bmp; | |
279 | wxBitmap m_disabled_left_bmp; | |
280 | wxBitmap m_active_right_bmp; | |
281 | wxBitmap m_disabled_right_bmp; | |
01372b8f BW |
282 | wxBitmap m_active_windowlist_bmp; |
283 | wxBitmap m_disabled_windowlist_bmp; | |
b0d17f7c BW |
284 | |
285 | int m_fixed_tab_width; | |
286 | unsigned int m_flags; | |
3f69756e BW |
287 | }; |
288 | ||
289 | ||
290 | ||
b0d17f7c | 291 | |
a3219eea BW |
292 | // event declarations/classes |
293 | ||
294 | class WXDLLIMPEXP_AUI wxAuiNotebookEvent : public wxNotifyEvent | |
295 | { | |
296 | public: | |
297 | wxAuiNotebookEvent(wxEventType command_type = wxEVT_NULL, | |
298 | int win_id = 0) | |
299 | : wxNotifyEvent(command_type, win_id) | |
300 | { | |
5d3aeb0f BW |
301 | old_selection = -1; |
302 | selection = -1; | |
303 | drag_source = NULL; | |
a3219eea BW |
304 | } |
305 | #ifndef SWIG | |
306 | wxAuiNotebookEvent(const wxAuiNotebookEvent& c) : wxNotifyEvent(c) | |
307 | { | |
308 | old_selection = c.old_selection; | |
309 | selection = c.selection; | |
5d3aeb0f | 310 | drag_source = c.drag_source; |
a3219eea BW |
311 | } |
312 | #endif | |
313 | wxEvent *Clone() const { return new wxAuiNotebookEvent(*this); } | |
314 | ||
08c068a4 | 315 | void SetSelection(int s) { selection = s; m_commandInt = s; } |
a3219eea | 316 | int GetSelection() const { return selection; } |
5d3aeb0f BW |
317 | |
318 | void SetOldSelection(int s) { old_selection = s; } | |
a3219eea | 319 | int GetOldSelection() const { return old_selection; } |
5d3aeb0f BW |
320 | |
321 | void SetDragSource(wxAuiNotebook* s) { drag_source = s; } | |
322 | wxAuiNotebook* GetDragSource() const { return drag_source; } | |
4444d148 | 323 | |
a3219eea BW |
324 | public: |
325 | int old_selection; | |
326 | int selection; | |
5d3aeb0f | 327 | wxAuiNotebook* drag_source; |
4444d148 | 328 | |
a3219eea BW |
329 | #ifndef SWIG |
330 | private: | |
331 | DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxAuiNotebookEvent) | |
332 | #endif | |
333 | }; | |
334 | ||
335 | ||
336 | ||
337 | ||
338 | ||
339 | class WXDLLIMPEXP_AUI wxAuiNotebookPage | |
340 | { | |
341 | public: | |
342 | wxWindow* window; // page's associated window | |
343 | wxString caption; // caption displayed on the tab | |
344 | wxBitmap bitmap; // tab's bitmap | |
345 | wxRect rect; // tab's hit rectangle | |
346 | bool active; // true if the page is currently active | |
347 | }; | |
348 | ||
349 | class WXDLLIMPEXP_AUI wxAuiTabContainerButton | |
350 | { | |
351 | public: | |
41b76acd | 352 | |
a3219eea | 353 | int id; // button's id |
4953f8cf | 354 | int cur_state; // current state (normal, hover, pressed, etc.) |
41b76acd | 355 | int location; // buttons location (wxLEFT, wxRIGHT, or wxCENTER) |
4953f8cf BW |
356 | wxBitmap bitmap; // button's hover bitmap |
357 | wxBitmap dis_bitmap; // button's disabled bitmap | |
a3219eea BW |
358 | wxRect rect; // button's hit rectangle |
359 | }; | |
360 | ||
361 | ||
d91fa282 | 362 | #ifndef SWIG |
a3219eea BW |
363 | WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiNotebookPage, wxAuiNotebookPageArray, WXDLLIMPEXP_AUI); |
364 | WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiTabContainerButton, wxAuiTabContainerButtonArray, WXDLLIMPEXP_AUI); | |
d91fa282 | 365 | #endif |
a3219eea BW |
366 | |
367 | ||
368 | class WXDLLIMPEXP_AUI wxAuiTabContainer | |
369 | { | |
370 | public: | |
371 | ||
372 | wxAuiTabContainer(); | |
9fabaac4 | 373 | virtual ~wxAuiTabContainer(); |
a3219eea | 374 | |
a3a5df9d BW |
375 | void SetArtProvider(wxAuiTabArt* art); |
376 | wxAuiTabArt* GetArtProvider(); | |
3f69756e | 377 | |
702b1c7e BW |
378 | void SetFlags(unsigned int flags); |
379 | unsigned int GetFlags() const; | |
380 | ||
a3219eea BW |
381 | bool AddPage(wxWindow* page, const wxAuiNotebookPage& info); |
382 | bool InsertPage(wxWindow* page, const wxAuiNotebookPage& info, size_t idx); | |
2fadbbfd | 383 | bool MovePage(wxWindow* page, size_t new_idx); |
a3219eea BW |
384 | bool RemovePage(wxWindow* page); |
385 | bool SetActivePage(wxWindow* page); | |
386 | bool SetActivePage(size_t page); | |
387 | void SetNoneActive(); | |
388 | int GetActivePage() const; | |
389 | bool TabHitTest(int x, int y, wxWindow** hit) const; | |
390 | bool ButtonHitTest(int x, int y, wxAuiTabContainerButton** hit) const; | |
391 | wxWindow* GetWindowFromIdx(size_t idx) const; | |
392 | int GetIdxFromWindow(wxWindow* page) const; | |
393 | size_t GetPageCount() const; | |
394 | wxAuiNotebookPage& GetPage(size_t idx); | |
395 | wxAuiNotebookPageArray& GetPages(); | |
396 | void SetNormalFont(const wxFont& normal_font); | |
397 | void SetSelectedFont(const wxFont& selected_font); | |
398 | void SetMeasuringFont(const wxFont& measuring_font); | |
399 | void DoShowHide(); | |
400 | void SetRect(const wxRect& rect); | |
41b76acd BW |
401 | |
402 | void RemoveButton(int id); | |
4953f8cf BW |
403 | void AddButton(int id, |
404 | int location, | |
405 | const wxBitmap& normal_bitmap = wxNullBitmap, | |
406 | const wxBitmap& disabled_bitmap = wxNullBitmap); | |
4444d148 | 407 | |
4953f8cf BW |
408 | size_t GetTabOffset() const; |
409 | void SetTabOffset(size_t offset); | |
410 | ||
a3219eea BW |
411 | protected: |
412 | ||
01372b8f | 413 | virtual void Render(wxDC* dc, wxWindow* wnd); |
a3219eea | 414 | |
01372b8f | 415 | protected: |
a3219eea | 416 | |
a3a5df9d | 417 | wxAuiTabArt* m_art; |
a3219eea BW |
418 | wxAuiNotebookPageArray m_pages; |
419 | wxAuiTabContainerButtonArray m_buttons; | |
41b76acd | 420 | wxAuiTabContainerButtonArray m_tab_close_buttons; |
a3219eea | 421 | wxRect m_rect; |
4953f8cf | 422 | size_t m_tab_offset; |
702b1c7e | 423 | unsigned int m_flags; |
a3219eea BW |
424 | }; |
425 | ||
426 | ||
427 | ||
428 | class WXDLLIMPEXP_AUI wxAuiTabCtrl : public wxControl, | |
429 | public wxAuiTabContainer | |
430 | { | |
431 | public: | |
432 | ||
433 | wxAuiTabCtrl(wxWindow* parent, | |
d91fa282 | 434 | wxWindowID id = wxID_ANY, |
a3219eea BW |
435 | const wxPoint& pos = wxDefaultPosition, |
436 | const wxSize& size = wxDefaultSize, | |
437 | long style = 0); | |
4444d148 | 438 | |
26da5e4f BW |
439 | ~wxAuiTabCtrl(); |
440 | ||
a3219eea BW |
441 | protected: |
442 | ||
443 | void OnPaint(wxPaintEvent& evt); | |
444 | void OnEraseBackground(wxEraseEvent& evt); | |
445 | void OnSize(wxSizeEvent& evt); | |
446 | void OnLeftDown(wxMouseEvent& evt); | |
447 | void OnLeftUp(wxMouseEvent& evt); | |
448 | void OnMotion(wxMouseEvent& evt); | |
449 | void OnLeaveWindow(wxMouseEvent& evt); | |
4953f8cf | 450 | void OnButton(wxAuiNotebookEvent& evt); |
4444d148 | 451 | |
4953f8cf | 452 | |
a3219eea | 453 | protected: |
4444d148 | 454 | |
a3219eea | 455 | wxPoint m_click_pt; |
08c068a4 | 456 | wxWindow* m_click_tab; |
a3219eea BW |
457 | bool m_is_dragging; |
458 | wxAuiTabContainerButton* m_hover_button; | |
459 | ||
d91fa282 | 460 | #ifndef SWIG |
5d3aeb0f | 461 | DECLARE_CLASS(wxAuiTabCtrl) |
a3219eea | 462 | DECLARE_EVENT_TABLE() |
d91fa282 | 463 | #endif |
a3219eea BW |
464 | }; |
465 | ||
466 | ||
467 | ||
468 | ||
a3a5df9d | 469 | class WXDLLIMPEXP_AUI wxAuiNotebook : public wxControl |
a3219eea BW |
470 | { |
471 | ||
472 | public: | |
473 | ||
a3a5df9d | 474 | wxAuiNotebook(); |
4444d148 | 475 | |
a3a5df9d | 476 | wxAuiNotebook(wxWindow* parent, |
0ce53f32 BW |
477 | wxWindowID id = wxID_ANY, |
478 | const wxPoint& pos = wxDefaultPosition, | |
479 | const wxSize& size = wxDefaultSize, | |
480 | long style = wxAUI_NB_DEFAULT_STYLE); | |
4444d148 | 481 | |
a3a5df9d | 482 | virtual ~wxAuiNotebook(); |
a3219eea BW |
483 | |
484 | bool Create(wxWindow* parent, | |
d91fa282 | 485 | wxWindowID id = wxID_ANY, |
a3219eea BW |
486 | const wxPoint& pos = wxDefaultPosition, |
487 | const wxSize& size = wxDefaultSize, | |
4444d148 | 488 | long style = 0); |
a3219eea BW |
489 | |
490 | bool AddPage(wxWindow* page, | |
491 | const wxString& caption, | |
492 | bool select = false, | |
493 | const wxBitmap& bitmap = wxNullBitmap); | |
4444d148 | 494 | |
a3219eea BW |
495 | bool InsertPage(size_t page_idx, |
496 | wxWindow* page, | |
497 | const wxString& caption, | |
498 | bool select = false, | |
499 | const wxBitmap& bitmap = wxNullBitmap); | |
4444d148 | 500 | |
a3219eea BW |
501 | bool DeletePage(size_t page); |
502 | bool RemovePage(size_t page); | |
0ce53f32 BW |
503 | |
504 | void SetWindowStyleFlag(long style); | |
4444d148 | 505 | |
a3219eea BW |
506 | bool SetPageText(size_t page, const wxString& text); |
507 | size_t SetSelection(size_t new_page); | |
508 | int GetSelection() const; | |
509 | size_t GetPageCount() const; | |
510 | wxWindow* GetPage(size_t page_idx) const; | |
4444d148 | 511 | |
0ce53f32 | 512 | |
a3a5df9d BW |
513 | void SetArtProvider(wxAuiTabArt* art); |
514 | wxAuiTabArt* GetArtProvider(); | |
3f69756e | 515 | |
a3219eea | 516 | protected: |
4444d148 | 517 | |
a3219eea BW |
518 | wxAuiTabCtrl* GetTabCtrlFromPoint(const wxPoint& pt); |
519 | wxWindow* GetTabFrameFromTabCtrl(wxWindow* tab_ctrl); | |
520 | wxAuiTabCtrl* GetActiveTabCtrl(); | |
521 | bool FindTab(wxWindow* page, wxAuiTabCtrl** ctrl, int* idx); | |
522 | void RemoveEmptyTabFrames(); | |
4444d148 | 523 | |
a3219eea BW |
524 | protected: |
525 | ||
526 | void DoSizing(); | |
702b1c7e | 527 | void InitNotebook(long style); |
4444d148 | 528 | |
a3219eea | 529 | void OnChildFocus(wxChildFocusEvent& evt); |
a3a5df9d | 530 | void OnRender(wxAuiManagerEvent& evt); |
a3219eea BW |
531 | void OnEraseBackground(wxEraseEvent& evt); |
532 | void OnSize(wxSizeEvent& evt); | |
533 | void OnTabClicked(wxCommandEvent& evt); | |
534 | void OnTabBeginDrag(wxCommandEvent& evt); | |
535 | void OnTabDragMotion(wxCommandEvent& evt); | |
536 | void OnTabEndDrag(wxCommandEvent& evt); | |
537 | void OnTabButton(wxCommandEvent& evt); | |
4953f8cf | 538 | |
a3219eea BW |
539 | protected: |
540 | ||
a3a5df9d | 541 | wxAuiManager m_mgr; |
a3219eea BW |
542 | wxAuiTabContainer m_tabs; |
543 | int m_curpage; | |
544 | int m_tab_id_counter; | |
545 | wxWindow* m_dummy_wnd; | |
4444d148 | 546 | |
a3219eea BW |
547 | wxFont m_selected_font; |
548 | wxFont m_normal_font; | |
da5e85d9 | 549 | int m_tab_ctrl_height; |
08c068a4 BW |
550 | |
551 | int m_last_drag_x; | |
702b1c7e | 552 | unsigned int m_flags; |
4444d148 | 553 | |
d91fa282 | 554 | #ifndef SWIG |
0ce53f32 | 555 | DECLARE_CLASS(wxAuiNotebook) |
a3219eea | 556 | DECLARE_EVENT_TABLE() |
d91fa282 | 557 | #endif |
a3219eea BW |
558 | }; |
559 | ||
560 | ||
561 | ||
562 | ||
563 | // wx event machinery | |
564 | ||
565 | #ifndef SWIG | |
566 | ||
567 | BEGIN_DECLARE_EVENT_TYPES() | |
3fd8c988 | 568 | DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, 0) |
a3219eea BW |
569 | DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, 0) |
570 | DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, 0) | |
571 | DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_BUTTON, 0) | |
572 | DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, 0) | |
573 | DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, 0) | |
574 | DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, 0) | |
5d3aeb0f | 575 | DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, 0) |
a3219eea BW |
576 | END_DECLARE_EVENT_TYPES() |
577 | ||
578 | typedef void (wxEvtHandler::*wxAuiNotebookEventFunction)(wxAuiNotebookEvent&); | |
579 | ||
580 | #define wxAuiNotebookEventHandler(func) \ | |
581 | (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxAuiNotebookEventFunction, &func) | |
3fd8c988 BW |
582 | |
583 | #define EVT_AUINOTEBOOK_PAGE_CLOSE(winid, fn) \ | |
584 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, winid, wxAuiNotebookEventHandler(fn)) | |
a3219eea BW |
585 | #define EVT_AUINOTEBOOK_PAGE_CHANGED(winid, fn) \ |
586 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, winid, wxAuiNotebookEventHandler(fn)) | |
587 | #define EVT_AUINOTEBOOK_PAGE_CHANGING(winid, fn) \ | |
588 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, winid, wxAuiNotebookEventHandler(fn)) | |
4953f8cf | 589 | #define EVT_AUINOTEBOOK_BUTTON(winid, fn) \ |
a3219eea BW |
590 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_BUTTON, winid, wxAuiNotebookEventHandler(fn)) |
591 | #define EVT_AUINOTEBOOK_BEGIN_DRAG(winid, fn) \ | |
592 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, winid, wxAuiNotebookEventHandler(fn)) | |
593 | #define EVT_AUINOTEBOOK_END_DRAG(winid, fn) \ | |
594 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, winid, wxAuiNotebookEventHandler(fn)) | |
595 | #define EVT_AUINOTEBOOK_DRAG_MOTION(winid, fn) \ | |
596 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, winid, wxAuiNotebookEventHandler(fn)) | |
5d3aeb0f BW |
597 | #define EVT_AUINOTEBOOK_ALLOW_DND(winid, fn) \ |
598 | wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, winid, wxAuiNotebookEventHandler(fn)) | |
4444d148 | 599 | |
a3219eea BW |
600 | #else |
601 | ||
602 | // wxpython/swig event work | |
3fd8c988 | 603 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE; |
d91fa282 RD |
604 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED; |
605 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING; | |
606 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_BUTTON; | |
607 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG; | |
608 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_END_DRAG; | |
609 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION; | |
5d3aeb0f | 610 | %constant wxEventType wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND; |
d91fa282 RD |
611 | |
612 | %pythoncode { | |
3fd8c988 | 613 | EVT_AUINOTEBOOK_PAGE_CLOSE = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, 1 ) |
d91fa282 RD |
614 | EVT_AUINOTEBOOK_PAGE_CHANGED = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, 1 ) |
615 | EVT_AUINOTEBOOK_PAGE_CHANGING = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, 1 ) | |
616 | EVT_AUINOTEBOOK_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_BUTTON, 1 ) | |
617 | EVT_AUINOTEBOOK_BEGIN_DRAG = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, 1 ) | |
618 | EVT_AUINOTEBOOK_END_DRAG = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, 1 ) | |
4444d148 | 619 | EVT_AUINOTEBOOK_DRAG_MOTION = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, 1 ) |
5d3aeb0f | 620 | EVT_AUINOTEBOOK_ALLOW_DND = wx.PyEventBinder( wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, 1 ) |
d91fa282 | 621 | } |
a3219eea BW |
622 | #endif |
623 | ||
624 | ||
625 | #endif // wxUSE_AUI | |
626 | #endif // _WX_AUINOTEBOOK_H_ |