]> git.saurik.com Git - wxWidgets.git/blob - include/wx/aui/tabart.h
Provide shorter synonyms for wxEVT_XXX constants.
[wxWidgets.git] / include / wx / aui / tabart.h
1 //////////////////////////////////////////////////////////////////////////////
2 // Name: wx/aui/tabart.h
3 // Purpose: wxaui: wx advanced user interface - notebook
4 // Author: Benjamin I. Williams
5 // Modified by: Jens Lody (extracted from wx/aui/auibook.h)
6 // Created: 2012-03-21
7 // RCS-ID: $Id$
8 // Copyright: (C) Copyright 2006, Kirix Corporation, All Rights Reserved.
9 // Licence: wxWindows Library Licence, Version 3.1
10 ///////////////////////////////////////////////////////////////////////////////
11
12
13 #ifndef _WX_AUI_TABART_H_
14 #define _WX_AUI_TABART_H_
15
16 // ----------------------------------------------------------------------------
17 // headers
18 // ----------------------------------------------------------------------------
19
20 #include "wx/defs.h"
21
22 #if wxUSE_AUI
23
24 #include "wx/colour.h"
25 #include "wx/gdicmn.h"
26 #include "wx/font.h"
27 #include "wx/pen.h"
28 #include "wx/brush.h"
29 #include "wx/bitmap.h"
30
31
32 class wxAuiNotebookPage;
33 class wxAuiNotebookPageArray;
34 class wxWindow;
35 class wxDC;
36
37
38 // tab art class
39
40 class WXDLLIMPEXP_AUI wxAuiTabArt
41 {
42 public:
43
44 wxAuiTabArt() { }
45 virtual ~wxAuiTabArt() { }
46
47 virtual wxAuiTabArt* Clone() = 0;
48 virtual void SetFlags(unsigned int flags) = 0;
49
50 virtual void SetSizingInfo(const wxSize& tabCtrlSize,
51 size_t tabCount) = 0;
52
53 virtual void SetNormalFont(const wxFont& font) = 0;
54 virtual void SetSelectedFont(const wxFont& font) = 0;
55 virtual void SetMeasuringFont(const wxFont& font) = 0;
56 virtual void SetColour(const wxColour& colour) = 0;
57 virtual void SetActiveColour(const wxColour& colour) = 0;
58
59 virtual void DrawBorder(
60 wxDC& dc,
61 wxWindow* wnd,
62 const wxRect& rect) = 0;
63
64 virtual void DrawBackground(
65 wxDC& dc,
66 wxWindow* wnd,
67 const wxRect& rect) = 0;
68
69 virtual void DrawTab(wxDC& dc,
70 wxWindow* wnd,
71 const wxAuiNotebookPage& pane,
72 const wxRect& inRect,
73 int closeButtonState,
74 wxRect* outTabRect,
75 wxRect* outButtonRect,
76 int* xExtent) = 0;
77
78 virtual void DrawButton(
79 wxDC& dc,
80 wxWindow* wnd,
81 const wxRect& inRect,
82 int bitmapId,
83 int buttonState,
84 int orientation,
85 wxRect* outRect) = 0;
86
87 virtual wxSize GetTabSize(
88 wxDC& dc,
89 wxWindow* wnd,
90 const wxString& caption,
91 const wxBitmap& bitmap,
92 bool active,
93 int closeButtonState,
94 int* xExtent) = 0;
95
96 virtual int ShowDropDown(
97 wxWindow* wnd,
98 const wxAuiNotebookPageArray& items,
99 int activeIdx) = 0;
100
101 virtual int GetIndentSize() = 0;
102
103 virtual int GetBorderWidth(
104 wxWindow* wnd) = 0;
105
106 virtual int GetAdditionalBorderSpace(
107 wxWindow* wnd) = 0;
108
109 virtual int GetBestTabCtrlSize(
110 wxWindow* wnd,
111 const wxAuiNotebookPageArray& pages,
112 const wxSize& requiredBmpSize) = 0;
113 };
114
115
116 class WXDLLIMPEXP_AUI wxAuiGenericTabArt : public wxAuiTabArt
117 {
118
119 public:
120
121 wxAuiGenericTabArt();
122 virtual ~wxAuiGenericTabArt();
123
124 wxAuiTabArt* Clone();
125 void SetFlags(unsigned int flags);
126 void SetSizingInfo(const wxSize& tabCtrlSize,
127 size_t tabCount);
128
129 void SetNormalFont(const wxFont& font);
130 void SetSelectedFont(const wxFont& font);
131 void SetMeasuringFont(const wxFont& font);
132 void SetColour(const wxColour& colour);
133 void SetActiveColour(const wxColour& colour);
134
135 void DrawBorder(
136 wxDC& dc,
137 wxWindow* wnd,
138 const wxRect& rect);
139
140 void DrawBackground(
141 wxDC& dc,
142 wxWindow* wnd,
143 const wxRect& rect);
144
145 void DrawTab(wxDC& dc,
146 wxWindow* wnd,
147 const wxAuiNotebookPage& pane,
148 const wxRect& inRect,
149 int closeButtonState,
150 wxRect* outTabRect,
151 wxRect* outButtonRect,
152 int* xExtent);
153
154 void DrawButton(
155 wxDC& dc,
156 wxWindow* wnd,
157 const wxRect& inRect,
158 int bitmapId,
159 int buttonState,
160 int orientation,
161 wxRect* outRect);
162
163 int GetIndentSize();
164
165 int GetBorderWidth(
166 wxWindow* wnd);
167
168 int GetAdditionalBorderSpace(
169 wxWindow* wnd);
170
171 wxSize GetTabSize(
172 wxDC& dc,
173 wxWindow* wnd,
174 const wxString& caption,
175 const wxBitmap& bitmap,
176 bool active,
177 int closeButtonState,
178 int* xExtent);
179
180 int ShowDropDown(
181 wxWindow* wnd,
182 const wxAuiNotebookPageArray& items,
183 int activeIdx);
184
185 int GetBestTabCtrlSize(wxWindow* wnd,
186 const wxAuiNotebookPageArray& pages,
187 const wxSize& requiredBmpSize);
188
189 protected:
190
191 wxFont m_normalFont;
192 wxFont m_selectedFont;
193 wxFont m_measuringFont;
194 wxColour m_baseColour;
195 wxPen m_baseColourPen;
196 wxPen m_borderPen;
197 wxBrush m_baseColourBrush;
198 wxColour m_activeColour;
199 wxBitmap m_activeCloseBmp;
200 wxBitmap m_disabledCloseBmp;
201 wxBitmap m_activeLeftBmp;
202 wxBitmap m_disabledLeftBmp;
203 wxBitmap m_activeRightBmp;
204 wxBitmap m_disabledRightBmp;
205 wxBitmap m_activeWindowListBmp;
206 wxBitmap m_disabledWindowListBmp;
207
208 int m_fixedTabWidth;
209 int m_tabCtrlHeight;
210 unsigned int m_flags;
211 };
212
213
214 class WXDLLIMPEXP_AUI wxAuiSimpleTabArt : public wxAuiTabArt
215 {
216
217 public:
218
219 wxAuiSimpleTabArt();
220 virtual ~wxAuiSimpleTabArt();
221
222 wxAuiTabArt* Clone();
223 void SetFlags(unsigned int flags);
224
225 void SetSizingInfo(const wxSize& tabCtrlSize,
226 size_t tabCount);
227
228 void SetNormalFont(const wxFont& font);
229 void SetSelectedFont(const wxFont& font);
230 void SetMeasuringFont(const wxFont& font);
231 void SetColour(const wxColour& colour);
232 void SetActiveColour(const wxColour& colour);
233
234 void DrawBorder(
235 wxDC& dc,
236 wxWindow* wnd,
237 const wxRect& rect);
238
239 void DrawBackground(
240 wxDC& dc,
241 wxWindow* wnd,
242 const wxRect& rect);
243
244 void DrawTab(wxDC& dc,
245 wxWindow* wnd,
246 const wxAuiNotebookPage& pane,
247 const wxRect& inRect,
248 int closeButtonState,
249 wxRect* outTabRect,
250 wxRect* outButtonRect,
251 int* xExtent);
252
253 void DrawButton(
254 wxDC& dc,
255 wxWindow* wnd,
256 const wxRect& inRect,
257 int bitmapId,
258 int buttonState,
259 int orientation,
260 wxRect* outRect);
261
262 int GetIndentSize();
263
264 int GetBorderWidth(
265 wxWindow* wnd);
266
267 int GetAdditionalBorderSpace(
268 wxWindow* wnd);
269
270 wxSize GetTabSize(
271 wxDC& dc,
272 wxWindow* wnd,
273 const wxString& caption,
274 const wxBitmap& bitmap,
275 bool active,
276 int closeButtonState,
277 int* xExtent);
278
279 int ShowDropDown(
280 wxWindow* wnd,
281 const wxAuiNotebookPageArray& items,
282 int activeIdx);
283
284 int GetBestTabCtrlSize(wxWindow* wnd,
285 const wxAuiNotebookPageArray& pages,
286 const wxSize& requiredBmpSize);
287
288 protected:
289
290 wxFont m_normalFont;
291 wxFont m_selectedFont;
292 wxFont m_measuringFont;
293 wxPen m_normalBkPen;
294 wxPen m_selectedBkPen;
295 wxBrush m_normalBkBrush;
296 wxBrush m_selectedBkBrush;
297 wxBrush m_bkBrush;
298 wxBitmap m_activeCloseBmp;
299 wxBitmap m_disabledCloseBmp;
300 wxBitmap m_activeLeftBmp;
301 wxBitmap m_disabledLeftBmp;
302 wxBitmap m_activeRightBmp;
303 wxBitmap m_disabledRightBmp;
304 wxBitmap m_activeWindowListBmp;
305 wxBitmap m_disabledWindowListBmp;
306
307 int m_fixedTabWidth;
308 unsigned int m_flags;
309 };
310
311 #ifndef __WXUNIVERSAL__
312 #if defined(__WXGTK20__) && !defined(__WXGTK3__)
313 #define wxHAS_NATIVE_TABART
314 #include "wx/aui/tabartgtk.h"
315 #define wxAuiDefaultTabArt wxAuiGtkTabArt
316 #endif
317 #endif // !__WXUNIVERSAL__
318
319 #ifndef wxHAS_NATIVE_TABART
320 #define wxAuiDefaultTabArt wxAuiGenericTabArt
321 #endif
322
323 #endif // wxUSE_AUI
324
325 #endif // _WX_AUI_TABART_H_