]> git.saurik.com Git - wxWidgets.git/blob - include/wx/ribbon/control.h
default implementation for scaled bitmaps properties
[wxWidgets.git] / include / wx / ribbon / control.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/ribbon/control.h
3 // Purpose: Extension of wxControl with common ribbon methods
4 // Author: Peter Cawley
5 // Modified by:
6 // Created: 2009-06-05
7 // RCS-ID: $Id$
8 // Copyright: (C) Peter Cawley
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_RIBBON_CONTROL_H_
13 #define _WX_RIBBON_CONTROL_H_
14
15 #include "wx/defs.h"
16
17 #if wxUSE_RIBBON
18
19 #include "wx/control.h"
20 #include "wx/dynarray.h"
21
22 class wxRibbonBar;
23 class wxRibbonArtProvider;
24
25 class WXDLLIMPEXP_RIBBON wxRibbonControl : public wxControl
26 {
27 public:
28 wxRibbonControl() { Init(); }
29
30 wxRibbonControl(wxWindow *parent, wxWindowID id,
31 const wxPoint& pos = wxDefaultPosition,
32 const wxSize& size = wxDefaultSize, long style = 0,
33 const wxValidator& validator = wxDefaultValidator,
34 const wxString& name = wxControlNameStr)
35 {
36 Init();
37
38 Create(parent, id, pos, size, style, validator, name);
39 }
40
41 bool Create(wxWindow *parent, wxWindowID id,
42 const wxPoint& pos = wxDefaultPosition,
43 const wxSize& size = wxDefaultSize, long style = 0,
44 const wxValidator& validator = wxDefaultValidator,
45 const wxString& name = wxControlNameStr);
46
47 virtual void SetArtProvider(wxRibbonArtProvider* art);
48 wxRibbonArtProvider* GetArtProvider() const {return m_art;}
49
50 virtual bool IsSizingContinuous() const {return true;}
51 wxSize GetNextSmallerSize(wxOrientation direction, wxSize relative_to) const;
52 wxSize GetNextLargerSize(wxOrientation direction, wxSize relative_to) const;
53 wxSize GetNextSmallerSize(wxOrientation direction) const;
54 wxSize GetNextLargerSize(wxOrientation direction) const;
55
56 virtual bool Realize();
57 bool Realise() {return Realize();}
58
59 virtual wxRibbonBar* GetAncestorRibbonBar()const;
60
61 // Finds the best width and height given the parent's width and height
62 virtual wxSize GetBestSizeForParentSize(const wxSize& WXUNUSED(parentSize)) const { return GetBestSize(); }
63
64 protected:
65 wxRibbonArtProvider* m_art;
66
67 virtual wxSize DoGetNextSmallerSize(wxOrientation direction,
68 wxSize relative_to) const;
69 virtual wxSize DoGetNextLargerSize(wxOrientation direction,
70 wxSize relative_to) const;
71
72 private:
73 void Init() { m_art = NULL; }
74
75 #ifndef SWIG
76 DECLARE_CLASS(wxRibbonControl)
77 #endif
78 };
79
80 WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxRibbonControl*, wxArrayRibbonControl, class WXDLLIMPEXP_RIBBON);
81
82 #endif // wxUSE_RIBBON
83
84 #endif // _WX_RIBBON_CONTROL_H_