1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/notebook.h
3 // Purpose: wxNotebook class
4 // Author: David Elliott
8 // Copyright: (c) 2004 David Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_COCOA_NOTEBOOK_H__
13 #define _WX_COCOA_NOTEBOOK_H__
15 #include "wx/cocoa/NSTabView.h"
17 // ========================================================================
19 // ========================================================================
20 class WXDLLEXPORT wxNotebook
: public wxNotebookBase
, protected wxCocoaNSTabView
22 DECLARE_DYNAMIC_CLASS(wxNotebook
)
24 WX_DECLARE_COCOA_OWNER(NSTabView
,NSView
,NSView
)
25 // ------------------------------------------------------------------------
27 // ------------------------------------------------------------------------
30 wxNotebook(wxWindow
*parent
, wxWindowID winid
,
31 const wxPoint
& pos
= wxDefaultPosition
,
32 const wxSize
& size
= wxDefaultSize
,
34 const wxString
& name
= wxNOTEBOOK_NAME
)
36 Create(parent
, winid
, pos
, size
, style
, name
);
39 bool Create(wxWindow
*parent
, wxWindowID winid
,
40 const wxPoint
& pos
= wxDefaultPosition
,
41 const wxSize
& size
= wxDefaultSize
,
43 const wxString
& name
= wxNOTEBOOK_NAME
);
44 virtual ~wxNotebook();
46 // ------------------------------------------------------------------------
48 // ------------------------------------------------------------------------
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 // ------------------------------------------------------------------------
56 // ------------------------------------------------------------------------
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;
65 // set/get the title of a page
66 bool SetPageText(size_t nPage
, const wxString
& strText
);
67 wxString
GetPageText(size_t nPage
) const;
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
);
73 // set the size (the same for all pages)
74 void SetPageSize(const wxSize
& size
);
76 // SetPadding and SetTabSize aren't possible to implement
77 void SetPadding(const wxSize
& padding
);
78 void SetTabSize(const wxSize
& sz
);
80 //-----------------------
81 // adding/removing pages
83 // remove one page from the notebook, without deleting
84 virtual wxNotebookPage
*DoRemovePage(size_t nPage
);
86 // remove one page from the notebook
87 bool DeletePage(size_t nPage
);
89 bool DeleteAllPages();
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
,
96 const wxString
& strText
,
103 #endif //ndef _WX_COCOA_NOTEBOOK_H__