]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/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__
18 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
22 class wxGtkNotebookPage
;
24 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
28 class wxNotebook
: public wxNotebookBase
31 // default for dynamic class
33 // the same arguments as for wxControl
34 wxNotebook(wxWindow
*parent
,
36 const wxPoint
& pos
= wxDefaultPosition
,
37 const wxSize
& size
= wxDefaultSize
,
39 const wxString
& name
= "notebook");
41 bool Create(wxWindow
*parent
,
43 const wxPoint
& pos
= wxDefaultPosition
,
44 const wxSize
& size
= wxDefaultSize
,
46 const wxString
& name
= "notebook");
53 // set the currently selected page, return the index of the previously
54 // selected one (or -1 on error)
55 // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
56 int SetSelection(int nPage
);
57 // get the currently selected page
58 int GetSelection() const;
60 // set/get the title of a page
61 bool SetPageText(int nPage
, const wxString
& strText
);
62 wxString
GetPageText(int nPage
) const;
64 // image list stuff: each page may have an image associated with it. All
65 // the images belong to an image list, so you have to
66 // 1) create an image list
67 // 2) associate it with the notebook
68 // 3) set for each page it's image
69 // associate image list with a control
70 void SetImageList(wxImageList
* imageList
);
71 void AssignImageList(wxImageList
* imageList
);
73 // sets/returns item's image index in the current image list
74 int GetPageImage(int nPage
) const;
75 bool SetPageImage(int nPage
, int nImage
);
77 // control the appearance of the notebook pages
78 // set the size (the same for all pages)
79 void SetPageSize(const wxSize
& size
);
80 // set the padding between tabs (in pixels)
81 void SetPadding(const wxSize
& padding
);
82 // sets the size of the tabs (assumes all tabs are the same size)
83 void SetTabSize(const wxSize
& sz
);
87 // remove one page from the notebook
88 bool DeletePage(int nPage
);
90 bool DeleteAllPages();
92 // adds a new page to the notebook (it will be deleted ny the notebook,
93 // don't delete it yourself). If bSelect, this page becomes active.
94 bool AddPage( wxNotebookPage
*win
,
95 const wxString
& strText
,
98 // the same as AddPage(), but adds it at the specified position
99 bool InsertPage( int position
,
101 const wxString
& strText
,
102 bool bSelect
= FALSE
,
105 // handler for tab navigation
106 // --------------------------
107 void OnNavigationKey(wxNavigationKeyEvent
& event
);
112 #if wxUSE_CONSTRAINTS
113 void SetConstraintSizes(bool recurse
);
114 bool DoPhase(int phase
);
117 void ApplyWidgetStyle();
119 // report if window belongs to notebook
120 bool IsOwnGtkWindow( GdkWindow
*window
);
122 // common part of all ctors
126 wxGtkNotebookPage
* GetNotebookPage(int page
) const;
128 bool m_ownsImageList
;
131 // for reasons explained in gtk/notebook.cpp we store the current
132 // selection internally instead of querying the notebook for it
136 // remove one page from the notebook but do not destroy it
137 virtual wxNotebookPage
*DoRemovePage(int nPage
);
140 DECLARE_DYNAMIC_CLASS(wxNotebook
)
141 DECLARE_EVENT_TABLE()