2009-09-16 12:06:02 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/ribbon/page.h
|
|
|
|
// Purpose: Container for ribbon-bar-style interface panels
|
|
|
|
// Author: Peter Cawley
|
|
|
|
// Modified by:
|
|
|
|
// Created: 2009-05-25
|
|
|
|
// Copyright: (C) Peter Cawley
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_RIBBON_PAGE_H_
|
|
|
|
#define _WX_RIBBON_PAGE_H_
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#if wxUSE_RIBBON
|
|
|
|
|
|
|
|
#include "wx/ribbon/control.h"
|
|
|
|
#include "wx/ribbon/panel.h"
|
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
|
|
|
class wxRibbonBar;
|
|
|
|
class wxRibbonPageScrollButton;
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_RIBBON wxRibbonPage : public wxRibbonControl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxRibbonPage();
|
|
|
|
|
|
|
|
wxRibbonPage(wxRibbonBar* parent,
|
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxString& label = wxEmptyString,
|
|
|
|
const wxBitmap& icon = wxNullBitmap,
|
|
|
|
long style = 0);
|
|
|
|
|
|
|
|
virtual ~wxRibbonPage();
|
|
|
|
|
|
|
|
bool Create(wxRibbonBar* parent,
|
|
|
|
wxWindowID id = wxID_ANY,
|
|
|
|
const wxString& label = wxEmptyString,
|
|
|
|
const wxBitmap& icon = wxNullBitmap,
|
|
|
|
long style = 0);
|
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
void SetArtProvider(wxRibbonArtProvider* art) wxOVERRIDE;
|
2009-09-16 12:06:02 +00:00
|
|
|
|
|
|
|
wxBitmap& GetIcon() {return m_icon;}
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual wxSize GetMinSize() const wxOVERRIDE;
|
2009-09-16 12:06:02 +00:00
|
|
|
void SetSizeWithScrollButtonAdjustment(int x, int y, int width, int height);
|
|
|
|
void AdjustRectToIncludeScrollButtons(wxRect* rect) const;
|
|
|
|
|
|
|
|
bool DismissExpandedPanel();
|
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual bool Realize() wxOVERRIDE;
|
|
|
|
virtual bool Show(bool show = true) wxOVERRIDE;
|
|
|
|
virtual bool Layout() wxOVERRIDE;
|
|
|
|
virtual bool ScrollLines(int lines) wxOVERRIDE;
|
2009-09-16 12:06:02 +00:00
|
|
|
bool ScrollPixels(int pixels);
|
2013-05-31 23:21:11 +00:00
|
|
|
bool ScrollSections(int sections);
|
2009-09-16 12:06:02 +00:00
|
|
|
|
|
|
|
wxOrientation GetMajorAxis() const;
|
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void RemoveChild(wxWindowBase *child) wxOVERRIDE;
|
2009-09-16 12:06:02 +00:00
|
|
|
|
2012-09-15 23:19:59 +00:00
|
|
|
void HideIfExpanded();
|
|
|
|
|
2009-09-16 12:06:02 +00:00
|
|
|
protected:
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual wxSize DoGetBestSize() const wxOVERRIDE;
|
|
|
|
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; }
|
2009-09-16 12:06:02 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO) wxOVERRIDE;
|
2009-12-09 18:48:41 +00:00
|
|
|
bool DoActualLayout();
|
2009-09-16 12:06:02 +00:00
|
|
|
void OnEraseBackground(wxEraseEvent& evt);
|
|
|
|
void OnPaint(wxPaintEvent& evt);
|
|
|
|
void OnSize(wxSizeEvent& evt);
|
|
|
|
|
|
|
|
bool ExpandPanels(wxOrientation direction, int maximum_amount);
|
|
|
|
bool CollapsePanels(wxOrientation direction, int minimum_amount);
|
|
|
|
void ShowScrollButtons();
|
|
|
|
void HideScrollButtons();
|
|
|
|
|
|
|
|
void CommonInit(const wxString& label, const wxBitmap& icon);
|
2009-12-09 18:48:41 +00:00
|
|
|
void PopulateSizeCalcArray(wxSize (wxWindow::*get_size)(void) const);
|
2009-09-16 12:06:02 +00:00
|
|
|
|
|
|
|
wxArrayRibbonControl m_collapse_stack;
|
|
|
|
wxBitmap m_icon;
|
|
|
|
wxSize m_old_size;
|
|
|
|
// NB: Scroll button windows are siblings rather than children (to get correct clipping of children)
|
|
|
|
wxRibbonPageScrollButton* m_scroll_left_btn;
|
|
|
|
wxRibbonPageScrollButton* m_scroll_right_btn;
|
2009-12-09 18:48:41 +00:00
|
|
|
wxSize* m_size_calc_array;
|
|
|
|
size_t m_size_calc_array_size;
|
2009-09-16 12:06:02 +00:00
|
|
|
int m_scroll_amount;
|
|
|
|
int m_scroll_amount_limit;
|
|
|
|
int m_size_in_major_axis_for_children;
|
|
|
|
bool m_scroll_buttons_visible;
|
|
|
|
|
|
|
|
#ifndef SWIG
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_CLASS(wxRibbonPage);
|
|
|
|
wxDECLARE_EVENT_TABLE();
|
2009-09-16 12:06:02 +00:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // wxUSE_RIBBON
|
|
|
|
|
|
|
|
#endif // _WX_RIBBON_PAGE_H_
|