1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/notebook.h
3 // Purpose: MSW/GTK compatible notebook (a.k.a. property sheet)
4 // Author: David Webster
6 // Copyright: (c) David Webster
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 #include "wx/control.h"
21 // ----------------------------------------------------------------------------
23 // ----------------------------------------------------------------------------
25 class WXDLLIMPEXP_CORE wxNotebook
: public wxNotebookBase
31 // Default for dynamic class
36 // the same arguments as for wxControl
38 wxNotebook( wxWindow
* pParent
40 ,const wxPoint
& rPos
= wxDefaultPosition
41 ,const wxSize
& rSize
= wxDefaultSize
43 ,const wxString
& rsName
= wxNotebookNameStr
46 bool Create( wxWindow
* pParent
48 ,const wxPoint
& rPos
= wxDefaultPosition
49 ,const wxSize
& rSize
= wxDefaultSize
51 ,const wxString
& rsName
= wxNotebookNameStr
57 // Get number of pages in the dialog
59 virtual size_t GetPageCount(void) const;
62 // Set the currently selected page, return the index of the previously
63 // selected one (or wxNOT_FOUND on error)
64 // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
66 int SetSelection(size_t nPage
);
68 // changes selected page without sending events
69 int ChangeSelection(size_t nPage
);
72 // Set/Get the title of a page
74 bool SetPageText( size_t nPage
75 ,const wxString
& sStrText
77 wxString
GetPageText(size_t nPage
) const;
80 // Image list stuff: each page may have an image associated with it. All
81 // the images belong to an image list, so you have to
82 // 1) create an image list
83 // 2) associate it with the notebook
84 // 3) set for each page it's image
85 // associate image list with a control
87 void SetImageList(wxImageList
* pImageList
);
90 // Sets/returns item's image index in the current image list
92 int GetPageImage(size_t nPage
) const;
93 bool SetPageImage( size_t nPage
98 // Currently it's always 1 because wxGTK doesn't support multi-row
101 int GetRowCount(void) const;
104 // control the appearance of the notebook pages
105 // set the size (the same for all pages)
107 void SetPageSize(const wxSize
& rSize
);
110 // Set the padding between tabs (in pixels)
112 void SetPadding(const wxSize
& rPadding
);
119 bool DeleteAllPages(void);
122 // Adds a new page to the notebook (it will be deleted ny the notebook,
123 // don't delete it yourself). If bSelect, this page becomes active.
125 bool AddPage( wxNotebookPage
* pPage
126 ,const wxString
& rsStrText
127 ,bool bSelect
= false
132 // The same as AddPage(), but adds it at the specified position
134 bool InsertPage( size_t nPage
135 ,wxNotebookPage
* pPage
136 ,const wxString
& rsStrText
137 ,bool bSelect
= false
142 // Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH
145 void SetTabSize(const wxSize
& rSize
);
151 void OnSize(wxSizeEvent
& rEvent
);
152 void OnSelChange(wxBookCtrlEvent
& rEvent
);
153 void OnSetFocus(wxFocusEvent
& rEvent
);
154 void OnNavigationKey(wxNavigationKeyEvent
& rEvent
);
157 // Base class virtuals
158 // -------------------
160 virtual bool OS2OnScroll( int nOrientation
165 virtual void SetConstraintSizes(bool bRecurse
= true);
166 virtual bool DoPhase(int nPhase
);
170 // Common part of all ctors
175 // Translate wxWin styles to the PM ones
177 virtual WXDWORD
OS2GetStyle( long lFlags
178 ,WXDWORD
* pwExstyle
= NULL
182 // Remove one page from the notebook, without deleting
184 virtual wxNotebookPage
* DoRemovePage(size_t nPage
);
191 wxArrayLong m_alPageId
;
192 int m_nTabSize
; // holds the largest tab size
194 DECLARE_DYNAMIC_CLASS(wxNotebook
)
195 DECLARE_EVENT_TABLE()
196 }; // end of CLASS wxNotebook
198 #endif // wxUSE_NOTEBOOK
200 #endif // _NOTEBOOK_H