]> git.saurik.com Git - wxWidgets.git/blame - include/wx/aui/tabart.h
Set C++ global locale too in wxAppTraitsBase::SetLocale().
[wxWidgets.git] / include / wx / aui / tabart.h
CommitLineData
4758baf5
VZ
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
9dc44eff 7// RCS-ID: $Id$
4758baf5
VZ
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
32class wxAuiNotebookPage;
33class wxAuiNotebookPageArray;
34class wxWindow;
35class wxDC;
36
37
38// tab art class
39
40class WXDLLIMPEXP_AUI wxAuiTabArt
41{
42public:
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
9fa99f04
VZ
59 virtual void DrawBorder(
60 wxDC& dc,
61 wxWindow* wnd,
62 const wxRect& rect) = 0;
63
4758baf5
VZ
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
9fa99f04
VZ
103 virtual int GetBorderWidth(
104 wxWindow* wnd) = 0;
105
4758baf5
VZ
106 virtual int GetBestTabCtrlSize(
107 wxWindow* wnd,
108 const wxAuiNotebookPageArray& pages,
109 const wxSize& requiredBmpSize) = 0;
110};
111
112
113class WXDLLIMPEXP_AUI wxAuiGenericTabArt : public wxAuiTabArt
114{
115
116public:
117
118 wxAuiGenericTabArt();
119 virtual ~wxAuiGenericTabArt();
120
121 wxAuiTabArt* Clone();
122 void SetFlags(unsigned int flags);
123 void SetSizingInfo(const wxSize& tabCtrlSize,
124 size_t tabCount);
125
126 void SetNormalFont(const wxFont& font);
127 void SetSelectedFont(const wxFont& font);
128 void SetMeasuringFont(const wxFont& font);
129 void SetColour(const wxColour& colour);
130 void SetActiveColour(const wxColour& colour);
131
9fa99f04
VZ
132 void DrawBorder(
133 wxDC& dc,
134 wxWindow* wnd,
135 const wxRect& rect);
136
4758baf5
VZ
137 void DrawBackground(
138 wxDC& dc,
139 wxWindow* wnd,
140 const wxRect& rect);
141
142 void DrawTab(wxDC& dc,
143 wxWindow* wnd,
144 const wxAuiNotebookPage& pane,
145 const wxRect& inRect,
146 int closeButtonState,
147 wxRect* outTabRect,
148 wxRect* outButtonRect,
149 int* xExtent);
150
151 void DrawButton(
152 wxDC& dc,
153 wxWindow* wnd,
154 const wxRect& inRect,
155 int bitmapId,
156 int buttonState,
157 int orientation,
158 wxRect* outRect);
159
160 int GetIndentSize();
161
9fa99f04
VZ
162 int GetBorderWidth(
163 wxWindow* wnd);
164
4758baf5
VZ
165 wxSize GetTabSize(
166 wxDC& dc,
167 wxWindow* wnd,
168 const wxString& caption,
169 const wxBitmap& bitmap,
170 bool active,
171 int closeButtonState,
172 int* xExtent);
173
174 int ShowDropDown(
175 wxWindow* wnd,
176 const wxAuiNotebookPageArray& items,
177 int activeIdx);
178
179 int GetBestTabCtrlSize(wxWindow* wnd,
180 const wxAuiNotebookPageArray& pages,
181 const wxSize& requiredBmpSize);
182
183protected:
184
185 wxFont m_normalFont;
186 wxFont m_selectedFont;
187 wxFont m_measuringFont;
188 wxColour m_baseColour;
189 wxPen m_baseColourPen;
190 wxPen m_borderPen;
191 wxBrush m_baseColourBrush;
192 wxColour m_activeColour;
193 wxBitmap m_activeCloseBmp;
194 wxBitmap m_disabledCloseBmp;
195 wxBitmap m_activeLeftBmp;
196 wxBitmap m_disabledLeftBmp;
197 wxBitmap m_activeRightBmp;
198 wxBitmap m_disabledRightBmp;
199 wxBitmap m_activeWindowListBmp;
200 wxBitmap m_disabledWindowListBmp;
201
202 int m_fixedTabWidth;
203 int m_tabCtrlHeight;
204 unsigned int m_flags;
205};
206
207
208class WXDLLIMPEXP_AUI wxAuiSimpleTabArt : public wxAuiTabArt
209{
210
211public:
212
213 wxAuiSimpleTabArt();
214 virtual ~wxAuiSimpleTabArt();
215
216 wxAuiTabArt* Clone();
217 void SetFlags(unsigned int flags);
218
219 void SetSizingInfo(const wxSize& tabCtrlSize,
220 size_t tabCount);
221
222 void SetNormalFont(const wxFont& font);
223 void SetSelectedFont(const wxFont& font);
224 void SetMeasuringFont(const wxFont& font);
225 void SetColour(const wxColour& colour);
226 void SetActiveColour(const wxColour& colour);
227
9fa99f04
VZ
228 void DrawBorder(
229 wxDC& dc,
230 wxWindow* wnd,
231 const wxRect& rect);
232
4758baf5
VZ
233 void DrawBackground(
234 wxDC& dc,
235 wxWindow* wnd,
236 const wxRect& rect);
237
238 void DrawTab(wxDC& dc,
239 wxWindow* wnd,
240 const wxAuiNotebookPage& pane,
241 const wxRect& inRect,
242 int closeButtonState,
243 wxRect* outTabRect,
244 wxRect* outButtonRect,
245 int* xExtent);
246
247 void DrawButton(
248 wxDC& dc,
249 wxWindow* wnd,
250 const wxRect& inRect,
251 int bitmapId,
252 int buttonState,
253 int orientation,
254 wxRect* outRect);
255
256 int GetIndentSize();
257
9fa99f04
VZ
258 int GetBorderWidth(
259 wxWindow* wnd);
260
4758baf5
VZ
261 wxSize GetTabSize(
262 wxDC& dc,
263 wxWindow* wnd,
264 const wxString& caption,
265 const wxBitmap& bitmap,
266 bool active,
267 int closeButtonState,
268 int* xExtent);
269
270 int ShowDropDown(
271 wxWindow* wnd,
272 const wxAuiNotebookPageArray& items,
273 int activeIdx);
274
275 int GetBestTabCtrlSize(wxWindow* wnd,
276 const wxAuiNotebookPageArray& pages,
277 const wxSize& requiredBmpSize);
278
279protected:
280
281 wxFont m_normalFont;
282 wxFont m_selectedFont;
283 wxFont m_measuringFont;
284 wxPen m_normalBkPen;
285 wxPen m_selectedBkPen;
286 wxBrush m_normalBkBrush;
287 wxBrush m_selectedBkBrush;
288 wxBrush m_bkBrush;
289 wxBitmap m_activeCloseBmp;
290 wxBitmap m_disabledCloseBmp;
291 wxBitmap m_activeLeftBmp;
292 wxBitmap m_disabledLeftBmp;
293 wxBitmap m_activeRightBmp;
294 wxBitmap m_disabledRightBmp;
295 wxBitmap m_activeWindowListBmp;
296 wxBitmap m_disabledWindowListBmp;
297
298 int m_fixedTabWidth;
299 unsigned int m_flags;
300};
301
069358b7 302#ifndef __WXUNIVERSAL__
9dc44eff 303 #if defined(__WXGTK20__) && !defined(__WXGTK3__)
069358b7
VZ
304 #define wxHAS_NATIVE_TABART
305 #include "wx/aui/tabartgtk.h"
306 #define wxAuiDefaultTabArt wxAuiGtkTabArt
307 #endif
308#endif // !__WXUNIVERSAL__
309
310#ifndef wxHAS_NATIVE_TABART
311 #define wxAuiDefaultTabArt wxAuiGenericTabArt
312#endif
4758baf5
VZ
313
314#endif // wxUSE_AUI
315
316#endif // _WX_AUI_TABART_H_