]>
git.saurik.com Git - wxWidgets.git/blob - src/palmos/notebook.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/notebook.cpp
3 // Purpose: implementation of wxNotebook
4 // Author: William Osborne - minimal working wxPalmOS port
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
23 #include "wx/string.h"
26 // ----------------------------------------------------------------------------
28 // ----------------------------------------------------------------------------
30 // check that the page index is valid
31 #define IS_VALID_PAGE(nPage) ((nPage) < GetPageCount())
33 // ----------------------------------------------------------------------------
35 // ----------------------------------------------------------------------------
37 BEGIN_EVENT_TABLE(wxNotebook
, wxBookCtrlBase
)
38 EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY
, wxNotebook::OnSelChange
)
40 EVT_SIZE(wxNotebook::OnSize
)
42 EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey
)
45 // ============================================================================
47 // ============================================================================
49 // ----------------------------------------------------------------------------
50 // wxNotebook construction
51 // ----------------------------------------------------------------------------
53 const wxNotebookPageInfoList
& wxNotebook::GetPageInfos() const
55 wxNotebookPageInfoList
* list
;
60 // common part of all ctors
61 void wxNotebook::Init()
65 // default for dynamic class
66 wxNotebook::wxNotebook()
70 // the same arguments as for wxControl
71 wxNotebook::wxNotebook(wxWindow
*parent
,
81 bool wxNotebook::Create(wxWindow
*parent
,
91 // ----------------------------------------------------------------------------
92 // wxNotebook accessors
93 // ----------------------------------------------------------------------------
95 size_t wxNotebook::GetPageCount() const
100 int wxNotebook::GetRowCount() const
105 int wxNotebook::SetSelection(size_t nPage
)
110 int wxNotebook::ChangeSelection(size_t nPage
)
115 bool wxNotebook::SetPageText(size_t nPage
, const wxString
& strText
)
120 wxString
wxNotebook::GetPageText(size_t nPage
) const
122 return wxEmptyString
;
125 int wxNotebook::GetPageImage(size_t nPage
) const
130 bool wxNotebook::SetPageImage(size_t nPage
, int nImage
)
135 void wxNotebook::SetImageList(wxImageList
* imageList
)
139 // ----------------------------------------------------------------------------
140 // wxNotebook size settings
141 // ----------------------------------------------------------------------------
143 void wxNotebook::SetPageSize(const wxSize
& size
)
147 void wxNotebook::SetPadding(const wxSize
& padding
)
151 void wxNotebook::SetTabSize(const wxSize
& sz
)
155 wxSize
wxNotebook::CalcSizeFromPage(const wxSize
& sizePage
) const
160 void wxNotebook::AdjustPageSize(wxNotebookPage
*page
)
164 // ----------------------------------------------------------------------------
165 // wxNotebook operations
166 // ----------------------------------------------------------------------------
168 // remove one page from the notebook, without deleting
169 wxNotebookPage
*wxNotebook::DoRemovePage(size_t nPage
)
175 bool wxNotebook::DeleteAllPages()
180 // same as AddPage() but does it at given position
181 bool wxNotebook::InsertPage(size_t nPage
,
182 wxNotebookPage
*pPage
,
183 const wxString
& strText
,
190 int wxNotebook::HitTest(const wxPoint
& pt
, long *flags
) const
196 // ----------------------------------------------------------------------------
197 // wxNotebook callbacks
198 // ----------------------------------------------------------------------------
200 void wxNotebook::OnSize(wxSizeEvent
& event
)
204 void wxNotebook::OnSelChange(wxBookCtrlEvent
& event
)
208 void wxNotebook::OnNavigationKey(wxNavigationKeyEvent
& event
)
212 // ----------------------------------------------------------------------------
213 // wxNotebook base class virtuals
214 // ----------------------------------------------------------------------------
216 #if wxUSE_CONSTRAINTS
218 // override these 2 functions to do nothing: everything is done in OnSize
220 void wxNotebook::SetConstraintSizes(bool WXUNUSED(recurse
))
224 bool wxNotebook::DoPhase(int WXUNUSED(nPhase
))
229 #endif // wxUSE_CONSTRAINTS
231 #endif // wxUSE_NOTEBOOK