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"
22 class wxRibbonArtProvider
;
24 class WXDLLIMPEXP_RIBBON wxRibbonControl
: public wxControl
27 wxRibbonControl() { Init(); }
29 wxRibbonControl(wxWindow
*parent
, wxWindowID id
,
30 const wxPoint
& pos
= wxDefaultPosition
,
31 const wxSize
& size
= wxDefaultSize
, long style
= 0,
32 const wxValidator
& validator
= wxDefaultValidator
,
33 const wxString
& name
= wxControlNameStr
)
37 Create(parent
, id
, pos
, size
, style
, validator
, name
);
40 bool Create(wxWindow
*parent
, wxWindowID id
,
41 const wxPoint
& pos
= wxDefaultPosition
,
42 const wxSize
& size
= wxDefaultSize
, long style
= 0,
43 const wxValidator
& validator
= wxDefaultValidator
,
44 const wxString
& name
= wxControlNameStr
);
46 virtual void SetArtProvider(wxRibbonArtProvider
* art
);
47 wxRibbonArtProvider
* GetArtProvider() const {return m_art
;}
49 virtual bool IsSizingContinuous() const {return true;}
50 wxSize
GetNextSmallerSize(wxOrientation direction
, wxSize relative_to
) const;
51 wxSize
GetNextLargerSize(wxOrientation direction
, wxSize relative_to
) const;
52 wxSize
GetNextSmallerSize(wxOrientation direction
) const;
53 wxSize
GetNextLargerSize(wxOrientation direction
) const;
55 virtual bool Realize();
56 bool Realise() {return Realize();}
59 wxRibbonArtProvider
* m_art
;
61 virtual wxSize
DoGetNextSmallerSize(wxOrientation direction
,
62 wxSize relative_to
) const;
63 virtual wxSize
DoGetNextLargerSize(wxOrientation direction
,
64 wxSize relative_to
) const;
67 void Init() { m_art
= NULL
; }
70 DECLARE_CLASS(wxRibbonControl
)
74 WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxRibbonControl
*, wxArrayRibbonControl
, class WXDLLIMPEXP_RIBBON
);
76 #endif // wxUSE_RIBBON
78 #endif // _WX_RIBBON_CONTROL_H_