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