]>
Commit | Line | Data |
---|---|---|
3c3ead1d PC |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/ribbon/art.h | |
3 | // Purpose: Art providers for ribbon-bar-style interface | |
4 | // Author: Peter Cawley | |
5 | // Modified by: | |
6 | // Created: 2009-05-25 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (C) Peter Cawley | |
9 | // Licence: wxWindows licence | |
10 | /////////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_RIBBON_ART_H_ | |
13 | #define _WX_RIBBON_ART_H_ | |
14 | ||
15 | #include "wx/defs.h" | |
16 | ||
17 | #if wxUSE_RIBBON | |
18 | ||
14371273 SC |
19 | #include "wx/brush.h" |
20 | #include "wx/colour.h" | |
21 | #include "wx/font.h" | |
22 | #include "wx/pen.h" | |
23 | #include "wx/bitmap.h" | |
3c3ead1d | 24 | |
91d33c61 VZ |
25 | class WXDLLIMPEXP_FWD_CORE wxDC; |
26 | class WXDLLIMPEXP_FWD_CORE wxWindow; | |
27 | ||
3c3ead1d PC |
28 | enum wxRibbonArtSetting |
29 | { | |
30 | wxRIBBON_ART_TAB_SEPARATION_SIZE, | |
31 | wxRIBBON_ART_PAGE_BORDER_LEFT_SIZE, | |
32 | wxRIBBON_ART_PAGE_BORDER_TOP_SIZE, | |
33 | wxRIBBON_ART_PAGE_BORDER_RIGHT_SIZE, | |
34 | wxRIBBON_ART_PAGE_BORDER_BOTTOM_SIZE, | |
35 | wxRIBBON_ART_PANEL_X_SEPARATION_SIZE, | |
36 | wxRIBBON_ART_PANEL_Y_SEPARATION_SIZE, | |
37 | wxRIBBON_ART_TOOL_GROUP_SEPARATION_SIZE, | |
38 | wxRIBBON_ART_GALLERY_BITMAP_PADDING_LEFT_SIZE, | |
39 | wxRIBBON_ART_GALLERY_BITMAP_PADDING_RIGHT_SIZE, | |
40 | wxRIBBON_ART_GALLERY_BITMAP_PADDING_TOP_SIZE, | |
41 | wxRIBBON_ART_GALLERY_BITMAP_PADDING_BOTTOM_SIZE, | |
42 | wxRIBBON_ART_PANEL_LABEL_FONT, | |
43 | wxRIBBON_ART_BUTTON_BAR_LABEL_FONT, | |
44 | wxRIBBON_ART_TAB_LABEL_FONT, | |
45 | wxRIBBON_ART_BUTTON_BAR_LABEL_COLOUR, | |
46 | wxRIBBON_ART_BUTTON_BAR_HOVER_BORDER_COLOUR, | |
47 | wxRIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_TOP_COLOUR, | |
48 | wxRIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR, | |
49 | wxRIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_COLOUR, | |
50 | wxRIBBON_ART_BUTTON_BAR_HOVER_BACKGROUND_GRADIENT_COLOUR, | |
51 | wxRIBBON_ART_BUTTON_BAR_ACTIVE_BORDER_COLOUR, | |
52 | wxRIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_TOP_COLOUR, | |
53 | wxRIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR, | |
54 | wxRIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_COLOUR, | |
55 | wxRIBBON_ART_BUTTON_BAR_ACTIVE_BACKGROUND_GRADIENT_COLOUR, | |
56 | wxRIBBON_ART_GALLERY_BORDER_COLOUR, | |
57 | wxRIBBON_ART_GALLERY_HOVER_BACKGROUND_COLOUR, | |
58 | wxRIBBON_ART_GALLERY_BUTTON_BACKGROUND_COLOUR, | |
59 | wxRIBBON_ART_GALLERY_BUTTON_BACKGROUND_GRADIENT_COLOUR, | |
60 | wxRIBBON_ART_GALLERY_BUTTON_BACKGROUND_TOP_COLOUR, | |
61 | wxRIBBON_ART_GALLERY_BUTTON_FACE_COLOUR, | |
62 | wxRIBBON_ART_GALLERY_BUTTON_HOVER_BACKGROUND_COLOUR, | |
63 | wxRIBBON_ART_GALLERY_BUTTON_HOVER_BACKGROUND_GRADIENT_COLOUR, | |
64 | wxRIBBON_ART_GALLERY_BUTTON_HOVER_BACKGROUND_TOP_COLOUR, | |
65 | wxRIBBON_ART_GALLERY_BUTTON_HOVER_FACE_COLOUR, | |
66 | wxRIBBON_ART_GALLERY_BUTTON_ACTIVE_BACKGROUND_COLOUR, | |
67 | wxRIBBON_ART_GALLERY_BUTTON_ACTIVE_BACKGROUND_GRADIENT_COLOUR, | |
68 | wxRIBBON_ART_GALLERY_BUTTON_ACTIVE_BACKGROUND_TOP_COLOUR, | |
69 | wxRIBBON_ART_GALLERY_BUTTON_ACTIVE_FACE_COLOUR, | |
70 | wxRIBBON_ART_GALLERY_BUTTON_DISABLED_BACKGROUND_COLOUR, | |
71 | wxRIBBON_ART_GALLERY_BUTTON_DISABLED_BACKGROUND_GRADIENT_COLOUR, | |
72 | wxRIBBON_ART_GALLERY_BUTTON_DISABLED_BACKGROUND_TOP_COLOUR, | |
73 | wxRIBBON_ART_GALLERY_BUTTON_DISABLED_FACE_COLOUR, | |
74 | wxRIBBON_ART_GALLERY_ITEM_BORDER_COLOUR, | |
75 | wxRIBBON_ART_TAB_LABEL_COLOUR, | |
76 | wxRIBBON_ART_TAB_SEPARATOR_COLOUR, | |
77 | wxRIBBON_ART_TAB_SEPARATOR_GRADIENT_COLOUR, | |
78 | wxRIBBON_ART_TAB_CTRL_BACKGROUND_COLOUR, | |
79 | wxRIBBON_ART_TAB_CTRL_BACKGROUND_GRADIENT_COLOUR, | |
80 | wxRIBBON_ART_TAB_HOVER_BACKGROUND_TOP_COLOUR, | |
81 | wxRIBBON_ART_TAB_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR, | |
82 | wxRIBBON_ART_TAB_HOVER_BACKGROUND_COLOUR, | |
83 | wxRIBBON_ART_TAB_HOVER_BACKGROUND_GRADIENT_COLOUR, | |
84 | wxRIBBON_ART_TAB_ACTIVE_BACKGROUND_TOP_COLOUR, | |
85 | wxRIBBON_ART_TAB_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR, | |
86 | wxRIBBON_ART_TAB_ACTIVE_BACKGROUND_COLOUR, | |
87 | wxRIBBON_ART_TAB_ACTIVE_BACKGROUND_GRADIENT_COLOUR, | |
88 | wxRIBBON_ART_TAB_BORDER_COLOUR, | |
89 | wxRIBBON_ART_PANEL_BORDER_COLOUR, | |
90 | wxRIBBON_ART_PANEL_BORDER_GRADIENT_COLOUR, | |
91 | wxRIBBON_ART_PANEL_MINIMISED_BORDER_COLOUR, | |
92 | wxRIBBON_ART_PANEL_MINIMISED_BORDER_GRADIENT_COLOUR, | |
93 | wxRIBBON_ART_PANEL_LABEL_BACKGROUND_COLOUR, | |
94 | wxRIBBON_ART_PANEL_LABEL_BACKGROUND_GRADIENT_COLOUR, | |
95 | wxRIBBON_ART_PANEL_LABEL_COLOUR, | |
96 | wxRIBBON_ART_PANEL_HOVER_LABEL_BACKGROUND_COLOUR, | |
97 | wxRIBBON_ART_PANEL_HOVER_LABEL_BACKGROUND_GRADIENT_COLOUR, | |
98 | wxRIBBON_ART_PANEL_HOVER_LABEL_COLOUR, | |
99 | wxRIBBON_ART_PANEL_MINIMISED_LABEL_COLOUR, | |
100 | wxRIBBON_ART_PANEL_ACTIVE_BACKGROUND_TOP_COLOUR, | |
101 | wxRIBBON_ART_PANEL_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR, | |
102 | wxRIBBON_ART_PANEL_ACTIVE_BACKGROUND_COLOUR, | |
103 | wxRIBBON_ART_PANEL_ACTIVE_BACKGROUND_GRADIENT_COLOUR, | |
104 | wxRIBBON_ART_PAGE_BORDER_COLOUR, | |
105 | wxRIBBON_ART_PAGE_BACKGROUND_TOP_COLOUR, | |
106 | wxRIBBON_ART_PAGE_BACKGROUND_TOP_GRADIENT_COLOUR, | |
107 | wxRIBBON_ART_PAGE_BACKGROUND_COLOUR, | |
108 | wxRIBBON_ART_PAGE_BACKGROUND_GRADIENT_COLOUR, | |
109 | wxRIBBON_ART_PAGE_HOVER_BACKGROUND_TOP_COLOUR, | |
110 | wxRIBBON_ART_PAGE_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR, | |
111 | wxRIBBON_ART_PAGE_HOVER_BACKGROUND_COLOUR, | |
112 | wxRIBBON_ART_PAGE_HOVER_BACKGROUND_GRADIENT_COLOUR, | |
113 | wxRIBBON_ART_TOOLBAR_BORDER_COLOUR, | |
114 | wxRIBBON_ART_TOOLBAR_HOVER_BORDER_COLOUR, | |
115 | wxRIBBON_ART_TOOLBAR_FACE_COLOUR, | |
116 | wxRIBBON_ART_TOOL_BACKGROUND_TOP_COLOUR, | |
117 | wxRIBBON_ART_TOOL_BACKGROUND_TOP_GRADIENT_COLOUR, | |
118 | wxRIBBON_ART_TOOL_BACKGROUND_COLOUR, | |
119 | wxRIBBON_ART_TOOL_BACKGROUND_GRADIENT_COLOUR, | |
120 | wxRIBBON_ART_TOOL_HOVER_BACKGROUND_TOP_COLOUR, | |
121 | wxRIBBON_ART_TOOL_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR, | |
122 | wxRIBBON_ART_TOOL_HOVER_BACKGROUND_COLOUR, | |
123 | wxRIBBON_ART_TOOL_HOVER_BACKGROUND_GRADIENT_COLOUR, | |
124 | wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_TOP_COLOUR, | |
125 | wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR, | |
126 | wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_COLOUR, | |
127 | wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_GRADIENT_COLOUR, | |
128 | }; | |
129 | ||
130 | enum wxRibbonScrollButtonStyle | |
131 | { | |
132 | wxRIBBON_SCROLL_BTN_LEFT = 0, | |
133 | wxRIBBON_SCROLL_BTN_RIGHT = 1, | |
134 | wxRIBBON_SCROLL_BTN_UP = 2, | |
135 | wxRIBBON_SCROLL_BTN_DOWN = 3, | |
136 | ||
137 | wxRIBBON_SCROLL_BTN_DIRECTION_MASK = 3, | |
138 | ||
139 | wxRIBBON_SCROLL_BTN_NORMAL = 0, | |
140 | wxRIBBON_SCROLL_BTN_HOVERED = 4, | |
141 | wxRIBBON_SCROLL_BTN_ACTIVE = 8, | |
142 | ||
143 | wxRIBBON_SCROLL_BTN_STATE_MASK = 12, | |
144 | ||
145 | wxRIBBON_SCROLL_BTN_FOR_OTHER = 0, | |
146 | wxRIBBON_SCROLL_BTN_FOR_TABS = 16, | |
147 | wxRIBBON_SCROLL_BTN_FOR_PAGE = 32, | |
148 | ||
149 | wxRIBBON_SCROLL_BTN_FOR_MASK = 48, | |
150 | }; | |
151 | ||
152 | enum wxRibbonButtonKind | |
153 | { | |
154 | wxRIBBON_BUTTON_NORMAL = 1 << 0, | |
155 | wxRIBBON_BUTTON_DROPDOWN = 1 << 1, | |
156 | wxRIBBON_BUTTON_HYBRID = wxRIBBON_BUTTON_NORMAL | wxRIBBON_BUTTON_DROPDOWN, | |
955bad41 | 157 | wxRIBBON_BUTTON_TOGGLE = 1 << 2 |
3c3ead1d PC |
158 | }; |
159 | ||
160 | enum wxRibbonButtonBarButtonState | |
161 | { | |
162 | wxRIBBON_BUTTONBAR_BUTTON_SMALL = 0 << 0, | |
163 | wxRIBBON_BUTTONBAR_BUTTON_MEDIUM = 1 << 0, | |
164 | wxRIBBON_BUTTONBAR_BUTTON_LARGE = 2 << 0, | |
165 | wxRIBBON_BUTTONBAR_BUTTON_SIZE_MASK = 3 << 0, | |
166 | ||
167 | wxRIBBON_BUTTONBAR_BUTTON_NORMAL_HOVERED = 1 << 3, | |
168 | wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_HOVERED = 1 << 4, | |
169 | wxRIBBON_BUTTONBAR_BUTTON_HOVER_MASK = wxRIBBON_BUTTONBAR_BUTTON_NORMAL_HOVERED | wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_HOVERED, | |
170 | wxRIBBON_BUTTONBAR_BUTTON_NORMAL_ACTIVE = 1 << 5, | |
171 | wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE = 1 << 6, | |
172 | wxRIBBON_BUTTONBAR_BUTTON_ACTIVE_MASK = wxRIBBON_BUTTONBAR_BUTTON_NORMAL_ACTIVE | wxRIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE, | |
173 | wxRIBBON_BUTTONBAR_BUTTON_DISABLED = 1 << 7, | |
955bad41 PC |
174 | wxRIBBON_BUTTONBAR_BUTTON_TOGGLED = 1 << 8, |
175 | wxRIBBON_BUTTONBAR_BUTTON_STATE_MASK = 0x1F8, | |
3c3ead1d PC |
176 | }; |
177 | ||
178 | enum wxRibbonGalleryButtonState | |
179 | { | |
180 | wxRIBBON_GALLERY_BUTTON_NORMAL, | |
181 | wxRIBBON_GALLERY_BUTTON_HOVERED, | |
182 | wxRIBBON_GALLERY_BUTTON_ACTIVE, | |
183 | wxRIBBON_GALLERY_BUTTON_DISABLED, | |
184 | }; | |
185 | ||
186 | class wxRibbonPage; | |
187 | class wxRibbonPanel; | |
188 | class wxRibbonGallery; | |
189 | class wxRibbonGalleryItem; | |
190 | class wxRibbonPageTabInfo; | |
191 | class wxRibbonPageTabInfoArray; | |
192 | ||
193 | class WXDLLIMPEXP_RIBBON wxRibbonArtProvider | |
194 | { | |
195 | public: | |
196 | wxRibbonArtProvider(); | |
197 | virtual ~wxRibbonArtProvider(); | |
198 | ||
199 | virtual wxRibbonArtProvider* Clone() const = 0; | |
200 | virtual void SetFlags(long flags) = 0; | |
201 | virtual long GetFlags() const = 0; | |
202 | ||
203 | virtual int GetMetric(int id) const = 0; | |
204 | virtual void SetMetric(int id, int new_val) = 0; | |
205 | virtual void SetFont(int id, const wxFont& font) = 0; | |
206 | virtual wxFont GetFont(int id) const = 0; | |
207 | virtual wxColour GetColour(int id) const = 0; | |
208 | virtual void SetColour(int id, const wxColor& colour) = 0; | |
209 | wxColour GetColor(int id) const { return GetColour(id); } | |
210 | void SetColor(int id, const wxColour& color) { SetColour(id, color); } | |
211 | virtual void GetColourScheme(wxColour* primary, | |
212 | wxColour* secondary, | |
213 | wxColour* tertiary) const = 0; | |
214 | virtual void SetColourScheme(const wxColour& primary, | |
215 | const wxColour& secondary, | |
216 | const wxColour& tertiary) = 0; | |
217 | ||
218 | virtual void DrawTabCtrlBackground( | |
219 | wxDC& dc, | |
220 | wxWindow* wnd, | |
221 | const wxRect& rect) = 0; | |
222 | ||
223 | virtual void DrawTab(wxDC& dc, | |
224 | wxWindow* wnd, | |
225 | const wxRibbonPageTabInfo& tab) = 0; | |
226 | ||
227 | virtual void DrawTabSeparator(wxDC& dc, | |
228 | wxWindow* wnd, | |
229 | const wxRect& rect, | |
230 | double visibility) = 0; | |
231 | ||
232 | virtual void DrawPageBackground( | |
233 | wxDC& dc, | |
234 | wxWindow* wnd, | |
235 | const wxRect& rect) = 0; | |
236 | ||
237 | virtual void DrawScrollButton( | |
238 | wxDC& dc, | |
239 | wxWindow* wnd, | |
240 | const wxRect& rect, | |
241 | long style) = 0; | |
242 | ||
243 | virtual void DrawPanelBackground( | |
244 | wxDC& dc, | |
245 | wxRibbonPanel* wnd, | |
246 | const wxRect& rect) = 0; | |
247 | ||
248 | virtual void DrawGalleryBackground( | |
249 | wxDC& dc, | |
250 | wxRibbonGallery* wnd, | |
251 | const wxRect& rect) = 0; | |
252 | ||
253 | virtual void DrawGalleryItemBackground( | |
254 | wxDC& dc, | |
255 | wxRibbonGallery* wnd, | |
256 | const wxRect& rect, | |
257 | wxRibbonGalleryItem* item) = 0; | |
258 | ||
259 | virtual void DrawMinimisedPanel( | |
260 | wxDC& dc, | |
261 | wxRibbonPanel* wnd, | |
262 | const wxRect& rect, | |
263 | wxBitmap& bitmap) = 0; | |
264 | ||
265 | virtual void DrawButtonBarBackground( | |
266 | wxDC& dc, | |
267 | wxWindow* wnd, | |
268 | const wxRect& rect) = 0; | |
269 | ||
270 | virtual void DrawButtonBarButton( | |
271 | wxDC& dc, | |
272 | wxWindow* wnd, | |
273 | const wxRect& rect, | |
274 | wxRibbonButtonKind kind, | |
275 | long state, | |
276 | const wxString& label, | |
277 | const wxBitmap& bitmap_large, | |
278 | const wxBitmap& bitmap_small) = 0; | |
279 | ||
280 | virtual void DrawToolBarBackground( | |
281 | wxDC& dc, | |
282 | wxWindow* wnd, | |
283 | const wxRect& rect) = 0; | |
284 | ||
285 | virtual void DrawToolGroupBackground( | |
286 | wxDC& dc, | |
287 | wxWindow* wnd, | |
288 | const wxRect& rect) = 0; | |
289 | ||
290 | virtual void DrawTool( | |
291 | wxDC& dc, | |
292 | wxWindow* wnd, | |
293 | const wxRect& rect, | |
294 | const wxBitmap& bitmap, | |
295 | wxRibbonButtonKind kind, | |
296 | long state) = 0; | |
297 | ||
298 | virtual void GetBarTabWidth( | |
299 | wxDC& dc, | |
300 | wxWindow* wnd, | |
301 | const wxString& label, | |
302 | const wxBitmap& bitmap, | |
303 | int* ideal, | |
304 | int* small_begin_need_separator, | |
305 | int* small_must_have_separator, | |
306 | int* minimum) = 0; | |
307 | ||
308 | virtual int GetTabCtrlHeight( | |
309 | wxDC& dc, | |
310 | wxWindow* wnd, | |
311 | const wxRibbonPageTabInfoArray& pages) = 0; | |
312 | ||
313 | virtual wxSize GetScrollButtonMinimumSize( | |
314 | wxDC& dc, | |
315 | wxWindow* wnd, | |
316 | long style) = 0; | |
317 | ||
318 | virtual wxSize GetPanelSize( | |
319 | wxDC& dc, | |
320 | const wxRibbonPanel* wnd, | |
321 | wxSize client_size, | |
322 | wxPoint* client_offset) = 0; | |
323 | ||
324 | virtual wxSize GetPanelClientSize( | |
325 | wxDC& dc, | |
326 | const wxRibbonPanel* wnd, | |
327 | wxSize size, | |
328 | wxPoint* client_offset) = 0; | |
329 | ||
330 | virtual wxSize GetGallerySize( | |
331 | wxDC& dc, | |
332 | const wxRibbonGallery* wnd, | |
333 | wxSize client_size) = 0; | |
334 | ||
335 | virtual wxSize GetGalleryClientSize( | |
336 | wxDC& dc, | |
337 | const wxRibbonGallery* wnd, | |
338 | wxSize size, | |
339 | wxPoint* client_offset, | |
340 | wxRect* scroll_up_button, | |
341 | wxRect* scroll_down_button, | |
342 | wxRect* extension_button) = 0; | |
343 | ||
344 | virtual wxRect GetPageBackgroundRedrawArea( | |
345 | wxDC& dc, | |
346 | const wxRibbonPage* wnd, | |
347 | wxSize page_old_size, | |
348 | wxSize page_new_size) = 0; | |
349 | ||
350 | virtual bool GetButtonBarButtonSize( | |
351 | wxDC& dc, | |
352 | wxWindow* wnd, | |
353 | wxRibbonButtonKind kind, | |
354 | wxRibbonButtonBarButtonState size, | |
355 | const wxString& label, | |
356 | wxSize bitmap_size_large, | |
357 | wxSize bitmap_size_small, | |
358 | wxSize* button_size, | |
359 | wxRect* normal_region, | |
360 | wxRect* dropdown_region) = 0; | |
361 | ||
362 | virtual wxSize GetMinimisedPanelMinimumSize( | |
363 | wxDC& dc, | |
364 | const wxRibbonPanel* wnd, | |
365 | wxSize* desired_bitmap_size, | |
366 | wxDirection* expanded_panel_direction) = 0; | |
367 | ||
368 | virtual wxSize GetToolSize( | |
369 | wxDC& dc, | |
370 | wxWindow* wnd, | |
371 | wxSize bitmap_size, | |
372 | wxRibbonButtonKind kind, | |
373 | bool is_first, | |
374 | bool is_last, | |
375 | wxRect* dropdown_region) = 0; | |
376 | }; | |
377 | ||
378 | class WXDLLIMPEXP_RIBBON wxRibbonMSWArtProvider : public wxRibbonArtProvider | |
379 | { | |
380 | public: | |
381 | wxRibbonMSWArtProvider(bool set_colour_scheme = true); | |
382 | virtual ~wxRibbonMSWArtProvider(); | |
383 | ||
384 | wxRibbonArtProvider* Clone() const; | |
385 | void SetFlags(long flags); | |
386 | long GetFlags() const; | |
387 | ||
388 | int GetMetric(int id) const; | |
389 | void SetMetric(int id, int new_val); | |
390 | void SetFont(int id, const wxFont& font); | |
391 | wxFont GetFont(int id) const; | |
392 | wxColour GetColour(int id) const; | |
393 | void SetColour(int id, const wxColor& colour); | |
394 | void GetColourScheme(wxColour* primary, | |
395 | wxColour* secondary, | |
396 | wxColour* tertiary) const; | |
397 | void SetColourScheme(const wxColour& primary, | |
398 | const wxColour& secondary, | |
399 | const wxColour& tertiary); | |
400 | ||
401 | int GetTabCtrlHeight( | |
402 | wxDC& dc, | |
403 | wxWindow* wnd, | |
404 | const wxRibbonPageTabInfoArray& pages); | |
405 | ||
406 | void DrawTabCtrlBackground( | |
407 | wxDC& dc, | |
408 | wxWindow* wnd, | |
409 | const wxRect& rect); | |
410 | ||
411 | void DrawTab(wxDC& dc, | |
412 | wxWindow* wnd, | |
413 | const wxRibbonPageTabInfo& tab); | |
414 | ||
415 | void DrawTabSeparator( | |
416 | wxDC& dc, | |
417 | wxWindow* wnd, | |
418 | const wxRect& rect, | |
419 | double visibility); | |
420 | ||
421 | void DrawPageBackground( | |
422 | wxDC& dc, | |
423 | wxWindow* wnd, | |
424 | const wxRect& rect); | |
425 | ||
426 | void DrawScrollButton( | |
427 | wxDC& dc, | |
428 | wxWindow* wnd, | |
429 | const wxRect& rect, | |
430 | long style); | |
431 | ||
432 | void DrawPanelBackground( | |
433 | wxDC& dc, | |
434 | wxRibbonPanel* wnd, | |
435 | const wxRect& rect); | |
436 | ||
437 | void DrawGalleryBackground( | |
438 | wxDC& dc, | |
439 | wxRibbonGallery* wnd, | |
440 | const wxRect& rect); | |
441 | ||
442 | void DrawGalleryItemBackground( | |
443 | wxDC& dc, | |
444 | wxRibbonGallery* wnd, | |
445 | const wxRect& rect, | |
446 | wxRibbonGalleryItem* item); | |
447 | ||
448 | void DrawMinimisedPanel( | |
449 | wxDC& dc, | |
450 | wxRibbonPanel* wnd, | |
451 | const wxRect& rect, | |
452 | wxBitmap& bitmap); | |
453 | ||
454 | void DrawButtonBarBackground( | |
455 | wxDC& dc, | |
456 | wxWindow* wnd, | |
457 | const wxRect& rect); | |
458 | ||
459 | void DrawButtonBarButton( | |
460 | wxDC& dc, | |
461 | wxWindow* wnd, | |
462 | const wxRect& rect, | |
463 | wxRibbonButtonKind kind, | |
464 | long state, | |
465 | const wxString& label, | |
466 | const wxBitmap& bitmap_large, | |
467 | const wxBitmap& bitmap_small); | |
468 | ||
469 | void DrawToolBarBackground( | |
470 | wxDC& dc, | |
471 | wxWindow* wnd, | |
472 | const wxRect& rect); | |
473 | ||
474 | void DrawToolGroupBackground( | |
475 | wxDC& dc, | |
476 | wxWindow* wnd, | |
477 | const wxRect& rect); | |
478 | ||
479 | void DrawTool( | |
480 | wxDC& dc, | |
481 | wxWindow* wnd, | |
482 | const wxRect& rect, | |
483 | const wxBitmap& bitmap, | |
484 | wxRibbonButtonKind kind, | |
485 | long state); | |
486 | ||
487 | void GetBarTabWidth( | |
488 | wxDC& dc, | |
489 | wxWindow* wnd, | |
490 | const wxString& label, | |
491 | const wxBitmap& bitmap, | |
492 | int* ideal, | |
493 | int* small_begin_need_separator, | |
494 | int* small_must_have_separator, | |
495 | int* minimum); | |
496 | ||
497 | wxSize GetScrollButtonMinimumSize( | |
498 | wxDC& dc, | |
499 | wxWindow* wnd, | |
500 | long style); | |
501 | ||
502 | wxSize GetPanelSize( | |
503 | wxDC& dc, | |
504 | const wxRibbonPanel* wnd, | |
505 | wxSize client_size, | |
506 | wxPoint* client_offset); | |
507 | ||
508 | wxSize GetPanelClientSize( | |
509 | wxDC& dc, | |
510 | const wxRibbonPanel* wnd, | |
511 | wxSize size, | |
512 | wxPoint* client_offset); | |
513 | ||
514 | wxSize GetGallerySize( | |
515 | wxDC& dc, | |
516 | const wxRibbonGallery* wnd, | |
517 | wxSize client_size); | |
518 | ||
519 | wxSize GetGalleryClientSize( | |
520 | wxDC& dc, | |
521 | const wxRibbonGallery* wnd, | |
522 | wxSize size, | |
523 | wxPoint* client_offset, | |
524 | wxRect* scroll_up_button, | |
525 | wxRect* scroll_down_button, | |
526 | wxRect* extension_button); | |
527 | ||
528 | wxRect GetPageBackgroundRedrawArea( | |
529 | wxDC& dc, | |
530 | const wxRibbonPage* wnd, | |
531 | wxSize page_old_size, | |
532 | wxSize page_new_size); | |
533 | ||
534 | bool GetButtonBarButtonSize( | |
535 | wxDC& dc, | |
536 | wxWindow* wnd, | |
537 | wxRibbonButtonKind kind, | |
538 | wxRibbonButtonBarButtonState size, | |
539 | const wxString& label, | |
540 | wxSize bitmap_size_large, | |
541 | wxSize bitmap_size_small, | |
542 | wxSize* button_size, | |
543 | wxRect* normal_region, | |
544 | wxRect* dropdown_region); | |
545 | ||
546 | wxSize GetMinimisedPanelMinimumSize( | |
547 | wxDC& dc, | |
548 | const wxRibbonPanel* wnd, | |
549 | wxSize* desired_bitmap_size, | |
550 | wxDirection* expanded_panel_direction); | |
551 | ||
552 | wxSize GetToolSize( | |
553 | wxDC& dc, | |
554 | wxWindow* wnd, | |
555 | wxSize bitmap_size, | |
556 | wxRibbonButtonKind kind, | |
557 | bool is_first, | |
558 | bool is_last, | |
559 | wxRect* dropdown_region); | |
560 | ||
561 | protected: | |
562 | void ReallyDrawTabSeparator(wxWindow* wnd, const wxRect& rect, double visibility); | |
563 | void DrawPartialPageBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect, | |
564 | bool allow_hovered = true); | |
565 | void DrawPartialPageBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect, | |
566 | wxRibbonPage* page, wxPoint offset, bool hovered = false); | |
567 | void DrawPanelBorder(wxDC& dc, const wxRect& rect, wxPen& primary_colour, | |
568 | wxPen& secondary_colour); | |
569 | void RemovePanelPadding(wxRect* rect); | |
570 | void DrawDropdownArrow(wxDC& dc, int x, int y, const wxColour& colour); | |
571 | void DrawGalleryBackgroundCommon(wxDC& dc, wxRibbonGallery* wnd, | |
572 | const wxRect& rect); | |
573 | virtual void DrawGalleryButton(wxDC& dc, wxRect rect, | |
574 | wxRibbonGalleryButtonState state, wxBitmap* bitmaps); | |
575 | void DrawButtonBarButtonForeground( | |
576 | wxDC& dc, | |
577 | const wxRect& rect, | |
578 | wxRibbonButtonKind kind, | |
579 | long state, | |
580 | const wxString& label, | |
581 | const wxBitmap& bitmap_large, | |
582 | const wxBitmap& bitmap_small); | |
583 | void DrawMinimisedPanelCommon( | |
584 | wxDC& dc, | |
585 | wxRibbonPanel* wnd, | |
586 | const wxRect& rect, | |
587 | wxRect* preview_rect); | |
588 | void CloneTo(wxRibbonMSWArtProvider* copy) const; | |
589 | ||
590 | wxBitmap m_cached_tab_separator; | |
591 | wxBitmap m_gallery_up_bitmap[4]; | |
592 | wxBitmap m_gallery_down_bitmap[4]; | |
593 | wxBitmap m_gallery_extension_bitmap[4]; | |
594 | wxBitmap m_toolbar_drop_bitmap; | |
595 | ||
596 | wxColour m_primary_scheme_colour; | |
597 | wxColour m_secondary_scheme_colour; | |
598 | wxColour m_tertiary_scheme_colour; | |
599 | ||
600 | wxColour m_button_bar_label_colour; | |
601 | wxColour m_tab_label_colour; | |
602 | wxColour m_tab_separator_colour; | |
603 | wxColour m_tab_separator_gradient_colour; | |
604 | wxColour m_tab_active_background_colour; | |
605 | wxColour m_tab_active_background_gradient_colour; | |
606 | wxColour m_tab_hover_background_colour; | |
607 | wxColour m_tab_hover_background_gradient_colour; | |
608 | wxColour m_tab_hover_background_top_colour; | |
609 | wxColour m_tab_hover_background_top_gradient_colour; | |
610 | wxColour m_panel_label_colour; | |
611 | wxColour m_panel_minimised_label_colour; | |
612 | wxColour m_panel_hover_label_colour; | |
613 | wxColour m_panel_active_background_colour; | |
614 | wxColour m_panel_active_background_gradient_colour; | |
615 | wxColour m_panel_active_background_top_colour; | |
616 | wxColour m_panel_active_background_top_gradient_colour; | |
617 | wxColour m_page_background_colour; | |
618 | wxColour m_page_background_gradient_colour; | |
619 | wxColour m_page_background_top_colour; | |
620 | wxColour m_page_background_top_gradient_colour; | |
621 | wxColour m_page_hover_background_colour; | |
622 | wxColour m_page_hover_background_gradient_colour; | |
623 | wxColour m_page_hover_background_top_colour; | |
624 | wxColour m_page_hover_background_top_gradient_colour; | |
625 | wxColour m_button_bar_hover_background_colour; | |
626 | wxColour m_button_bar_hover_background_gradient_colour; | |
627 | wxColour m_button_bar_hover_background_top_colour; | |
628 | wxColour m_button_bar_hover_background_top_gradient_colour; | |
629 | wxColour m_button_bar_active_background_colour; | |
630 | wxColour m_button_bar_active_background_gradient_colour; | |
631 | wxColour m_button_bar_active_background_top_colour; | |
632 | wxColour m_button_bar_active_background_top_gradient_colour; | |
633 | wxColour m_gallery_button_background_colour; | |
ce00f59b | 634 | wxColour m_gallery_button_background_gradient_colour; |
3c3ead1d PC |
635 | wxColour m_gallery_button_hover_background_colour; |
636 | wxColour m_gallery_button_hover_background_gradient_colour; | |
637 | wxColour m_gallery_button_active_background_colour; | |
638 | wxColour m_gallery_button_active_background_gradient_colour; | |
639 | wxColour m_gallery_button_disabled_background_colour; | |
640 | wxColour m_gallery_button_disabled_background_gradient_colour; | |
641 | wxColour m_gallery_button_face_colour; | |
642 | wxColour m_gallery_button_hover_face_colour; | |
643 | wxColour m_gallery_button_active_face_colour; | |
644 | wxColour m_gallery_button_disabled_face_colour; | |
645 | ||
646 | wxColour m_tool_face_colour; | |
647 | wxColour m_tool_background_top_colour; | |
648 | wxColour m_tool_background_top_gradient_colour; | |
649 | wxColour m_tool_background_colour; | |
650 | wxColour m_tool_background_gradient_colour; | |
651 | wxColour m_tool_hover_background_top_colour; | |
652 | wxColour m_tool_hover_background_top_gradient_colour; | |
653 | wxColour m_tool_hover_background_colour; | |
654 | wxColour m_tool_hover_background_gradient_colour; | |
655 | wxColour m_tool_active_background_top_colour; | |
656 | wxColour m_tool_active_background_top_gradient_colour; | |
657 | wxColour m_tool_active_background_colour; | |
658 | wxColour m_tool_active_background_gradient_colour; | |
659 | ||
660 | wxBrush m_tab_ctrl_background_brush; | |
661 | wxBrush m_panel_label_background_brush; | |
662 | wxBrush m_panel_hover_label_background_brush; | |
663 | wxBrush m_gallery_hover_background_brush; | |
664 | wxBrush m_gallery_button_background_top_brush; | |
665 | wxBrush m_gallery_button_hover_background_top_brush; | |
666 | wxBrush m_gallery_button_active_background_top_brush; | |
667 | wxBrush m_gallery_button_disabled_background_top_brush; | |
668 | ||
669 | wxFont m_tab_label_font; | |
670 | wxFont m_panel_label_font; | |
671 | wxFont m_button_bar_label_font; | |
672 | ||
673 | wxPen m_page_border_pen; | |
674 | wxPen m_panel_border_pen; | |
675 | wxPen m_panel_border_gradient_pen; | |
676 | wxPen m_panel_minimised_border_pen; | |
677 | wxPen m_panel_minimised_border_gradient_pen; | |
678 | wxPen m_tab_border_pen; | |
679 | wxPen m_button_bar_hover_border_pen; | |
680 | wxPen m_button_bar_active_border_pen; | |
681 | wxPen m_gallery_border_pen; | |
682 | wxPen m_gallery_item_border_pen; | |
683 | wxPen m_toolbar_border_pen; | |
684 | ||
685 | double m_cached_tab_separator_visibility; | |
686 | long m_flags; | |
687 | ||
688 | int m_tab_separation_size; | |
689 | int m_page_border_left; | |
690 | int m_page_border_top; | |
691 | int m_page_border_right; | |
692 | int m_page_border_bottom; | |
693 | int m_panel_x_separation_size; | |
694 | int m_panel_y_separation_size; | |
695 | int m_tool_group_separation_size; | |
696 | int m_gallery_bitmap_padding_left_size; | |
697 | int m_gallery_bitmap_padding_right_size; | |
698 | int m_gallery_bitmap_padding_top_size; | |
699 | int m_gallery_bitmap_padding_bottom_size; | |
700 | }; | |
701 | ||
702 | class WXDLLIMPEXP_RIBBON wxRibbonAUIArtProvider : public wxRibbonMSWArtProvider | |
703 | { | |
704 | public: | |
705 | wxRibbonAUIArtProvider(); | |
706 | virtual ~wxRibbonAUIArtProvider(); | |
707 | ||
708 | wxRibbonArtProvider* Clone() const; | |
709 | ||
710 | wxColour GetColour(int id) const; | |
711 | void SetColour(int id, const wxColor& colour); | |
712 | void SetColourScheme(const wxColour& primary, | |
713 | const wxColour& secondary, | |
714 | const wxColour& tertiary); | |
715 | void SetFont(int id, const wxFont& font); | |
716 | ||
717 | wxSize GetScrollButtonMinimumSize( | |
718 | wxDC& dc, | |
719 | wxWindow* wnd, | |
720 | long style); | |
721 | ||
722 | void DrawScrollButton( | |
723 | wxDC& dc, | |
724 | wxWindow* wnd, | |
725 | const wxRect& rect, | |
726 | long style); | |
727 | ||
728 | wxSize GetPanelSize( | |
729 | wxDC& dc, | |
730 | const wxRibbonPanel* wnd, | |
731 | wxSize client_size, | |
732 | wxPoint* client_offset); | |
733 | ||
734 | wxSize GetPanelClientSize( | |
735 | wxDC& dc, | |
736 | const wxRibbonPanel* wnd, | |
737 | wxSize size, | |
738 | wxPoint* client_offset); | |
739 | ||
740 | void DrawTabCtrlBackground( | |
741 | wxDC& dc, | |
742 | wxWindow* wnd, | |
743 | const wxRect& rect); | |
744 | ||
745 | int GetTabCtrlHeight( | |
746 | wxDC& dc, | |
747 | wxWindow* wnd, | |
748 | const wxRibbonPageTabInfoArray& pages); | |
749 | ||
750 | void GetBarTabWidth( | |
751 | wxDC& dc, | |
752 | wxWindow* wnd, | |
753 | const wxString& label, | |
754 | const wxBitmap& bitmap, | |
755 | int* ideal, | |
756 | int* small_begin_need_separator, | |
757 | int* small_must_have_separator, | |
758 | int* minimum); | |
759 | ||
760 | void DrawTab(wxDC& dc, | |
761 | wxWindow* wnd, | |
762 | const wxRibbonPageTabInfo& tab); | |
763 | ||
764 | void DrawTabSeparator( | |
765 | wxDC& dc, | |
766 | wxWindow* wnd, | |
767 | const wxRect& rect, | |
768 | double visibility); | |
769 | ||
770 | void DrawPageBackground( | |
771 | wxDC& dc, | |
772 | wxWindow* wnd, | |
773 | const wxRect& rect); | |
774 | ||
775 | void DrawPanelBackground( | |
776 | wxDC& dc, | |
777 | wxRibbonPanel* wnd, | |
778 | const wxRect& rect); | |
779 | ||
780 | void DrawMinimisedPanel( | |
781 | wxDC& dc, | |
782 | wxRibbonPanel* wnd, | |
783 | const wxRect& rect, | |
784 | wxBitmap& bitmap); | |
785 | ||
786 | void DrawGalleryBackground( | |
787 | wxDC& dc, | |
788 | wxRibbonGallery* wnd, | |
789 | const wxRect& rect); | |
790 | ||
791 | void DrawGalleryItemBackground( | |
792 | wxDC& dc, | |
793 | wxRibbonGallery* wnd, | |
794 | const wxRect& rect, | |
795 | wxRibbonGalleryItem* item); | |
796 | ||
797 | void DrawButtonBarBackground( | |
798 | wxDC& dc, | |
799 | wxWindow* wnd, | |
800 | const wxRect& rect); | |
801 | ||
802 | void DrawButtonBarButton( | |
803 | wxDC& dc, | |
804 | wxWindow* wnd, | |
805 | const wxRect& rect, | |
806 | wxRibbonButtonKind kind, | |
807 | long state, | |
808 | const wxString& label, | |
809 | const wxBitmap& bitmap_large, | |
810 | const wxBitmap& bitmap_small); | |
811 | ||
812 | void DrawToolBarBackground( | |
813 | wxDC& dc, | |
814 | wxWindow* wnd, | |
815 | const wxRect& rect); | |
816 | ||
817 | void DrawToolGroupBackground( | |
818 | wxDC& dc, | |
819 | wxWindow* wnd, | |
820 | const wxRect& rect); | |
821 | ||
822 | void DrawTool( | |
823 | wxDC& dc, | |
824 | wxWindow* wnd, | |
825 | const wxRect& rect, | |
826 | const wxBitmap& bitmap, | |
827 | wxRibbonButtonKind kind, | |
828 | long state); | |
829 | ||
830 | protected: | |
831 | void DrawPartialPanelBackground(wxDC& dc, wxWindow* wnd, | |
832 | const wxRect& rect); | |
833 | void DrawGalleryButton(wxDC& dc, wxRect rect, | |
834 | wxRibbonGalleryButtonState state, wxBitmap* bitmaps); | |
835 | ||
836 | wxColour m_tab_ctrl_background_colour; | |
837 | wxColour m_tab_ctrl_background_gradient_colour; | |
838 | wxColour m_panel_label_background_colour; | |
839 | wxColour m_panel_label_background_gradient_colour; | |
840 | wxColour m_panel_hover_label_background_colour; | |
841 | wxColour m_panel_hover_label_background_gradient_colour; | |
842 | ||
843 | wxBrush m_background_brush; | |
844 | wxBrush m_tab_active_top_background_brush; | |
845 | wxBrush m_tab_hover_background_brush; | |
846 | wxBrush m_button_bar_hover_background_brush; | |
847 | wxBrush m_button_bar_active_background_brush; | |
848 | wxBrush m_gallery_button_active_background_brush; | |
849 | wxBrush m_gallery_button_hover_background_brush; | |
850 | wxBrush m_gallery_button_disabled_background_brush; | |
851 | wxBrush m_tool_hover_background_brush; | |
852 | wxBrush m_tool_active_background_brush; | |
853 | ||
854 | wxPen m_toolbar_hover_borden_pen; | |
855 | ||
856 | wxFont m_tab_active_label_font; | |
857 | }; | |
858 | ||
859 | #if defined(__WXMSW__) | |
860 | typedef wxRibbonMSWArtProvider wxRibbonDefaultArtProvider; | |
861 | #elif defined(__WXOSX_CARBON__) || \ | |
862 | defined(__WXOSX_COCOA__) || \ | |
863 | defined(__WXOSX_IPHONE__) || \ | |
864 | defined(__WXCOCOA__) | |
865 | // TODO: Once implemented, change typedef to OSX | |
866 | // typedef wxRibbonOSXArtProvider wxRibbonDefaultArtProvider; | |
867 | typedef wxRibbonAUIArtProvider wxRibbonDefaultArtProvider; | |
868 | #else | |
869 | // TODO: Once implemented, change typedef to AUI | |
870 | typedef wxRibbonAUIArtProvider wxRibbonDefaultArtProvider; | |
871 | #endif | |
872 | ||
873 | #endif // wxUSE_RIBBON | |
874 | ||
875 | #endif // _WX_RIBBON_ART_H_ |