]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/notebook.h
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
7 // Copyright: (c) Julian Smart and Markus Holzem
8 // Licence: wxWindows license
9 /////////////////////////////////////////////////////////////////////////////
15 #pragma interface "notebook.h"
20 // ----------------------------------------------------------------------------
22 // ----------------------------------------------------------------------------
24 #include "wx/control.h"
26 // ----------------------------------------------------------------------------
28 // ----------------------------------------------------------------------------
30 class WXDLLEXPORT wxNotebook
: public wxNotebookBase
35 // default for dynamic class
37 // the same arguments as for wxControl (@@@ any special styles?)
38 wxNotebook(wxWindow
*parent
,
40 const wxPoint
& pos
= wxDefaultPosition
,
41 const wxSize
& size
= wxDefaultSize
,
43 const wxString
& name
= "notebook");
45 bool Create(wxWindow
*parent
,
47 const wxPoint
& pos
= wxDefaultPosition
,
48 const wxSize
& size
= wxDefaultSize
,
50 const wxString
& name
= "notebook");
54 // get number of pages in the dialog
55 int GetPageCount() const;
57 // set the currently selected page, return the index of the previously
58 // selected one (or -1 on error)
59 // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
60 int SetSelection(int nPage
);
61 // get the currently selected page
62 int GetSelection() const { return m_nSelection
; }
64 // set/get the title of a page
65 bool SetPageText(int nPage
, const wxString
& strText
);
66 wxString
GetPageText(int nPage
) const;
68 // image list stuff: each page may have an image associated with it. All
69 // the images belong to an image list, so you have to
70 // 1) create an image list
71 // 2) associate it with the notebook
72 // 3) set for each page it's image
73 // associate image list with a control
74 void SetImageList(wxImageList
* imageList
);
76 // sets/returns item's image index in the current image list
77 int GetPageImage(int nPage
) const;
78 bool SetPageImage(int nPage
, int nImage
);
80 // currently it's always 1 because wxGTK doesn't support multi-row
82 int GetRowCount() const;
84 // control the appearance of the notebook pages
85 // set the size (the same for all pages)
86 void SetPageSize(const wxSize
& size
);
87 // set the padding between tabs (in pixels)
88 void SetPadding(const wxSize
& padding
);
92 // remove one page from the notebook
93 bool DeletePage(int nPage
);
95 bool DeleteAllPages();
96 // adds a new page to the notebook (it will be deleted ny the notebook,
97 // don't delete it yourself). If bSelect, this page becomes active.
98 bool AddPage(wxNotebookPage
*pPage
,
99 const wxString
& strText
,
100 bool bSelect
= FALSE
,
102 // the same as AddPage(), but adds it at the specified position
103 bool InsertPage(int nPage
,
104 wxNotebookPage
*pPage
,
105 const wxString
& strText
,
106 bool bSelect
= FALSE
,
109 // Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH
111 void SetTabSize(const wxSize
& sz
);
115 void OnSize(wxSizeEvent
& event
);
116 void OnSelChange(wxNotebookEvent
& event
);
117 void OnSetFocus(wxFocusEvent
& event
);
118 void OnNavigationKey(wxNavigationKeyEvent
& event
);
120 // base class virtuals
121 // -------------------
122 virtual bool MSWOnNotify(int idCtrl
, WXLPARAM lParam
, WXLPARAM
*result
);
123 virtual bool MSWOnScroll(int orientation
, WXWORD nSBCode
,
124 WXWORD pos
, WXHWND control
);
125 virtual void SetConstraintSizes(bool recurse
= TRUE
);
126 virtual bool DoPhase(int nPhase
);
129 // common part of all ctors
132 // translate wxWin styles to the Windows ones
133 virtual WXDWORD
MSWGetStyle(long flags
, WXDWORD
*exstyle
= NULL
) const;
135 // remove one page from the notebook, without deleting
136 virtual wxNotebookPage
*DoRemovePage(int nPage
);
139 void ChangePage(int nOldSel
, int nSel
); // change pages
141 int m_nSelection
; // the current selection (-1 if none)
143 DECLARE_DYNAMIC_CLASS(wxNotebook
)
144 DECLARE_EVENT_TABLE()
147 #endif // wxUSE_NOTEBOOK
149 #endif // _NOTEBOOK_H