]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/notebook.h
Added From(), OrderBy() and Where() functions that correspons to the Set/GetWhereClau...
[wxWidgets.git] / include / wx / gtk / notebook.h
CommitLineData
53b28675 1/////////////////////////////////////////////////////////////////////////////
716b7364
RR
2// Name: notebook.h
3// Purpose: wxNotebook class
53b28675
RR
4// Author: Robert Roebling
5// Modified by:
6// RCS-ID: $Id$
b2b3ccc5 7// Copyright: (c) Julian Smart and Robert Roebling
ff829f3f 8// Licence: wxWindows license
53b28675
RR
9/////////////////////////////////////////////////////////////////////////////
10
6ca41e57
RR
11#ifndef __GTKNOTEBOOKH__
12#define __GTKNOTEBOOKH__
53b28675
RR
13
14#ifdef __GNUG__
6ca41e57 15#pragma interface
53b28675
RR
16#endif
17
18#include "wx/defs.h"
dcf924a3
RR
19
20#if wxUSE_NOTEBOOK
21
53b28675
RR
22#include "wx/object.h"
23#include "wx/string.h"
24#include "wx/control.h"
25
26//-----------------------------------------------------------------------------
27// classes
28//-----------------------------------------------------------------------------
29
30class wxImageList;
53b28675 31class wxNotebook;
80a58c99
RR
32
33typedef wxWindow wxNotebookPage; // so far, any window can be a page
34
35//-----------------------------------------------------------------------------
36// internal class
37//-----------------------------------------------------------------------------
38
39class wxGtkNotebookPage;
53b28675 40
53b28675 41//-----------------------------------------------------------------------------
ff829f3f 42// wxNotebook
53b28675
RR
43//-----------------------------------------------------------------------------
44
ff829f3f 45class wxNotebook : public wxControl
53b28675 46{
ff829f3f 47public:
8253c7fd
RR
48 // default for dynamic class
49 wxNotebook();
50 // the same arguments as for wxControl
51 wxNotebook(wxWindow *parent,
debe6624 52 wxWindowID id,
ff829f3f
VZ
53 const wxPoint& pos = wxDefaultPosition,
54 const wxSize& size = wxDefaultSize,
debe6624 55 long style = 0,
ff829f3f 56 const wxString& name = "notebook");
8253c7fd
RR
57 // Create() function
58 bool Create(wxWindow *parent,
debe6624 59 wxWindowID id,
ff829f3f
VZ
60 const wxPoint& pos = wxDefaultPosition,
61 const wxSize& size = wxDefaultSize,
debe6624 62 long style = 0,
ff829f3f 63 const wxString& name = "notebook");
8253c7fd
RR
64 // dtor
65 ~wxNotebook();
ff829f3f
VZ
66
67 // accessors
68 // ---------
69 // get number of pages in the dialog
70 int GetPageCount() const;
71
72 // set the currently selected page, return the index of the previously
73 // selected one (or -1 on error)
74 // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
75 int SetSelection(int nPage);
76 // cycle thru the tabs
77 void AdvanceSelection(bool bForward = TRUE);
78 // get the currently selected page
79 int GetSelection() const;
80
81 // set/get the title of a page
82 bool SetPageText(int nPage, const wxString& strText);
83 wxString GetPageText(int nPage) const;
84
85 // image list stuff: each page may have an image associated with it. All
86 // the images belong to an image list, so you have to
87 // 1) create an image list
88 // 2) associate it with the notebook
89 // 3) set for each page it's image
90 // associate image list with a control
91 void SetImageList(wxImageList* imageList);
b656febd 92 void AssignImageList(wxImageList* imageList);
ff829f3f 93 // get pointer (may be NULL) to the associated image list
d8f2439c 94 wxImageList *GetImageList() const { return m_imageList; }
ff829f3f
VZ
95
96 // sets/returns item's image index in the current image list
97 int GetPageImage(int nPage) const;
98 bool SetPageImage(int nPage, int nImage);
99
100 // currently it's always 1 because wxGTK doesn't support multi-row
101 // tab controls
102 int GetRowCount() const;
103
104 // control the appearance of the notebook pages
105 // set the size (the same for all pages)
106 void SetPageSize(const wxSize& size);
107 // set the padding between tabs (in pixels)
108 void SetPadding(const wxSize& padding);
d8f2439c 109 // sets the size of the tabs (assumes all tabs are the same size)
ca8b28f2
JS
110 void SetTabSize(const wxSize& sz);
111
ff829f3f
VZ
112 // operations
113 // ----------
fed46e72
RR
114 // remove one page from the notebook but do not destroy it
115 bool RemovePage(int nPage);
ff829f3f
VZ
116 // remove one page from the notebook
117 bool DeletePage(int nPage);
118 // remove all pages
119 bool DeleteAllPages();
587ce561 120
ff829f3f
VZ
121 // adds a new page to the notebook (it will be deleted ny the notebook,
122 // don't delete it yourself). If bSelect, this page becomes active.
80a58c99
RR
123 bool AddPage( wxNotebookPage *win,
124 const wxString& strText,
125 bool select = FALSE,
126 int imageId = -1 );
587ce561 127 // the same as AddPage(), but adds it at the specified position
80a58c99
RR
128 bool InsertPage( int position,
129 wxNotebookPage *win,
130 const wxString& strText,
131 bool bSelect = FALSE,
132 int imageId = -1 );
ff829f3f
VZ
133
134 // get the panel which represents the given page
80a58c99 135 wxNotebookPage *GetPage(int nPage) const;
ff829f3f 136
8253c7fd
RR
137 // handler for tab navigation
138 // --------------------------
139 void OnNavigationKey(wxNavigationKeyEvent& event);
ed58dbea 140
db434467
RR
141 // implementation
142 // --------------
d8f2439c 143
93d38175 144#if wxUSE_CONSTRAINTS
db434467
RR
145 void SetConstraintSizes(bool recurse);
146 bool DoPhase(int phase);
93d38175
VS
147#endif
148
db434467 149 void ApplyWidgetStyle();
ff829f3f 150
db434467
RR
151 // report if window belongs to notebook
152 bool IsOwnGtkWindow( GdkWindow *window );
58d1c1ae 153
db434467
RR
154 // common part of all ctors
155 void Init();
ff829f3f 156
db434467 157 // helper function
80a58c99 158 wxGtkNotebookPage* GetNotebookPage(int page) const;
ff829f3f 159
db434467 160 wxImageList* m_imageList;
b656febd 161 bool m_ownsImageList;
db434467
RR
162 wxList m_pages;
163 int m_lastSelection; /* hack */
53b28675 164
db434467
RR
165private:
166 DECLARE_DYNAMIC_CLASS(wxNotebook)
167 DECLARE_EVENT_TABLE()
53b28675
RR
168};
169
dcf924a3
RR
170#endif
171
53b28675 172#endif
6ca41e57 173 // __GTKNOTEBOOKH__