]> git.saurik.com Git - wxWidgets.git/blame - src/palmos/notebook.cpp
refactor wxDocChildFrame and wxDocMDIChildFrame to use wxDocChildFrameAny intead...
[wxWidgets.git] / src / palmos / notebook.cpp
CommitLineData
ffecfa5a 1///////////////////////////////////////////////////////////////////////////////
e2731512 2// Name: src/palmos/notebook.cpp
ffecfa5a 3// Purpose: implementation of wxNotebook
e2731512 4// Author: William Osborne - minimal working wxPalmOS port
ffecfa5a
JS
5// Modified by:
6// Created: 10/13/04
e2731512 7// RCS-ID: $Id$
ffecfa5a
JS
8// Copyright: (c) William Osborne
9// Licence: wxWindows licence
10///////////////////////////////////////////////////////////////////////////////
11
ffecfa5a
JS
12// For compilers that support precompilation, includes "wx.h".
13#include "wx/wxprec.h"
14
15#ifdef __BORLANDC__
16 #pragma hdrstop
17#endif
18
19#if wxUSE_NOTEBOOK
20
21// wxWidgets
22#ifndef WX_PRECOMP
23 #include "wx/string.h"
24#endif // WX_PRECOMP
25
ffecfa5a
JS
26// ----------------------------------------------------------------------------
27// macros
28// ----------------------------------------------------------------------------
29
30// check that the page index is valid
31#define IS_VALID_PAGE(nPage) ((nPage) < GetPageCount())
32
ffecfa5a
JS
33// ----------------------------------------------------------------------------
34// event table
35// ----------------------------------------------------------------------------
36
7ec69821 37#include "wx/listimpl.cpp"
ffecfa5a 38
412e0d47 39WX_DEFINE_LIST( wxNotebookPageInfoList )
ffecfa5a 40
8dba4c72 41BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase)
90c0f5a9 42 EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, wxNotebook::OnSelChange)
ffecfa5a
JS
43
44 EVT_SIZE(wxNotebook::OnSize)
45
46 EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
47END_EVENT_TABLE()
48
49#if wxUSE_EXTENDED_RTTI
50WX_DEFINE_FLAGS( wxNotebookStyle )
51
52wxBEGIN_FLAGS( wxNotebookStyle )
53 // new style border flags, we put them first to
54 // use them for streaming out
55 wxFLAGS_MEMBER(wxBORDER_SIMPLE)
56 wxFLAGS_MEMBER(wxBORDER_SUNKEN)
57 wxFLAGS_MEMBER(wxBORDER_DOUBLE)
58 wxFLAGS_MEMBER(wxBORDER_RAISED)
59 wxFLAGS_MEMBER(wxBORDER_STATIC)
60 wxFLAGS_MEMBER(wxBORDER_NONE)
e2731512 61
ffecfa5a
JS
62 // old style border flags
63 wxFLAGS_MEMBER(wxSIMPLE_BORDER)
64 wxFLAGS_MEMBER(wxSUNKEN_BORDER)
65 wxFLAGS_MEMBER(wxDOUBLE_BORDER)
66 wxFLAGS_MEMBER(wxRAISED_BORDER)
67 wxFLAGS_MEMBER(wxSTATIC_BORDER)
68 wxFLAGS_MEMBER(wxBORDER)
69
70 // standard window styles
71 wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
72 wxFLAGS_MEMBER(wxCLIP_CHILDREN)
73 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
74 wxFLAGS_MEMBER(wxWANTS_CHARS)
75 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
76 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
77 wxFLAGS_MEMBER(wxVSCROLL)
78 wxFLAGS_MEMBER(wxHSCROLL)
79
80 wxFLAGS_MEMBER(wxNB_FIXEDWIDTH)
90c0f5a9
WS
81 wxFLAGS_MEMBER(wxBK_LEFT)
82 wxFLAGS_MEMBER(wxBK_RIGHT)
83 wxFLAGS_MEMBER(wxBK_BOTTOM)
ffecfa5a
JS
84
85wxEND_FLAGS( wxNotebookStyle )
86
8dba4c72 87IMPLEMENT_DYNAMIC_CLASS_XTI(wxNotebook, wxBookCtrlBase,"wx/notebook.h")
ffecfa5a
JS
88IMPLEMENT_DYNAMIC_CLASS_XTI(wxNotebookPageInfo, wxObject , "wx/notebook.h" )
89
90wxCOLLECTION_TYPE_INFO( wxNotebookPageInfo * , wxNotebookPageInfoList ) ;
91
92template<> void wxCollectionToVariantArray( wxNotebookPageInfoList const &theList, wxxVariantArray &value)
93{
94 wxListCollectionToVariantArray<wxNotebookPageInfoList::compatibility_iterator>( theList , value ) ;
95}
96
97wxBEGIN_PROPERTIES_TABLE(wxNotebook)
3e97a905
VZ
98 wxEVENT_PROPERTY( PageChanging , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , wxBookCtrlEvent )
99 wxEVENT_PROPERTY( PageChanged , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , wxBookCtrlEvent )
ffecfa5a
JS
100
101 wxPROPERTY_COLLECTION( PageInfos , wxNotebookPageInfoList , wxNotebookPageInfo* , AddPageInfo , GetPageInfos , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
102 wxPROPERTY_FLAGS( WindowStyle , wxNotebookStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
103wxEND_PROPERTIES_TABLE()
104
105wxBEGIN_HANDLERS_TABLE(wxNotebook)
106wxEND_HANDLERS_TABLE()
107
e2731512 108wxCONSTRUCTOR_5( wxNotebook , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle)
ffecfa5a
JS
109
110
111wxBEGIN_PROPERTIES_TABLE(wxNotebookPageInfo)
112 wxREADONLY_PROPERTY( Page , wxNotebookPage* , GetPage , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
113 wxREADONLY_PROPERTY( Text , wxString , GetText , wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
114 wxREADONLY_PROPERTY( Selected , bool , GetSelected , false, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
115 wxREADONLY_PROPERTY( ImageId , int , GetImageId , -1 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
116wxEND_PROPERTIES_TABLE()
117
118wxBEGIN_HANDLERS_TABLE(wxNotebookPageInfo)
119wxEND_HANDLERS_TABLE()
120
e2731512 121wxCONSTRUCTOR_4( wxNotebookPageInfo , wxNotebookPage* , Page , wxString , Text , bool , Selected , int , ImageId )
ffecfa5a
JS
122
123#else
8dba4c72 124IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase)
ffecfa5a
JS
125IMPLEMENT_DYNAMIC_CLASS(wxNotebookPageInfo, wxObject )
126#endif
ffecfa5a
JS
127
128// ============================================================================
129// implementation
130// ============================================================================
131
132// ----------------------------------------------------------------------------
133// wxNotebook construction
134// ----------------------------------------------------------------------------
135
136const wxNotebookPageInfoList& wxNotebook::GetPageInfos() const
137{
138 wxNotebookPageInfoList* list;
139
140 return m_pageInfos ;
141}
142
143// common part of all ctors
144void wxNotebook::Init()
145{
146}
147
148// default for dynamic class
149wxNotebook::wxNotebook()
150{
151}
152
153// the same arguments as for wxControl
154wxNotebook::wxNotebook(wxWindow *parent,
155 wxWindowID id,
156 const wxPoint& pos,
157 const wxSize& size,
158 long style,
159 const wxString& name)
160{
161}
162
163// Create() function
164bool wxNotebook::Create(wxWindow *parent,
165 wxWindowID id,
166 const wxPoint& pos,
167 const wxSize& size,
168 long style,
169 const wxString& name)
170{
171 return false;
172}
173
ffecfa5a
JS
174// ----------------------------------------------------------------------------
175// wxNotebook accessors
176// ----------------------------------------------------------------------------
177
178size_t wxNotebook::GetPageCount() const
179{
630ad6c6 180 return 0;
ffecfa5a
JS
181}
182
183int wxNotebook::GetRowCount() const
184{
630ad6c6 185 return 0;
ffecfa5a
JS
186}
187
188int wxNotebook::SetSelection(size_t nPage)
189{
190 return 0;
191}
192
1d6fcbcc
VZ
193int wxNotebook::ChangeSelection(size_t nPage)
194{
195 return 0;
196}
197
ffecfa5a
JS
198bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
199{
200 return false;
201}
202
203wxString wxNotebook::GetPageText(size_t nPage) const
204{
630ad6c6 205 return wxEmptyString;
ffecfa5a
JS
206}
207
208int wxNotebook::GetPageImage(size_t nPage) const
209{
630ad6c6 210 return -1;
ffecfa5a
JS
211}
212
213bool wxNotebook::SetPageImage(size_t nPage, int nImage)
214{
215 return false;
216}
217
218void wxNotebook::SetImageList(wxImageList* imageList)
219{
220}
221
222// ----------------------------------------------------------------------------
223// wxNotebook size settings
224// ----------------------------------------------------------------------------
225
226void wxNotebook::SetPageSize(const wxSize& size)
227{
228}
229
230void wxNotebook::SetPadding(const wxSize& padding)
231{
232}
233
234void wxNotebook::SetTabSize(const wxSize& sz)
235{
236}
237
238wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
239{
240 return wxSize(0,0);
241}
242
243void wxNotebook::AdjustPageSize(wxNotebookPage *page)
244{
245}
246
247// ----------------------------------------------------------------------------
248// wxNotebook operations
249// ----------------------------------------------------------------------------
250
251// remove one page from the notebook, without deleting
252wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage)
253{
254 return NULL;
255}
256
257// remove all pages
258bool wxNotebook::DeleteAllPages()
259{
630ad6c6 260 return true;
ffecfa5a
JS
261}
262
263// same as AddPage() but does it at given position
264bool wxNotebook::InsertPage(size_t nPage,
265 wxNotebookPage *pPage,
266 const wxString& strText,
267 bool bSelect,
268 int imageId)
269{
270 return false;
271}
272
273int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
274{
275 return 0;
276}
277
278
279// ----------------------------------------------------------------------------
280// wxNotebook callbacks
281// ----------------------------------------------------------------------------
282
283void wxNotebook::OnSize(wxSizeEvent& event)
284{
285}
286
3e97a905 287void wxNotebook::OnSelChange(wxBookCtrlEvent& event)
ffecfa5a
JS
288{
289}
290
ffecfa5a
JS
291void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
292{
293}
294
295// ----------------------------------------------------------------------------
296// wxNotebook base class virtuals
297// ----------------------------------------------------------------------------
298
299#if wxUSE_CONSTRAINTS
300
301// override these 2 functions to do nothing: everything is done in OnSize
302
303void wxNotebook::SetConstraintSizes(bool WXUNUSED(recurse))
304{
305}
306
307bool wxNotebook::DoPhase(int WXUNUSED(nPhase))
308{
309 return true;
310}
311
312#endif // wxUSE_CONSTRAINTS
313
ffecfa5a 314#endif // wxUSE_NOTEBOOK