]> git.saurik.com Git - wxWidgets.git/blame - include/wx/ribbon/page.h
support retina display
[wxWidgets.git] / include / wx / ribbon / page.h
CommitLineData
3c3ead1d
PC
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/ribbon/page.h
3// Purpose: Container for ribbon-bar-style interface panels
4// Author: Peter Cawley
5// Modified by:
6// Created: 2009-05-25
7// RCS-ID: $Id$
8// Copyright: (C) Peter Cawley
9// Licence: wxWindows licence
10///////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_RIBBON_PAGE_H_
13#define _WX_RIBBON_PAGE_H_
14
15#include "wx/defs.h"
16
17#if wxUSE_RIBBON
18
19#include "wx/ribbon/control.h"
20#include "wx/ribbon/panel.h"
21#include "wx/bitmap.h"
22
23class wxRibbonBar;
24class wxRibbonPageScrollButton;
25
26class WXDLLIMPEXP_RIBBON wxRibbonPage : public wxRibbonControl
27{
28public:
29 wxRibbonPage();
30
31 wxRibbonPage(wxRibbonBar* parent,
32 wxWindowID id = wxID_ANY,
33 const wxString& label = wxEmptyString,
34 const wxBitmap& icon = wxNullBitmap,
35 long style = 0);
36
37 virtual ~wxRibbonPage();
38
39 bool Create(wxRibbonBar* parent,
40 wxWindowID id = wxID_ANY,
41 const wxString& label = wxEmptyString,
42 const wxBitmap& icon = wxNullBitmap,
43 long style = 0);
44
45 void SetArtProvider(wxRibbonArtProvider* art);
46
47 wxBitmap& GetIcon() {return m_icon;}
48 virtual wxSize GetMinSize() const;
3c3ead1d
PC
49 void SetSizeWithScrollButtonAdjustment(int x, int y, int width, int height);
50 void AdjustRectToIncludeScrollButtons(wxRect* rect) const;
51
52 bool DismissExpandedPanel();
53
54 virtual bool Realize();
55 virtual bool Show(bool show = true);
56 virtual bool Layout();
57 virtual bool ScrollLines(int lines);
58 bool ScrollPixels(int pixels);
0a72cae7 59 bool ScrollSections(int sections);
3c3ead1d
PC
60
61 wxOrientation GetMajorAxis() const;
62
63 virtual void RemoveChild(wxWindowBase *child);
64
42d73941
VZ
65 void HideIfExpanded();
66
3c3ead1d 67protected:
cff9681b 68 virtual wxSize DoGetBestSize() const;
3c3ead1d
PC
69 virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
70
71 void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
960615f4 72 bool DoActualLayout();
3c3ead1d
PC
73 void OnEraseBackground(wxEraseEvent& evt);
74 void OnPaint(wxPaintEvent& evt);
75 void OnSize(wxSizeEvent& evt);
76
77 bool ExpandPanels(wxOrientation direction, int maximum_amount);
78 bool CollapsePanels(wxOrientation direction, int minimum_amount);
79 void ShowScrollButtons();
80 void HideScrollButtons();
81
82 void CommonInit(const wxString& label, const wxBitmap& icon);
960615f4 83 void PopulateSizeCalcArray(wxSize (wxWindow::*get_size)(void) const);
3c3ead1d
PC
84
85 wxArrayRibbonControl m_collapse_stack;
86 wxBitmap m_icon;
87 wxSize m_old_size;
88 // NB: Scroll button windows are siblings rather than children (to get correct clipping of children)
89 wxRibbonPageScrollButton* m_scroll_left_btn;
90 wxRibbonPageScrollButton* m_scroll_right_btn;
960615f4
PC
91 wxSize* m_size_calc_array;
92 size_t m_size_calc_array_size;
3c3ead1d
PC
93 int m_scroll_amount;
94 int m_scroll_amount_limit;
95 int m_size_in_major_axis_for_children;
96 bool m_scroll_buttons_visible;
97
98#ifndef SWIG
99 DECLARE_CLASS(wxRibbonPage)
100 DECLARE_EVENT_TABLE()
101#endif
102};
103
104#endif // wxUSE_RIBBON
105
106#endif // _WX_RIBBON_PAGE_H_