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