]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/cocoa/notebook.h | |
3 | // Purpose: wxNotebook class | |
4 | // Author: David Elliott | |
5 | // Modified by: | |
6 | // Created: 2004/04/08 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 2004 David Elliott | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_COCOA_NOTEBOOK_H__ | |
13 | #define _WX_COCOA_NOTEBOOK_H__ | |
14 | ||
15 | #include "wx/cocoa/NSTabView.h" | |
16 | ||
17 | // ======================================================================== | |
18 | // wxNotebook | |
19 | // ======================================================================== | |
20 | class WXDLLEXPORT wxNotebook: public wxNotebookBase, protected wxCocoaNSTabView | |
21 | { | |
22 | DECLARE_DYNAMIC_CLASS(wxNotebook) | |
23 | DECLARE_EVENT_TABLE() | |
24 | WX_DECLARE_COCOA_OWNER(NSTabView,NSView,NSView) | |
25 | // ------------------------------------------------------------------------ | |
26 | // initialization | |
27 | // ------------------------------------------------------------------------ | |
28 | public: | |
29 | wxNotebook() { } | |
30 | wxNotebook(wxWindow *parent, wxWindowID winid, | |
31 | const wxPoint& pos = wxDefaultPosition, | |
32 | const wxSize& size = wxDefaultSize, | |
33 | long style = 0, | |
34 | const wxString& name = wxNOTEBOOK_NAME) | |
35 | { | |
36 | Create(parent, winid, pos, size, style, name); | |
37 | } | |
38 | ||
39 | bool Create(wxWindow *parent, wxWindowID winid, | |
40 | const wxPoint& pos = wxDefaultPosition, | |
41 | const wxSize& size = wxDefaultSize, | |
42 | long style = 0, | |
43 | const wxString& name = wxNOTEBOOK_NAME); | |
44 | virtual ~wxNotebook(); | |
45 | ||
46 | // ------------------------------------------------------------------------ | |
47 | // Cocoa callbacks | |
48 | // ------------------------------------------------------------------------ | |
49 | protected: | |
50 | // Notebooks cannot be enabled/disabled | |
51 | virtual void CocoaSetEnabled(bool enable) { } | |
52 | virtual void CocoaDelegate_tabView_didSelectTabViewItem(WX_NSTabViewItem tabviewItem); | |
53 | virtual bool CocoaDelegate_tabView_shouldSelectTabViewItem(WX_NSTabViewItem tabviewItem); | |
54 | // ------------------------------------------------------------------------ | |
55 | // Implementation | |
56 | // ------------------------------------------------------------------------ | |
57 | public: | |
58 | // set the currently selected page, return the index of the previously | |
59 | // selected one (or -1 on error) | |
60 | // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events | |
61 | int SetSelection(size_t nPage); | |
62 | // get the currently selected page | |
63 | int GetSelection() const; | |
64 | ||
65 | // set/get the title of a page | |
66 | bool SetPageText(size_t nPage, const wxString& strText); | |
67 | wxString GetPageText(size_t nPage) const; | |
68 | ||
69 | // sets/returns item's image index in the current image list | |
70 | int GetPageImage(size_t nPage) const; | |
71 | bool SetPageImage(size_t nPage, int nImage); | |
72 | ||
73 | // set the size (the same for all pages) | |
74 | void SetPageSize(const wxSize& size); | |
75 | ||
76 | // SetPadding and SetTabSize aren't possible to implement | |
77 | void SetPadding(const wxSize& padding); | |
78 | void SetTabSize(const wxSize& sz); | |
79 | ||
80 | //----------------------- | |
81 | // adding/removing pages | |
82 | ||
83 | // remove one page from the notebook, without deleting | |
84 | virtual wxNotebookPage *DoRemovePage(size_t nPage); | |
85 | ||
86 | // remove one page from the notebook | |
87 | bool DeletePage(size_t nPage); | |
88 | // remove all pages | |
89 | bool DeleteAllPages(); | |
90 | ||
91 | // adds a new page to the notebook (it will be deleted ny the notebook, | |
92 | // don't delete it yourself). If bSelect, this page becomes active. | |
93 | // the same as AddPage(), but adds it at the specified position | |
94 | bool InsertPage( size_t position, | |
95 | wxNotebookPage *win, | |
96 | const wxString& strText, | |
97 | bool bSelect = FALSE, | |
98 | int imageId = -1 ); | |
99 | ||
100 | protected: | |
101 | }; | |
102 | ||
103 | #endif //ndef _WX_COCOA_NOTEBOOK_H__ |