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