]>
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 ///////////////////////////////////////////////////////////////////////////////
11 #include "wx/wxprec.h"
17 #include "wx/ribbon/control.h"
25 #include "wx/msw/private.h"
28 IMPLEMENT_CLASS(wxRibbonControl
, wxControl
)
30 wxRibbonControl::wxRibbonControl(wxWindow
*parent
, wxWindowID id
,
32 const wxSize
& size
, long style
,
33 const wxValidator
& validator
,
35 : wxControl(parent
, id
, pos
, size
, style
, validator
, name
)
39 wxRibbonControl
*ribbon_parent
= wxDynamicCast(parent
, wxRibbonControl
);
42 m_art
= ribbon_parent
->GetArtProvider();
46 void wxRibbonControl::SetArtProvider(wxRibbonArtProvider
* art
)
51 wxSize
wxRibbonControl::DoGetNextSmallerSize(wxOrientation direction
,
54 // Dummy implementation for code which doesn't check for IsSizingContinuous() == true
55 wxSize
minimum(GetMinSize());
56 if((direction
& wxHORIZONTAL
) && size
.x
> minimum
.x
)
60 if((direction
& wxVERTICAL
) && size
.y
> minimum
.y
)
67 wxSize
wxRibbonControl::DoGetNextLargerSize(wxOrientation direction
,
70 // Dummy implementation for code which doesn't check for IsSizingContinuous() == true
71 if(direction
& wxHORIZONTAL
)
75 if(direction
& wxVERTICAL
)
82 wxSize
wxRibbonControl::GetNextSmallerSize(wxOrientation direction
,
83 wxSize relative_to
) const
85 return DoGetNextSmallerSize(direction
, relative_to
);
88 wxSize
wxRibbonControl::GetNextLargerSize(wxOrientation direction
,
89 wxSize relative_to
) const
91 return DoGetNextLargerSize(direction
, relative_to
);
94 wxSize
wxRibbonControl::GetNextSmallerSize(wxOrientation direction
) const
96 return DoGetNextSmallerSize(direction
, GetSize());
99 wxSize
wxRibbonControl::GetNextLargerSize(wxOrientation direction
) const
101 return DoGetNextLargerSize(direction
, GetSize());
104 bool wxRibbonControl::Realize()
109 #endif // wxUSE_RIBBON