]> git.saurik.com Git - wxWidgets.git/blame - include/wx/palmos/notebook.h
reverted, the problem is deeper than that
[wxWidgets.git] / include / wx / palmos / notebook.h
CommitLineData
ffecfa5a
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: palmos/notebook.h
3// Purpose: MSW/GTK compatible notebook (a.k.a. property sheet)
4// Author: William Osborne
5// Modified by:
6// Created: 10/13/04
7// RCS-ID: $Id:
8// Copyright: (c) William Osborne
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _NOTEBOOK_H
13#define _NOTEBOOK_H
14
15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "notebook.h"
17#endif
18
19#if wxUSE_NOTEBOOK
20
21// ----------------------------------------------------------------------------
22// headers
23// ----------------------------------------------------------------------------
24
25#include "wx/control.h"
26
27// ----------------------------------------------------------------------------
28// wxNotebook
29// ----------------------------------------------------------------------------
30
31class WXDLLEXPORT wxNotebookPageInfo : public wxObject
32{
33public :
34 wxNotebookPageInfo() { m_page = NULL ; m_imageId = -1 ; m_selected = false ; }
35 virtual ~wxNotebookPageInfo() { }
36
37 void Create( wxNotebookPage *page , const wxString &text , bool selected , int imageId )
38 { m_page = page ; m_text = text ; m_selected = selected ; m_imageId = imageId ; }
39 wxNotebookPage* GetPage() const { return m_page ; }
40 wxString GetText() const { return m_text ; }
41 bool GetSelected() const { return m_selected ; }
42 int GetImageId() const { return m_imageId; }
43private :
44 wxNotebookPage *m_page ;
45 wxString m_text ;
46 bool m_selected ;
47 int m_imageId ;
48
49 DECLARE_DYNAMIC_CLASS(wxNotebookPageInfo) ;
50} ;
51
52
53WX_DECLARE_EXPORTED_LIST(wxNotebookPageInfo, wxNotebookPageInfoList );
54
55class WXDLLEXPORT wxNotebook : public wxNotebookBase
56{
57public:
58 // ctors
59 // -----
60 // default for dynamic class
61 wxNotebook();
62 // the same arguments as for wxControl (@@@ any special styles?)
63 wxNotebook(wxWindow *parent,
64 wxWindowID id,
65 const wxPoint& pos = wxDefaultPosition,
66 const wxSize& size = wxDefaultSize,
67 long style = 0,
68 const wxString& name = wxNOTEBOOK_NAME);
69 // Create() function
70 bool Create(wxWindow *parent,
71 wxWindowID id,
72 const wxPoint& pos = wxDefaultPosition,
73 const wxSize& size = wxDefaultSize,
74 long style = 0,
75 const wxString& name = wxNOTEBOOK_NAME);
76
77 // accessors
78 // ---------
79 // get number of pages in the dialog
80 virtual size_t GetPageCount() const;
81
82 // set the currently selected page, return the index of the previously
83 // selected one (or -1 on error)
84 // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
85 int SetSelection(size_t nPage);
86 // get the currently selected page
87 int GetSelection() const { return m_nSelection; }
88
89 // set/get the title of a page
90 bool SetPageText(size_t nPage, const wxString& strText);
91 wxString GetPageText(size_t nPage) const;
92
93 // image list stuff: each page may have an image associated with it. All
94 // the images belong to an image list, so you have to
95 // 1) create an image list
96 // 2) associate it with the notebook
97 // 3) set for each page it's image
98 // associate image list with a control
99 void SetImageList(wxImageList* imageList);
100
101 // sets/returns item's image index in the current image list
102 int GetPageImage(size_t nPage) const;
103 bool SetPageImage(size_t nPage, int nImage);
104
105 // currently it's always 1 because wxGTK doesn't support multi-row
106 // tab controls
107 int GetRowCount() const;
108
109 // control the appearance of the notebook pages
110 // set the size (the same for all pages)
111 void SetPageSize(const wxSize& size);
112 // set the padding between tabs (in pixels)
113 void SetPadding(const wxSize& padding);
114
115 // Windows only: attempts to get colour for UX theme page background
116 wxColour GetThemeBackgroundColour();
117
118 // operations
119 // ----------
120 // remove all pages
121 bool DeleteAllPages();
122
123 // inserts a new page to the notebook (it will be deleted ny the notebook,
124 // don't delete it yourself). If bSelect, this page becomes active.
125 bool InsertPage(size_t nPage,
126 wxNotebookPage *pPage,
127 const wxString& strText,
128 bool bSelect = FALSE,
129 int imageId = -1);
130
131 void AddPageInfo( wxNotebookPageInfo* info ) { AddPage( info->GetPage() , info->GetText() , info->GetSelected() , info->GetImageId() ) ; }
132 const wxNotebookPageInfoList& GetPageInfos() const ;
133
134 // Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH
135 // style.
136 void SetTabSize(const wxSize& sz);
137
138 // Windows only: attempts to apply the UX theme page background to this page
139 void ApplyThemeBackground(wxWindow* window, const wxColour& colour);
140
141 // hit test
142 virtual int HitTest(const wxPoint& pt, long *flags = NULL) const;
143
144 // calculate the size of the notebook from the size of its page
145 virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const;
146
147 // callbacks
148 // ---------
149 void OnSize(wxSizeEvent& event);
150 void OnSelChange(wxNotebookEvent& event);
151 void OnNavigationKey(wxNavigationKeyEvent& event);
152
153 // base class virtuals
154 // -------------------
155
156 virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
157 virtual bool MSWOnScroll(int orientation, WXWORD nSBCode,
158 WXWORD pos, WXHWND control);
159 virtual bool MSWTranslateMessage(WXMSG *wxmsg);
160
161#if wxUSE_CONSTRAINTS
162 virtual void SetConstraintSizes(bool recurse = TRUE);
163 virtual bool DoPhase(int nPhase);
164#endif // wxUSE_CONSTRAINTS
165
166protected:
167 // common part of all ctors
168 void Init();
169
170 // translate wxWin styles to the Windows ones
171 virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const;
172
173 // remove one page from the notebook, without deleting
174 virtual wxNotebookPage *DoRemovePage(size_t nPage);
175
176 // set the size of the given page to fit in the notebook
177 void AdjustPageSize(wxNotebookPage *page);
178
179 // override WndProc.
180#if wxUSE_UXTHEME
181 virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
182#endif
183
184 // the current selection (-1 if none)
185 int m_nSelection;
186
187 wxNotebookPageInfoList m_pageInfos ;
188
189
190 DECLARE_DYNAMIC_CLASS_NO_COPY(wxNotebook)
191 DECLARE_EVENT_TABLE()
192};
193
194#endif // wxUSE_NOTEBOOK
195
196#endif // _NOTEBOOK_H