2009-09-16 08:06:02 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/ribbon/control.h
|
|
|
|
// Purpose: Extension of wxControl with common ribbon methods
|
|
|
|
// Author: Peter Cawley
|
|
|
|
// Modified by:
|
|
|
|
// Created: 2009-06-05
|
|
|
|
// Copyright: (C) Peter Cawley
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_RIBBON_CONTROL_H_
|
|
|
|
#define _WX_RIBBON_CONTROL_H_
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#if wxUSE_RIBBON
|
|
|
|
|
|
|
|
#include "wx/control.h"
|
|
|
|
#include "wx/dynarray.h"
|
|
|
|
|
2012-06-03 15:17:03 -04:00
|
|
|
class wxRibbonBar;
|
2009-09-16 08:06:02 -04:00
|
|
|
class wxRibbonArtProvider;
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_RIBBON wxRibbonControl : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
2010-05-07 19:38:21 -04:00
|
|
|
wxRibbonControl() { Init(); }
|
2009-09-16 08:06:02 -04:00
|
|
|
|
|
|
|
wxRibbonControl(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize, long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
2010-05-07 19:38:21 -04:00
|
|
|
const wxString& name = wxControlNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, pos, size, style, validator, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize, long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxControlNameStr);
|
2009-09-16 08:06:02 -04:00
|
|
|
|
|
|
|
virtual void SetArtProvider(wxRibbonArtProvider* art);
|
|
|
|
wxRibbonArtProvider* GetArtProvider() const {return m_art;}
|
|
|
|
|
|
|
|
virtual bool IsSizingContinuous() const {return true;}
|
|
|
|
wxSize GetNextSmallerSize(wxOrientation direction, wxSize relative_to) const;
|
|
|
|
wxSize GetNextLargerSize(wxOrientation direction, wxSize relative_to) const;
|
|
|
|
wxSize GetNextSmallerSize(wxOrientation direction) const;
|
|
|
|
wxSize GetNextLargerSize(wxOrientation direction) const;
|
|
|
|
|
|
|
|
virtual bool Realize();
|
|
|
|
bool Realise() {return Realize();}
|
|
|
|
|
2012-06-03 15:17:03 -04:00
|
|
|
virtual wxRibbonBar* GetAncestorRibbonBar()const;
|
|
|
|
|
2012-03-12 15:30:10 -04:00
|
|
|
// Finds the best width and height given the parent's width and height
|
|
|
|
virtual wxSize GetBestSizeForParentSize(const wxSize& WXUNUSED(parentSize)) const { return GetBestSize(); }
|
|
|
|
|
2009-09-16 08:06:02 -04:00
|
|
|
protected:
|
|
|
|
wxRibbonArtProvider* m_art;
|
|
|
|
|
|
|
|
virtual wxSize DoGetNextSmallerSize(wxOrientation direction,
|
|
|
|
wxSize relative_to) const;
|
|
|
|
virtual wxSize DoGetNextLargerSize(wxOrientation direction,
|
|
|
|
wxSize relative_to) const;
|
|
|
|
|
2010-05-07 19:38:21 -04:00
|
|
|
private:
|
|
|
|
void Init() { m_art = NULL; }
|
|
|
|
|
2009-09-16 08:06:02 -04:00
|
|
|
#ifndef SWIG
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_CLASS(wxRibbonControl);
|
2009-09-16 08:06:02 -04:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2011-10-27 17:10:51 -04:00
|
|
|
WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxRibbonControl*, wxArrayRibbonControl, class WXDLLIMPEXP_RIBBON);
|
2009-09-16 08:06:02 -04:00
|
|
|
|
|
|
|
#endif // wxUSE_RIBBON
|
|
|
|
|
|
|
|
#endif // _WX_RIBBON_CONTROL_H_
|