]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/notebook.h
36b8d1fe882494fe4954eecabcb99d867b441d32
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: MSW/GTK compatible notebook (a.k.a. property sheet)
4 // Author: David Webster
7 // Copyright: (c) David Webster
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #include "wx/control.h"
22 // ----------------------------------------------------------------------------
24 // ----------------------------------------------------------------------------
26 class WXDLLEXPORT wxNotebook
: public wxNotebookBase
32 // Default for dynamic class
37 // the same arguments as for wxControl
39 wxNotebook( wxWindow
* pParent
41 ,const wxPoint
& rPos
= wxDefaultPosition
42 ,const wxSize
& rSize
= wxDefaultSize
44 ,const wxString
& rsName
= "notebook"
47 bool Create( wxWindow
* pParent
49 ,const wxPoint
& rPos
= wxDefaultPosition
50 ,const wxSize
& rSize
= wxDefaultSize
52 ,const wxString
& rsName
= "notebook"
58 // Get number of pages in the dialog
60 virtual size_t GetPageCount(void) const;
63 // Set the currently selected page, return the index of the previously
64 // selected one (or -1 on error)
65 // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
67 int SetSelection(size_t nPage
);
70 // Get the currently selected page
72 inline int GetSelection(void) const { return m_nSelection
; }
75 // Set/Get the title of a page
77 bool SetPageText( size_t nPage
78 ,const wxString
& sStrText
80 wxString
GetPageText(size_t nPage
) const;
83 // Image list stuff: each page may have an image associated with it. All
84 // the images belong to an image list, so you have to
85 // 1) create an image list
86 // 2) associate it with the notebook
87 // 3) set for each page it's image
88 // associate image list with a control
90 void SetImageList(wxImageList
* pImageList
);
93 // Sets/returns item's image index in the current image list
95 int GetPageImage(size_t nPage
) const;
96 bool SetPageImage( size_t nPage
101 // Currently it's always 1 because wxGTK doesn't support multi-row
104 int GetRowCount(void) const;
107 // control the appearance of the notebook pages
108 // set the size (the same for all pages)
110 void SetPageSize(const wxSize
& rSize
);
113 // Set the padding between tabs (in pixels)
115 void SetPadding(const wxSize
& rPadding
);
122 bool DeleteAllPages(void);
125 // Adds a new page to the notebook (it will be deleted ny the notebook,
126 // don't delete it yourself). If bSelect, this page becomes active.
128 bool AddPage( wxNotebookPage
* pPage
129 ,const wxString
& rsStrText
130 ,bool bSelect
= FALSE
135 // The same as AddPage(), but adds it at the specified position
137 bool InsertPage( size_t nPage
138 ,wxNotebookPage
* pPage
139 ,const wxString
& rsStrText
140 ,bool bSelect
= FALSE
145 // Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH
148 void SetTabSize(const wxSize
& rSize
);
154 void OnSize(wxSizeEvent
& rEvent
);
155 void OnSelChange(wxNotebookEvent
& rEvent
);
156 void OnSetFocus(wxFocusEvent
& rEvent
);
157 void OnNavigationKey(wxNavigationKeyEvent
& rEvent
);
160 // Base class virtuals
161 // -------------------
163 virtual bool OS2OnScroll( int nOrientation
168 virtual void SetConstraintSizes(bool bRecurse
= TRUE
);
169 virtual bool DoPhase(int nPhase
);
173 // Common part of all ctors
178 // Translate wxWin styles to the PM ones
180 virtual WXDWORD
OS2GetStyle( long lFlags
181 ,WXDWORD
* pwExstyle
= NULL
185 // Remove one page from the notebook, without deleting
187 virtual wxNotebookPage
* DoRemovePage(size_t nPage
);
193 int m_nSelection
; // The current selection (-1 if none)
196 wxArrayLong m_alPageId
;
197 int m_nTabSize
; // holds the largest tab size
199 DECLARE_DYNAMIC_CLASS(wxNotebook
)
200 DECLARE_EVENT_TABLE()
201 }; // end of CLASS wxNotebook
203 #endif // wxUSE_NOTEBOOK
205 #endif // _NOTEBOOK_H