1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/notebook.h
3 // Purpose: wxNotebook class
4 // Author: David Elliott
7 // Copyright: (c) 2004 David Elliott
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_COCOA_NOTEBOOK_H__
12 #define _WX_COCOA_NOTEBOOK_H__
14 #include "wx/cocoa/NSTabView.h"
16 // ========================================================================
18 // ========================================================================
19 class WXDLLIMPEXP_CORE wxNotebook
: public wxNotebookBase
, protected wxCocoaNSTabView
21 DECLARE_DYNAMIC_CLASS(wxNotebook
)
23 WX_DECLARE_COCOA_OWNER(NSTabView
,NSView
,NSView
)
24 // ------------------------------------------------------------------------
26 // ------------------------------------------------------------------------
29 wxNotebook(wxWindow
*parent
, wxWindowID winid
,
30 const wxPoint
& pos
= wxDefaultPosition
,
31 const wxSize
& size
= wxDefaultSize
,
33 const wxString
& name
= wxNotebookNameStr
)
35 Create(parent
, winid
, pos
, size
, style
, name
);
38 bool Create(wxWindow
*parent
, wxWindowID winid
,
39 const wxPoint
& pos
= wxDefaultPosition
,
40 const wxSize
& size
= wxDefaultSize
,
42 const wxString
& name
= wxNotebookNameStr
);
43 virtual ~wxNotebook();
45 // ------------------------------------------------------------------------
47 // ------------------------------------------------------------------------
49 // Notebooks cannot be enabled/disabled
50 virtual void CocoaSetEnabled(bool WXUNUSED(enable
)) { }
51 virtual void CocoaDelegate_tabView_didSelectTabViewItem(WX_NSTabViewItem tabviewItem
);
52 virtual bool CocoaDelegate_tabView_shouldSelectTabViewItem(WX_NSTabViewItem tabviewItem
);
53 // ------------------------------------------------------------------------
55 // ------------------------------------------------------------------------
57 // set the currently selected page, return the index of the previously
58 // selected one (or wxNOT_FOUND on error)
59 int SetSelection(size_t nPage
);
60 // get the currently selected page
61 int GetSelection() const;
63 // changes selected page without sending events
64 int ChangeSelection(size_t nPage
);
66 // set/get the title of a page
67 bool SetPageText(size_t nPage
, const wxString
& strText
);
68 wxString
GetPageText(size_t nPage
) const;
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
);
74 // set the size (the same for all pages)
75 void SetPageSize(const wxSize
& size
);
77 // SetPadding and SetTabSize aren't possible to implement
78 void SetPadding(const wxSize
& padding
);
79 void SetTabSize(const wxSize
& sz
);
81 //-----------------------
82 // adding/removing pages
84 // remove one page from the notebook, without deleting
85 virtual wxNotebookPage
*DoRemovePage(size_t nPage
);
87 // remove one page from the notebook
88 bool DeletePage(size_t nPage
);
90 bool DeleteAllPages();
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
,
97 const wxString
& strText
,
99 int imageId
= NO_IMAGE
);
104 #endif //ndef _WX_COCOA_NOTEBOOK_H__