]>
git.saurik.com Git - wxWidgets.git/blob - src/ribbon/control.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/ribbon/control.cpp
3 // Purpose: Extension of wxControl with common ribbon methods
4 // Author: Peter Cawley
8 // Copyright: (C) Peter Cawley
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
20 #include "wx/ribbon/control.h"
26 #include "wx/msw/private.h"
29 IMPLEMENT_CLASS(wxRibbonControl
, wxControl
)
31 bool wxRibbonControl::Create(wxWindow
*parent
, wxWindowID id
,
33 const wxSize
& size
, long style
,
34 const wxValidator
& validator
,
37 if ( !wxControl::Create(parent
, id
, pos
, size
, style
, validator
, name
) )
40 wxRibbonControl
*ribbon_parent
= wxDynamicCast(parent
, wxRibbonControl
);
43 m_art
= ribbon_parent
->GetArtProvider();
49 void wxRibbonControl::SetArtProvider(wxRibbonArtProvider
* art
)
54 wxSize
wxRibbonControl::DoGetNextSmallerSize(wxOrientation direction
,
57 // Dummy implementation for code which doesn't check for IsSizingContinuous() == true
58 wxSize
minimum(GetMinSize());
59 if((direction
& wxHORIZONTAL
) && size
.x
> minimum
.x
)
63 if((direction
& wxVERTICAL
) && size
.y
> minimum
.y
)
70 wxSize
wxRibbonControl::DoGetNextLargerSize(wxOrientation direction
,
73 // Dummy implementation for code which doesn't check for IsSizingContinuous() == true
74 if(direction
& wxHORIZONTAL
)
78 if(direction
& wxVERTICAL
)
85 wxSize
wxRibbonControl::GetNextSmallerSize(wxOrientation direction
,
86 wxSize relative_to
) const
88 return DoGetNextSmallerSize(direction
, relative_to
);
91 wxSize
wxRibbonControl::GetNextLargerSize(wxOrientation direction
,
92 wxSize relative_to
) const
94 return DoGetNextLargerSize(direction
, relative_to
);
97 wxSize
wxRibbonControl::GetNextSmallerSize(wxOrientation direction
) const
99 return DoGetNextSmallerSize(direction
, GetSize());
102 wxSize
wxRibbonControl::GetNextLargerSize(wxOrientation direction
) const
104 return DoGetNextLargerSize(direction
, GetSize());
107 bool wxRibbonControl::Realize()
112 #endif // wxUSE_RIBBON