]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/notebook.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxNotebook class
4 // Author: Robert Roebling
7 // Copyright: (c) Julian Smart and Robert Roebling
8 // Licence: wxWindows license
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __GTKNOTEBOOKH__
12 #define __GTKNOTEBOOKH__
19 #include "wx/object.h"
20 #include "wx/string.h"
21 #include "wx/control.h"
23 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
31 //-----------------------------------------------------------------------------
33 //-----------------------------------------------------------------------------
35 class wxNotebook
: public wxControl
40 // default for dynamic class
42 // the same arguments as for wxControl (@@@ any special styles?)
43 wxNotebook(wxWindow
*parent
,
45 const wxPoint
& pos
= wxDefaultPosition
,
46 const wxSize
& size
= wxDefaultSize
,
48 const wxString
& name
= "notebook");
50 bool Create(wxWindow
*parent
,
52 const wxPoint
& pos
= wxDefaultPosition
,
53 const wxSize
& size
= wxDefaultSize
,
55 const wxString
& name
= "notebook");
61 // get number of pages in the dialog
62 int GetPageCount() const;
64 // set the currently selected page, return the index of the previously
65 // selected one (or -1 on error)
66 // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
67 int SetSelection(int nPage
);
68 // cycle thru the tabs
69 void AdvanceSelection(bool bForward
= TRUE
);
70 // get the currently selected page
71 int GetSelection() const;
73 // set/get the title of a page
74 bool SetPageText(int nPage
, const wxString
& strText
);
75 wxString
GetPageText(int nPage
) const;
77 // image list stuff: each page may have an image associated with it. All
78 // the images belong to an image list, so you have to
79 // 1) create an image list
80 // 2) associate it with the notebook
81 // 3) set for each page it's image
82 // associate image list with a control
83 void SetImageList(wxImageList
* imageList
);
84 // get pointer (may be NULL) to the associated image list
85 wxImageList
*GetImageList() const { return m_imageList
; }
87 // sets/returns item's image index in the current image list
88 int GetPageImage(int nPage
) const;
89 bool SetPageImage(int nPage
, int nImage
);
91 // currently it's always 1 because wxGTK doesn't support multi-row
93 int GetRowCount() const;
95 // control the appearance of the notebook pages
96 // set the size (the same for all pages)
97 void SetPageSize(const wxSize
& size
);
98 // set the padding between tabs (in pixels)
99 void SetPadding(const wxSize
& padding
);
100 // sets the size of the tabs (assumes all tabs are the same size)
101 void SetTabSize(const wxSize
& sz
);
105 // remove one page from the notebook but do not destroy it
106 bool RemovePage(int nPage
);
107 // remove one page from the notebook
108 bool DeletePage(int nPage
);
110 bool DeleteAllPages();
112 // adds a new page to the notebook (it will be deleted ny the notebook,
113 // don't delete it yourself). If bSelect, this page becomes active.
114 bool AddPage( wxWindow
*win
,
115 const wxString
& strText
,
118 // the same as AddPage(), but adds it at the specified position
119 bool InsertPage( int position
,
121 const wxString
& strText
,
122 bool bSelect
= FALSE
,
125 // get the panel which represents the given page
126 wxWindow
*GetPage(int nPage
) const;
128 void OnNavigationKey(wxNavigationKeyEvent
& event
);
132 void SetConstraintSizes(bool recurse
);
133 bool DoPhase(int phase
);
134 void ApplyWidgetStyle();
136 // report if window belongs to notebook
137 bool IsOwnGtkWindow( GdkWindow
*window
);
139 // common part of all ctors
143 wxNotebookPage
* GetNotebookPage(int page
) const;
145 wxImageList
* m_imageList
;
147 int m_lastSelection
; /* hack */
149 DECLARE_DYNAMIC_CLASS(wxNotebook
)
150 DECLARE_EVENT_TABLE()