1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/ribbon/control.h
3 // Purpose: Extension of wxControl with common ribbon methods
4 // Author: Peter Cawley
8 // Copyright: (C) Peter Cawley
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_RIBBON_CONTROL_H_
13 #define _WX_RIBBON_CONTROL_H_
19 #include "wx/control.h"
20 #include "wx/dynarray.h"
23 class wxRibbonArtProvider
;
25 class WXDLLIMPEXP_RIBBON wxRibbonControl
: public wxControl
28 wxRibbonControl() { Init(); }
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
)
38 Create(parent
, id
, pos
, size
, style
, validator
, name
);
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
);
47 virtual void SetArtProvider(wxRibbonArtProvider
* art
);
48 wxRibbonArtProvider
* GetArtProvider() const {return m_art
;}
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;
56 virtual bool Realize();
57 bool Realise() {return Realize();}
59 virtual wxRibbonBar
* GetAncestorRibbonBar()const;
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(); }
65 wxRibbonArtProvider
* m_art
;
67 virtual wxSize
DoGetNextSmallerSize(wxOrientation direction
,
68 wxSize relative_to
) const;
69 virtual wxSize
DoGetNextLargerSize(wxOrientation direction
,
70 wxSize relative_to
) const;
73 void Init() { m_art
= NULL
; }
76 DECLARE_CLASS(wxRibbonControl
)
80 WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxRibbonControl
*, wxArrayRibbonControl
, class WXDLLIMPEXP_RIBBON
);
82 #endif // wxUSE_RIBBON
84 #endif // _WX_RIBBON_CONTROL_H_