]>
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 wxRibbonControl::wxRibbonControl(wxWindow
*parent
, wxWindowID id
,
33 const wxSize
& size
, long style
,
34 const wxValidator
& validator
,
36 : wxControl(parent
, id
, pos
, size
, style
, validator
, name
)
40 wxRibbonControl
*ribbon_parent
= wxDynamicCast(parent
, wxRibbonControl
);
43 m_art
= ribbon_parent
->GetArtProvider();
47 void wxRibbonControl::SetArtProvider(wxRibbonArtProvider
* art
)
52 wxSize
wxRibbonControl::DoGetNextSmallerSize(wxOrientation direction
,
55 // Dummy implementation for code which doesn't check for IsSizingContinuous() == true
56 wxSize
minimum(GetMinSize());
57 if((direction
& wxHORIZONTAL
) && size
.x
> minimum
.x
)
61 if((direction
& wxVERTICAL
) && size
.y
> minimum
.y
)
68 wxSize
wxRibbonControl::DoGetNextLargerSize(wxOrientation direction
,
71 // Dummy implementation for code which doesn't check for IsSizingContinuous() == true
72 if(direction
& wxHORIZONTAL
)
76 if(direction
& wxVERTICAL
)
83 wxSize
wxRibbonControl::GetNextSmallerSize(wxOrientation direction
,
84 wxSize relative_to
) const
86 return DoGetNextSmallerSize(direction
, relative_to
);
89 wxSize
wxRibbonControl::GetNextLargerSize(wxOrientation direction
,
90 wxSize relative_to
) const
92 return DoGetNextLargerSize(direction
, relative_to
);
95 wxSize
wxRibbonControl::GetNextSmallerSize(wxOrientation direction
) const
97 return DoGetNextSmallerSize(direction
, GetSize());
100 wxSize
wxRibbonControl::GetNextLargerSize(wxOrientation direction
) const
102 return DoGetNextLargerSize(direction
, GetSize());
105 bool wxRibbonControl::Realize()
110 #endif // wxUSE_RIBBON