]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/notebook.h
Further wxUniv fixes
[wxWidgets.git] / include / wx / msw / notebook.h
CommitLineData
b5f2afe5
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: msw/notebook.h
3// Purpose: MSW/GTK compatible notebook (a.k.a. property sheet)
4// Author: Robert Roebling
5// Modified by: Vadim Zeitlin for Windows version
6// RCS-ID: $Id$
7// Copyright: (c) Julian Smart and Markus Holzem
a3622daa 8// Licence: wxWindows license
b5f2afe5
VZ
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _NOTEBOOK_H
12#define _NOTEBOOK_H
13
14#ifdef __GNUG__
15 #pragma interface "notebook.h"
16#endif
17
1e6feb95
VZ
18#if wxUSE_NOTEBOOK
19
b5f2afe5
VZ
20// ----------------------------------------------------------------------------
21// headers
22// ----------------------------------------------------------------------------
74b31181 23
7c0ea335 24#include "wx/control.h"
b5f2afe5 25
b5f2afe5
VZ
26// ----------------------------------------------------------------------------
27// wxNotebook
28// ----------------------------------------------------------------------------
29
1e6feb95 30class WXDLLEXPORT wxNotebook : public wxNotebookBase
b5f2afe5
VZ
31{
32public:
33 // ctors
34 // -----
35 // default for dynamic class
36 wxNotebook();
37 // the same arguments as for wxControl (@@@ any special styles?)
38 wxNotebook(wxWindow *parent,
35eca07c 39 wxWindowID id,
b5f2afe5
VZ
40 const wxPoint& pos = wxDefaultPosition,
41 const wxSize& size = wxDefaultSize,
debe6624 42 long style = 0,
b5f2afe5
VZ
43 const wxString& name = "notebook");
44 // Create() function
45 bool Create(wxWindow *parent,
35eca07c 46 wxWindowID id,
b5f2afe5
VZ
47 const wxPoint& pos = wxDefaultPosition,
48 const wxSize& size = wxDefaultSize,
debe6624 49 long style = 0,
b5f2afe5
VZ
50 const wxString& name = "notebook");
51 // dtor
52 ~wxNotebook();
53
54 // accessors
55 // ---------
56 // get number of pages in the dialog
57 int GetPageCount() const;
58
59 // set the currently selected page, return the index of the previously
60 // selected one (or -1 on error)
61 // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
62 int SetSelection(int nPage);
b5f2afe5
VZ
63 // get the currently selected page
64 int GetSelection() const { return m_nSelection; }
65
66 // set/get the title of a page
67 bool SetPageText(int nPage, const wxString& strText);
68 wxString GetPageText(int nPage) const;
69
70 // image list stuff: each page may have an image associated with it. All
71 // the images belong to an image list, so you have to
72 // 1) create an image list
73 // 2) associate it with the notebook
74 // 3) set for each page it's image
75 // associate image list with a control
76 void SetImageList(wxImageList* imageList);
b656febd 77 void AssignImageList(wxImageList* imageList);
b5f2afe5
VZ
78
79 // sets/returns item's image index in the current image list
80 int GetPageImage(int nPage) const;
81 bool SetPageImage(int nPage, int nImage);
82
b5f2afe5
VZ
83 // currently it's always 1 because wxGTK doesn't support multi-row
84 // tab controls
85 int GetRowCount() const;
86
87 // control the appearance of the notebook pages
88 // set the size (the same for all pages)
89 void SetPageSize(const wxSize& size);
90 // set the padding between tabs (in pixels)
91 void SetPadding(const wxSize& padding);
92
93 // operations
94 // ----------
95 // remove one page from the notebook
96 bool DeletePage(int nPage);
97 // remove all pages
98 bool DeleteAllPages();
99 // adds a new page to the notebook (it will be deleted ny the notebook,
100 // don't delete it yourself). If bSelect, this page becomes active.
101 bool AddPage(wxNotebookPage *pPage,
102 const wxString& strText,
103 bool bSelect = FALSE,
8a33ea62 104 int imageId = -1);
b5f2afe5
VZ
105 // the same as AddPage(), but adds it at the specified position
106 bool InsertPage(int nPage,
107 wxNotebookPage *pPage,
108 const wxString& strText,
109 bool bSelect = FALSE,
8a33ea62 110 int imageId = -1);
b5f2afe5 111
58a8ab88
JS
112 // Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH
113 // style.
114 void SetTabSize(const wxSize& sz);
115
b5f2afe5
VZ
116 // callbacks
117 // ---------
9026ad85 118 void OnSize(wxSizeEvent& event);
b5f2afe5 119 void OnSelChange(wxNotebookEvent& event);
8a33ea62
VZ
120 void OnSetFocus(wxFocusEvent& event);
121 void OnNavigationKey(wxNavigationKeyEvent& event);
35eca07c 122
b5f2afe5
VZ
123 // base class virtuals
124 // -------------------
a23fd0e1 125 virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
5475b960
VZ
126 virtual void SetConstraintSizes(bool recurse = TRUE);
127 virtual bool DoPhase(int nPhase);
b5f2afe5
VZ
128
129protected:
130 // common part of all ctors
131 void Init();
132
1e6feb95
VZ
133 // remove one page from the notebook, without deleting
134 virtual wxNotebookPage *DoRemovePage(int nPage);
135
b5f2afe5
VZ
136 // helper functions
137 void ChangePage(int nOldSel, int nSel); // change pages
b5f2afe5 138
1e6feb95 139 bool m_bOwnsImageList;
b5f2afe5
VZ
140
141 int m_nSelection; // the current selection (-1 if none)
142
143 DECLARE_DYNAMIC_CLASS(wxNotebook)
144 DECLARE_EVENT_TABLE()
145};
146
1e6feb95
VZ
147#endif // wxUSE_NOTEBOOK
148
b5f2afe5 149#endif // _NOTEBOOK_H