1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/ribbon/page.h
3 // Purpose: Container for ribbon-bar-style interface panels
4 // Author: Peter Cawley
8 // Copyright: (C) Peter Cawley
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_RIBBON_PAGE_H_
13 #define _WX_RIBBON_PAGE_H_
19 #include "wx/ribbon/control.h"
20 #include "wx/ribbon/panel.h"
21 #include "wx/bitmap.h"
24 class wxRibbonPageScrollButton
;
26 class WXDLLIMPEXP_RIBBON wxRibbonPage
: public wxRibbonControl
31 wxRibbonPage(wxRibbonBar
* parent
,
32 wxWindowID id
= wxID_ANY
,
33 const wxString
& label
= wxEmptyString
,
34 const wxBitmap
& icon
= wxNullBitmap
,
37 virtual ~wxRibbonPage();
39 bool Create(wxRibbonBar
* parent
,
40 wxWindowID id
= wxID_ANY
,
41 const wxString
& label
= wxEmptyString
,
42 const wxBitmap
& icon
= wxNullBitmap
,
45 void SetArtProvider(wxRibbonArtProvider
* art
);
47 wxBitmap
& GetIcon() {return m_icon
;}
48 virtual wxSize
GetMinSize() const;
49 virtual wxSize
DoGetBestSize() const;
50 void SetSizeWithScrollButtonAdjustment(int x
, int y
, int width
, int height
);
51 void AdjustRectToIncludeScrollButtons(wxRect
* rect
) const;
53 bool DismissExpandedPanel();
55 virtual bool Realize();
56 virtual bool Show(bool show
= true);
57 virtual bool Layout();
58 virtual bool ScrollLines(int lines
);
59 bool ScrollPixels(int pixels
);
61 wxOrientation
GetMajorAxis() const;
63 virtual void RemoveChild(wxWindowBase
*child
);
66 virtual wxBorder
GetDefaultBorder() const { return wxBORDER_NONE
; }
68 void DoSetSize(int x
, int y
, int width
, int height
, int sizeFlags
= wxSIZE_AUTO
);
69 void OnEraseBackground(wxEraseEvent
& evt
);
70 void OnPaint(wxPaintEvent
& evt
);
71 void OnSize(wxSizeEvent
& evt
);
73 bool ExpandPanels(wxOrientation direction
, int maximum_amount
);
74 bool CollapsePanels(wxOrientation direction
, int minimum_amount
);
75 void ShowScrollButtons();
76 void HideScrollButtons();
78 void CommonInit(const wxString
& label
, const wxBitmap
& icon
);
80 wxArrayRibbonControl m_collapse_stack
;
83 // NB: Scroll button windows are siblings rather than children (to get correct clipping of children)
84 wxRibbonPageScrollButton
* m_scroll_left_btn
;
85 wxRibbonPageScrollButton
* m_scroll_right_btn
;
87 int m_scroll_amount_limit
;
88 int m_size_in_major_axis_for_children
;
89 bool m_scroll_buttons_visible
;
92 DECLARE_CLASS(wxRibbonPage
)
97 #endif // wxUSE_RIBBON
99 #endif // _WX_RIBBON_PAGE_H_