]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/notebook.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: MSW/GTK compatible notebook (a.k.a. property sheet)
7 // Copyright: (c) AUTHOR
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_NOTEBOOK_H_
12 #define _WX_NOTEBOOK_H_
15 #pragma interface "notebook.h"
18 // ----------------------------------------------------------------------------
20 // ----------------------------------------------------------------------------
21 #include "wx/dynarray.h"
23 #include "wx/control.h"
25 // ----------------------------------------------------------------------------
27 // ----------------------------------------------------------------------------
30 class WXDLLEXPORT wxImageList
;
31 class WXDLLEXPORT wxWindow
;
33 // ----------------------------------------------------------------------------
35 // ----------------------------------------------------------------------------
37 // @@@ this class should really derive from wxTabCtrl, but the interface is not
38 // exactly the same, so I can't do it right now and instead we reimplement
39 // part of wxTabCtrl here
40 class wxNotebook
: public wxNotebookBase
45 // default for dynamic class
47 // the same arguments as for wxControl (@@@ any special styles?)
48 wxNotebook(wxWindow
*parent
,
50 const wxPoint
& pos
= wxDefaultPosition
,
51 const wxSize
& size
= wxDefaultSize
,
53 const wxString
& name
= "notebook");
55 bool Create(wxWindow
*parent
,
57 const wxPoint
& pos
= wxDefaultPosition
,
58 const wxSize
& size
= wxDefaultSize
,
60 const wxString
& name
= "notebook");
66 // set the currently selected page, return the index of the previously
67 // selected one (or -1 on error)
68 // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
69 int SetSelection(int nPage
);
70 // get the currently selected page
71 int GetSelection() const { return m_nSelection
; }
73 // set/get the title of a page
74 bool SetPageText(int nPage
, const wxString
& strText
);
75 wxString
GetPageText(int nPage
) const;
77 // sets/returns item's image index in the current image list
78 int GetPageImage(int nPage
) const;
79 bool SetPageImage(int nPage
, int nImage
);
81 // control the appearance of the notebook pages
82 // set the size (the same for all pages)
83 void SetPageSize(const wxSize
& size
);
84 // set the padding between tabs (in pixels)
85 void SetPadding(const wxSize
& padding
);
86 // sets the size of the tabs (assumes all tabs are the same size)
87 void SetTabSize(const wxSize
& sz
);
90 // get number of pages in the dialog
91 int GetPageCount() const;
93 // cycle thru the tabs
94 void AdvanceSelection(bool bForward = TRUE);
97 // currently it's always 1 because wxGTK doesn't support multi-row
99 int GetRowCount() const;
104 bool DeleteAllPages();
105 // the same as AddPage(), but adds it at the specified position
106 bool InsertPage(int nPage
,
107 wxNotebookPage
*pPage
,
108 const wxString
& strText
,
109 bool bSelect
= FALSE
,
112 // get the panel which represents the given page
113 wxNotebookPage *GetPage(int nPage) { return m_aPages[nPage]; }
117 void OnSize(wxSizeEvent
& event
);
118 void OnSelChange(wxNotebookEvent
& event
);
119 void OnSetFocus(wxFocusEvent
& event
);
120 void OnNavigationKey(wxNavigationKeyEvent
& event
);
126 #if wxUSE_CONSTRAINTS
127 virtual void SetConstraintSizes(bool recurse
= TRUE
);
128 virtual bool DoPhase(int nPhase
);
132 // base class virtuals
133 // -------------------
134 virtual void Command(wxCommandEvent
& event
);
136 virtual wxNotebookPage
*DoRemovePage(int page
) ;
137 virtual void MacHandleControlClick( ControlHandle control
, SInt16 controlpart
) ;
138 // common part of all ctors
142 void ChangePage(int nOldSel
, int nSel
); // change pages
145 // wxImageList *m_pImageList; // we can have an associated image list
146 // wxArrayPages m_aPages; // array of pages
148 int m_nSelection
; // the current selection (-1 if none)
150 DECLARE_DYNAMIC_CLASS(wxNotebook
)
151 DECLARE_EVENT_TABLE()
155 #endif // _WX_NOTEBOOK_H_