]> git.saurik.com Git - wxWidgets.git/blame - include/wx/ribbon/control.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / ribbon / control.h
CommitLineData
3c3ead1d
PC
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/ribbon/control.h
3// Purpose: Extension of wxControl with common ribbon methods
4// Author: Peter Cawley
5// Modified by:
6// Created: 2009-06-05
3c3ead1d
PC
7// Copyright: (C) Peter Cawley
8// Licence: wxWindows licence
9///////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_RIBBON_CONTROL_H_
12#define _WX_RIBBON_CONTROL_H_
13
14#include "wx/defs.h"
15
16#if wxUSE_RIBBON
17
18#include "wx/control.h"
19#include "wx/dynarray.h"
20
07c72264 21class wxRibbonBar;
3c3ead1d
PC
22class wxRibbonArtProvider;
23
24class WXDLLIMPEXP_RIBBON wxRibbonControl : public wxControl
25{
26public:
fd6e1597 27 wxRibbonControl() { Init(); }
3c3ead1d
PC
28
29 wxRibbonControl(wxWindow *parent, wxWindowID id,
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize, long style = 0,
32 const wxValidator& validator = wxDefaultValidator,
fd6e1597
VZ
33 const wxString& name = wxControlNameStr)
34 {
35 Init();
36
37 Create(parent, id, pos, size, style, validator, name);
38 }
39
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);
3c3ead1d
PC
45
46 virtual void SetArtProvider(wxRibbonArtProvider* art);
47 wxRibbonArtProvider* GetArtProvider() const {return m_art;}
48
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;
54
55 virtual bool Realize();
56 bool Realise() {return Realize();}
57
07c72264
VZ
58 virtual wxRibbonBar* GetAncestorRibbonBar()const;
59
98742322
JS
60 // Finds the best width and height given the parent's width and height
61 virtual wxSize GetBestSizeForParentSize(const wxSize& WXUNUSED(parentSize)) const { return GetBestSize(); }
62
3c3ead1d
PC
63protected:
64 wxRibbonArtProvider* m_art;
65
66 virtual wxSize DoGetNextSmallerSize(wxOrientation direction,
67 wxSize relative_to) const;
68 virtual wxSize DoGetNextLargerSize(wxOrientation direction,
69 wxSize relative_to) const;
70
fd6e1597
VZ
71private:
72 void Init() { m_art = NULL; }
73
3c3ead1d
PC
74#ifndef SWIG
75 DECLARE_CLASS(wxRibbonControl)
76#endif
77};
78
c155b9b5 79WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxRibbonControl*, wxArrayRibbonControl, class WXDLLIMPEXP_RIBBON);
3c3ead1d
PC
80
81#endif // wxUSE_RIBBON
82
83#endif // _WX_RIBBON_CONTROL_H_