]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/notebook.h
e461360b9f984df81c12c65522d88de0654f076d
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_
14 #if defined(__GNUG__) && !defined(__APPLE__)
15 #pragma interface "notebook.h"
18 // ----------------------------------------------------------------------------
20 // ----------------------------------------------------------------------------
23 // ----------------------------------------------------------------------------
25 // ----------------------------------------------------------------------------
28 class WXDLLEXPORT wxImageList
;
29 class WXDLLEXPORT wxWindow
;
31 // ----------------------------------------------------------------------------
33 // ----------------------------------------------------------------------------
35 // @@@ this class should really derive from wxTabCtrl, but the interface is not
36 // exactly the same, so I can't do it right now and instead we reimplement
37 // part of wxTabCtrl here
38 class wxNotebook
: public wxNotebookBase
43 // default for dynamic class
45 // the same arguments as for wxControl (@@@ any special styles?)
46 wxNotebook(wxWindow
*parent
,
48 const wxPoint
& pos
= wxDefaultPosition
,
49 const wxSize
& size
= wxDefaultSize
,
51 const wxString
& name
= "notebook");
53 bool Create(wxWindow
*parent
,
55 const wxPoint
& pos
= wxDefaultPosition
,
56 const wxSize
& size
= wxDefaultSize
,
58 const wxString
& name
= "notebook");
64 // set the currently selected page, return the index of the previously
65 // selected one (or -1 on error)
66 // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
67 int SetSelection(int nPage
);
68 // get the currently selected page
69 int GetSelection() const { return m_nSelection
; }
71 // set/get the title of a page
72 bool SetPageText(int nPage
, const wxString
& strText
);
73 wxString
GetPageText(int nPage
) const;
75 // sets/returns item's image index in the current image list
76 int GetPageImage(int nPage
) const;
77 bool SetPageImage(int nPage
, int nImage
);
79 // control the appearance of the notebook pages
80 // set the size (the same for all pages)
81 virtual void SetPageSize(const wxSize
& size
);
82 // set the padding between tabs (in pixels)
83 virtual void SetPadding(const wxSize
& padding
);
84 // sets the size of the tabs (assumes all tabs are the same size)
85 virtual void SetTabSize(const wxSize
& sz
);
87 // calculate size for wxNotebookSizer
88 wxSize
CalcSizeFromPage(const wxSize
& sizePage
);
91 // get number of pages in the dialog
92 int GetPageCount() const;
94 // cycle thru the tabs
95 void AdvanceSelection(bool bForward = TRUE);
98 // currently it's always 1 because wxGTK doesn't support multi-row
100 int GetRowCount() const;
105 bool DeleteAllPages();
106 // the same as AddPage(), but adds it at the specified position
107 bool InsertPage(int nPage
,
108 wxNotebookPage
*pPage
,
109 const wxString
& strText
,
110 bool bSelect
= FALSE
,
113 // get the panel which represents the given page
114 wxNotebookPage *GetPage(int nPage) { return m_aPages[nPage]; }
118 void OnSize(wxSizeEvent
& event
);
119 void OnSelChange(wxNotebookEvent
& event
);
120 void OnSetFocus(wxFocusEvent
& event
);
121 void OnNavigationKey(wxNavigationKeyEvent
& event
);
122 void OnMouse(wxMouseEvent
&event
);
127 #if wxUSE_CONSTRAINTS
128 virtual void SetConstraintSizes(bool recurse
= TRUE
);
129 virtual bool DoPhase(int nPhase
);
133 // base class virtuals
134 // -------------------
135 virtual void Command(wxCommandEvent
& event
);
137 virtual wxNotebookPage
*DoRemovePage(int page
) ;
138 virtual void MacHandleControlClick( WXWidget control
, wxInt16 controlpart
) ;
139 // common part of all ctors
143 void ChangePage(int nOldSel
, int nSel
); // change pages
146 // wxImageList *m_pImageList; // we can have an associated image list
147 // wxArrayPages m_aPages; // array of pages
149 int m_nSelection
; // the current selection (-1 if none)
151 DECLARE_DYNAMIC_CLASS(wxNotebook
)
152 DECLARE_EVENT_TABLE()
156 #endif // _WX_NOTEBOOK_H_