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 WXDLLIMPEXP_CORE 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
= wxNotebookNameStr
)
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
= wxNotebookNameStr
);
44 virtual ~wxNotebook();
46 // ------------------------------------------------------------------------
48 // ------------------------------------------------------------------------
50 // Notebooks cannot be enabled/disabled
51 virtual void CocoaSetEnabled(bool WXUNUSED(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 wxNOT_FOUND on error)
60 int SetSelection(size_t nPage
);
61 // get the currently selected page
62 int GetSelection() const;
64 // changes selected page without sending events
65 int ChangeSelection(size_t nPage
);
67 // set/get the title of a page
68 bool SetPageText(size_t nPage
, const wxString
& strText
);
69 wxString
GetPageText(size_t nPage
) const;
71 // sets/returns item's image index in the current image list
72 int GetPageImage(size_t nPage
) const;
73 bool SetPageImage(size_t nPage
, int nImage
);
75 // set the size (the same for all pages)
76 void SetPageSize(const wxSize
& size
);
78 // SetPadding and SetTabSize aren't possible to implement
79 void SetPadding(const wxSize
& padding
);
80 void SetTabSize(const wxSize
& sz
);
82 //-----------------------
83 // adding/removing pages
85 // remove one page from the notebook, without deleting
86 virtual wxNotebookPage
*DoRemovePage(size_t nPage
);
88 // remove one page from the notebook
89 bool DeletePage(size_t nPage
);
91 bool DeleteAllPages();
93 // adds a new page to the notebook (it will be deleted ny the notebook,
94 // don't delete it yourself). If bSelect, this page becomes active.
95 // the same as AddPage(), but adds it at the specified position
96 bool InsertPage( size_t position
,
98 const wxString
& strText
,
100 int imageId
= NO_IMAGE
);
105 #endif //ndef _WX_COCOA_NOTEBOOK_H__