Game Develop Core: RibbonMetroArtProvider.h Source File

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
RibbonMetroArtProvider.h
1 #if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
2 #ifndef RIBBONMETROARTPROVIDER_H
3 #define RIBBONMETROARTPROVIDER_H
4
5 #include <wx/defs.h>
6 #include <wx/brush.h>
7 #include <wx/colour.h>
8 #include <wx/font.h>
9 #include <wx/pen.h>
10 #include <wx/bitmap.h>
11 #include <wx/ribbon/bar.h>
12 #include <wx/ribbon/art.h>
13 class wxDC;
14 class wxWindow;
15
16 namespace gd
17 {
18
19 class GD_CORE_API RibbonMetroArtProvider : public wxRibbonArtProvider
20 {
21 public:
22 RibbonMetroArtProvider(bool set_colour_scheme = true);
23 virtual ~RibbonMetroArtProvider();
24
25 wxRibbonArtProvider* Clone() const;
26 void SetFlags(long flags);
27 long GetFlags() const;
28
29 int GetMetric(int id) const;
30 void SetMetric(int id, int new_val);
31 void SetFont(int id, const wxFont& font);
32 wxFont GetFont(int id) const;
33 wxColour GetColour(int id) const;
34 void SetColour(int id, const wxColor& colour);
35 void GetColourScheme(wxColour* primary,
36 wxColour* secondary,
37 wxColour* tertiary) const;
38 void SetColourScheme(const wxColour& primary,
39 const wxColour& secondary,
40 const wxColour& tertiary);
41
42 int GetTabCtrlHeight(
43 wxDC& dc,
44 wxWindow* wnd,
45 const wxRibbonPageTabInfoArray& pages);
46
47 void DrawTabCtrlBackground(
48 wxDC& dc,
49 wxWindow* wnd,
50 const wxRect& rect);
51
52 void DrawTab(wxDC& dc,
53 wxWindow* wnd,
54 const wxRibbonPageTabInfo& tab);
55
56 void DrawTabSeparator(
57 wxDC& dc,
58 wxWindow* wnd,
59 const wxRect& rect,
60 double visibility);
61
62 void DrawPageBackground(
63 wxDC& dc,
64 wxWindow* wnd,
65 const wxRect& rect);
66
67 void DrawScrollButton(
68 wxDC& dc,
69 wxWindow* wnd,
70 const wxRect& rect,
71 long style);
72
73 void DrawPanelBackground(
74 wxDC& dc,
75 wxRibbonPanel* wnd,
76 const wxRect& rect);
77
78 void DrawGalleryBackground(
79 wxDC& dc,
80 wxRibbonGallery* wnd,
81 const wxRect& rect);
82
83 void DrawGalleryItemBackground(
84 wxDC& dc,
85 wxRibbonGallery* wnd,
86 const wxRect& rect,
87 wxRibbonGalleryItem* item);
88
89 void DrawMinimisedPanel(
90 wxDC& dc,
91 wxRibbonPanel* wnd,
92 const wxRect& rect,
93 wxBitmap& bitmap);
94
95 void DrawButtonBarBackground(
96 wxDC& dc,
97 wxWindow* wnd,
98 const wxRect& rect);
99
100 void DrawButtonBarButton(
101 wxDC& dc,
102 wxWindow* wnd,
103 const wxRect& rect,
104 wxRibbonButtonKind kind,
105 long state,
106 const wxString& label,
107 const wxBitmap& bitmap_large,
108 const wxBitmap& bitmap_small);
109
110 void DrawToolBarBackground(
111 wxDC& dc,
112 wxWindow* wnd,
113 const wxRect& rect);
114
115 void DrawToolGroupBackground(
116 wxDC& dc,
117 wxWindow* wnd,
118 const wxRect& rect);
119
120 void DrawTool(
121 wxDC& dc,
122 wxWindow* wnd,
123 const wxRect& rect,
124 const wxBitmap& bitmap,
125 wxRibbonButtonKind kind,
126 long state);
127
128 void DrawToggleButton(
129 wxDC& dc,
130 wxRibbonBar* wnd,
131 const wxRect& rect,
132 wxRibbonDisplayMode mode);
133
134 void DrawHelpButton(wxDC& dc,
135 wxRibbonBar* wnd,
136 const wxRect& rect);
137
138 void GetBarTabWidth(
139 wxDC& dc,
140 wxWindow* wnd,
141 const wxString& label,
142 const wxBitmap& bitmap,
143 int* ideal,
144 int* small_begin_need_separator,
145 int* small_must_have_separator,
146 int* minimum);
147
148 wxSize GetScrollButtonMinimumSize(
149 wxDC& dc,
150 wxWindow* wnd,
151 long style);
152
153 wxSize GetPanelSize(
154 wxDC& dc,
155 const wxRibbonPanel* wnd,
156 wxSize client_size,
157 wxPoint* client_offset);
158
159 wxSize GetPanelClientSize(
160 wxDC& dc,
161 const wxRibbonPanel* wnd,
162 wxSize size,
163 wxPoint* client_offset);
164
165 wxRect GetPanelExtButtonArea(
166 wxDC& dc,
167 const wxRibbonPanel* wnd,
168 wxRect rect);
169
170 wxSize GetGallerySize(
171 wxDC& dc,
172 const wxRibbonGallery* wnd,
173 wxSize client_size);
174
175 wxSize GetGalleryClientSize(
176 wxDC& dc,
177 const wxRibbonGallery* wnd,
178 wxSize size,
179 wxPoint* client_offset,
180 wxRect* scroll_up_button,
181 wxRect* scroll_down_button,
182 wxRect* extension_button);
183
184 wxRect GetPageBackgroundRedrawArea(
185 wxDC& dc,
186 const wxRibbonPage* wnd,
187 wxSize page_old_size,
188 wxSize page_new_size);
189
190 bool GetButtonBarButtonSize(
191 wxDC& dc,
192 wxWindow* wnd,
193 wxRibbonButtonKind kind,
194 wxRibbonButtonBarButtonState size,
195 const wxString& label,
196 wxSize bitmap_size_large,
197 wxSize bitmap_size_small,
198 wxSize* button_size,
199 wxRect* normal_region,
200 wxRect* dropdown_region);
201
202 wxSize GetMinimisedPanelMinimumSize(
203 wxDC& dc,
204 const wxRibbonPanel* wnd,
205 wxSize* desired_bitmap_size,
206 wxDirection* expanded_panel_direction);
207
208 wxSize GetToolSize(
209 wxDC& dc,
210 wxWindow* wnd,
211 wxSize bitmap_size,
212 wxRibbonButtonKind kind,
213 bool is_first,
214 bool is_last,
215 wxRect* dropdown_region);
216
217 wxRect GetBarToggleButtonArea(const wxRect& rect);
218
219 wxRect GetRibbonHelpButtonArea(const wxRect& rect);
220
221 protected:
222 void ReallyDrawTabSeparator(wxWindow* wnd, const wxRect& rect, double visibility);
223 void DrawPartialPageBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect,
224 bool allow_hovered = true);
225 void DrawPartialPageBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect,
226 wxRibbonPage* page, wxPoint offset, bool hovered = false);
227 void DrawPanelBorder(wxDC& dc, const wxRect& rect, wxPen& primary_colour,
228 wxPen& secondary_colour);
229 void RemovePanelPadding(wxRect* rect);
230 void DrawDropdownArrow(wxDC& dc, int x, int y, const wxColour& colour);
231 void DrawGalleryBackgroundCommon(wxDC& dc, wxRibbonGallery* wnd,
232 const wxRect& rect);
233 virtual void DrawGalleryButton(wxDC& dc, wxRect rect,
234 wxRibbonGalleryButtonState state, wxBitmap* bitmaps);
235 void DrawButtonBarButtonForeground(
236 wxDC& dc,
237 const wxRect& rect,
238 wxRibbonButtonKind kind,
239 long state,
240 const wxString& label,
241 const wxBitmap& bitmap_large,
242 const wxBitmap& bitmap_small);
243 void DrawMinimisedPanelCommon(
244 wxDC& dc,
245 wxRibbonPanel* wnd,
246 const wxRect& rect,
247 wxRect* preview_rect);
248 void CloneTo(RibbonMetroArtProvider* copy) const;
249
250 wxBitmap m_cached_tab_separator;
251 wxBitmap m_gallery_up_bitmap[4];
252 wxBitmap m_gallery_down_bitmap[4];
253 wxBitmap m_gallery_extension_bitmap[4];
254 wxBitmap m_toolbar_drop_bitmap;
255 wxBitmap m_panel_extension_bitmap[2];
256 wxBitmap m_ribbon_toggle_up_bitmap[2];
257 wxBitmap m_ribbon_toggle_down_bitmap[2];
258 wxBitmap m_ribbon_toggle_pin_bitmap[2];
259 wxBitmap m_ribbon_bar_help_button_bitmap[2];
260
261 wxColour m_primary_scheme_colour;
262 wxColour m_secondary_scheme_colour;
263 wxColour m_tertiary_scheme_colour;
264
265 wxColour m_button_bar_label_colour;
266 wxColour m_button_bar_label_disabled_colour;
267 wxColour m_tab_label_colour;
268 wxColour m_tab_separator_colour;
269 wxColour m_tab_separator_gradient_colour;
270 wxColour m_tab_active_background_colour;
271 wxColour m_tab_active_background_gradient_colour;
272 wxColour m_tab_hover_background_colour;
273 wxColour m_tab_hover_background_gradient_colour;
274 wxColour m_tab_hover_background_top_colour;
275 wxColour m_tab_hover_background_top_gradient_colour;
276 wxColour m_panel_label_colour;
277 wxColour m_panel_minimised_label_colour;
278 wxColour m_panel_hover_label_colour;
279 wxColour m_panel_active_background_colour;
280 wxColour m_panel_active_background_gradient_colour;
281 wxColour m_panel_active_background_top_colour;
282 wxColour m_panel_active_background_top_gradient_colour;
283 wxColour m_panel_button_face_colour;
284 wxColour m_panel_button_hover_face_colour;
285 wxColour m_page_toggle_face_colour;
286 wxColour m_page_toggle_hover_face_colour;
287 wxColour m_page_background_colour;
288 wxColour m_page_background_gradient_colour;
289 wxColour m_page_background_top_colour;
290 wxColour m_page_background_top_gradient_colour;
291 wxColour m_page_hover_background_colour;
292 wxColour m_page_hover_background_gradient_colour;
293 wxColour m_page_hover_background_top_colour;
294 wxColour m_page_hover_background_top_gradient_colour;
295 wxColour m_button_bar_hover_background_colour;
296 wxColour m_button_bar_hover_background_gradient_colour;
297 wxColour m_button_bar_hover_background_top_colour;
298 wxColour m_button_bar_hover_background_top_gradient_colour;
299 wxColour m_button_bar_active_background_colour;
300 wxColour m_button_bar_active_background_gradient_colour;
301 wxColour m_button_bar_active_background_top_colour;
302 wxColour m_button_bar_active_background_top_gradient_colour;
303 wxColour m_gallery_button_background_colour;
304 wxColour m_gallery_button_background_gradient_colour;
305 wxColour m_gallery_button_hover_background_colour;
306 wxColour m_gallery_button_hover_background_gradient_colour;
307 wxColour m_gallery_button_active_background_colour;
308 wxColour m_gallery_button_active_background_gradient_colour;
309 wxColour m_gallery_button_disabled_background_colour;
310 wxColour m_gallery_button_disabled_background_gradient_colour;
311 wxColour m_gallery_button_face_colour;
312 wxColour m_gallery_button_hover_face_colour;
313 wxColour m_gallery_button_active_face_colour;
314 wxColour m_gallery_button_disabled_face_colour;
315
316 wxColour m_tool_face_colour;
317 wxColour m_tool_background_top_colour;
318 wxColour m_tool_background_top_gradient_colour;
319 wxColour m_tool_background_colour;
320 wxColour m_tool_background_gradient_colour;
321 wxColour m_tool_hover_background_top_colour;
322 wxColour m_tool_hover_background_top_gradient_colour;
323 wxColour m_tool_hover_background_colour;
324 wxColour m_tool_hover_background_gradient_colour;
325 wxColour m_tool_active_background_top_colour;
326 wxColour m_tool_active_background_top_gradient_colour;
327 wxColour m_tool_active_background_colour;
328 wxColour m_tool_active_background_gradient_colour;
329
330 wxBrush m_tab_ctrl_background_brush;
331 wxBrush m_panel_label_background_brush;
332 wxBrush m_panel_hover_label_background_brush;
333 wxBrush m_panel_hover_button_background_brush;
334 wxBrush m_gallery_hover_background_brush;
335 wxBrush m_gallery_button_background_top_brush;
336 wxBrush m_gallery_button_hover_background_top_brush;
337 wxBrush m_gallery_button_active_background_top_brush;
338 wxBrush m_gallery_button_disabled_background_top_brush;
339 wxBrush m_ribbon_toggle_brush;
340
341 wxFont m_tab_label_font;
342 wxFont m_panel_label_font;
343 wxFont m_button_bar_label_font;
344
345 wxPen m_page_border_pen;
346 wxPen m_panel_border_pen;
347 wxPen m_panel_border_gradient_pen;
348 wxPen m_panel_minimised_border_pen;
349 wxPen m_panel_minimised_border_gradient_pen;
350 wxPen m_panel_hover_button_border_pen;
351 wxPen m_tab_border_pen;
352 wxPen m_button_bar_hover_border_pen;
353 wxPen m_button_bar_active_border_pen;
354 wxPen m_gallery_border_pen;
355 wxPen m_gallery_item_border_pen;
356 wxPen m_toolbar_border_pen;
357 wxPen m_ribbon_toggle_pen;
358
359 double m_cached_tab_separator_visibility;
360 long m_flags;
361
362 int m_tab_separation_size;
363 int m_page_border_left;
364 int m_page_border_top;
365 int m_page_border_right;
366 int m_page_border_bottom;
367 int m_panel_x_separation_size;
368 int m_panel_y_separation_size;
369 int m_tool_group_separation_size;
370 int m_gallery_bitmap_padding_left_size;
371 int m_gallery_bitmap_padding_right_size;
372 int m_gallery_bitmap_padding_top_size;
373 int m_gallery_bitmap_padding_bottom_size;
374 int m_toggle_button_offset;
375 int m_help_button_offset;
376
377 wxBitmap helpBitmap;
378 };
379
380 }
381
382 #endif
383 #endif