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