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