.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. currentmodule:: wx.lib.agw.ribbon.page

.. highlight:: python



.. _wx.lib.agw.ribbon.page.RibbonPage:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.ribbon.page.RibbonPage**
==========================================================================================================================================

Base class for all the Ribbon stuff. 



|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>RibbonPage</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.lib.agw.ribbon.page.RibbonPage_inheritance.png" alt="Inheritance diagram of RibbonPage" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.agw.ribbon.page.RibbonPage.html" title="wx.lib.agw.ribbon.page.RibbonPage" alt="" coords="20,469,272,499"/> <area shape="rect" id="node2" href="wx.lib.agw.ribbon.control.RibbonControl.html" title="wx.lib.agw.ribbon.control.RibbonControl" alt="" coords="5,392,287,421"/> <area shape="rect" id="node3" href="wx.Control.html" title="wx.Control" alt="" coords="100,315,192,344"/> <area shape="rect" id="node4" href="wx.Window.html" title="wx.Window" alt="" coords="97,237,195,267"/> <area shape="rect" id="node5" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="81,160,211,189"/> <area shape="rect" id="node6" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="87,83,205,112"/> <area shape="rect" id="node7" href="wx.Object.html" title="wx.Object" alt="" coords="43,5,129,35"/> <area shape="rect" id="node8" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="154,5,261,35"/> </map> 
   </p>
   </div>

|


|appearance| Control Appearance
===============================

|

.. figure:: _static/images/widgets/fullsize/wxmsw/wx.lib.agw.ribbon.page.ribbonpage.png
   :alt: wxMSW
   :figclass: floatleft

   **wxMSW**


.. figure:: _static/images/widgets/fullsize/wxmac/../no_appearance.png
   :alt: wxMAC
   :figclass: floatright

   **wxMAC**


.. figure:: _static/images/widgets/fullsize/wxgtk/wx.lib.agw.ribbon.page.ribbonpage.png
   :alt: wxGTK
   :figclass: floatcenter

   **wxGTK**


|




|super_classes| Known Superclasses
==================================

:class:`wx.lib.agw.ribbon.control.RibbonControl`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.__init__`                              Default class constructor.
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.AdjustRectToIncludeScrollButtons`      Expand a rectangle of the page to include external scroll buttons (if any).
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.CollapsePanels`                        
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.CommonInit`                            
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.DismissExpandedPanel`                  Dismiss the current externally expanded panel, if there is one.
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.DoGetBestSize`                         Gets the size which best suits the window: for a control, it would be the
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.DoSetSize`                             Sets the size of the window in pixels.
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.ExpandPanels`                          
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.GetDefaultBorder`                      Returns the default border style for :class:`RibbonPage`.
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.GetIcon`                               Get the icon used for the page in the ribbon bar tab area (only displayed if the
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.GetMajorAxis`                          Get the direction in which ribbon panels are stacked within the page.
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.GetMinSize`                            Returns the minimum size of the window, an indication to the sizer layout mechanism
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.HideScrollButtons`                     
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.Layout`                                Layout() -> bool
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.OnEraseBackground`                     Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`RibbonPage`.
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.OnPaint`                               Handles the ``wx.EVT_PAINT`` event for :class:`RibbonPage`.
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.OnSize`                                Handles the ``wx.EVT_SIZE`` event for :class:`RibbonPage`.
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.Realize`                               Perform a full re-layout of all panels on the page.
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.RemoveChild`                           Remove all references to the child from the collapse stack.
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.ScrollLines`                           Scroll the page by some amount up / down / left / right.
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.ScrollPixels`                          Scroll the page by a set number of pixels up / down / left / right.
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.SetArtProvider`                        Set the art provider to be used.
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.SetSizeWithScrollButtonAdjustment`     Set the size of the page and the external scroll buttons (if any).
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.Show`                                  Show(show=True) -> bool
:meth:`~wx.lib.agw.ribbon.page.RibbonPage.ShowScrollButtons`                     
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: RibbonPage(RibbonControl)

   Base class for all the Ribbon stuff. 

   .. method:: __init__(self, parent, id=wx.ID_ANY, label="", icon=wx.NullBitmap, style=0)

      Default class constructor.
      
      :param `parent`: pointer to a parent window, an instance of :class:`~wx.lib.agw.ribbon.bar.RibbonBar`;
      :param `id`: window identifier. If ``wx.ID_ANY``, will automatically create an identifier;
      :param `label`: label to be used in the :class:`~wx.lib.agw.ribbon.bar.RibbonBar`'s tab list for this page (if the
       ribbon bar is set to display labels);
      :param `icon`: the icon used for the page in the ribbon bar tab area (if the ribbon bar is
       set to display icons);
      :param `style`: window style. Currently unused, should be zero.


   .. method:: AdjustRectToIncludeScrollButtons(self, rect)

      Expand a rectangle of the page to include external scroll buttons (if any).
      
      When no scroll buttons are shown, has no effect.
      
      :param `rect`: The rectangle to adjust. The width and height will not be
       reduced, and the x and y will not be increased.


   .. method:: CollapsePanels(self, direction, minimum_amount)


   .. method:: CommonInit(self, label, icon)


   .. method:: DismissExpandedPanel(self)

      Dismiss the current externally expanded panel, if there is one.
      
      When a ribbon panel automatically minimises, it can be externally expanded into
      a floating window. When the user clicks a button in such a panel, the panel
      should generally re-minimise. Event handlers for buttons on ribbon panels should
      call this method to achieve this behaviour.
      
      :returns: ``True`` if a panel was minimised, ``False`` otherwise.


   .. method:: DoGetBestSize(self)

      Gets the size which best suits the window: for a control, it would be the
      minimal size which doesn't truncate the control, for a panel - the same size
      as it would have after a call to `Fit()`.
      
      :return: An instance of :class:`wx.Size`.
      
      :note: Overridden from :class:`wx.Control`.


   .. method:: DoSetSize(self, x, y, width, height, sizeFlags=wx.SIZE_AUTO)

      Sets the size of the window in pixels.
      
      :param integer `x`: required `x` position in pixels, or ``wx.DefaultCoord`` to
       indicate that the existing value should be used;
      :param integer `y`: required `y` position in pixels, or ``wx.DefaultCoord`` to
       indicate that the existing value should be used;
      :param integer `width`: required width in pixels, or ``wx.DefaultCoord`` to
       indicate that the existing value should be used;
      :param integer `height`: required height in pixels, or ``wx.DefaultCoord`` to
       indicate that the existing value should be used;
      :param integer `sizeFlags`: indicates the interpretation of other parameters.
       It is a bit list of the following:
      
       * ``wx.SIZE_AUTO_WIDTH``: a ``wx.DefaultCoord`` width value is taken to indicate a
         wxPython-supplied default width.
       * ``wx.SIZE_AUTO_HEIGHT``: a ``wx.DefaultCoord`` height value is taken to indicate a
         wxPython-supplied default height.
       * ``wx.SIZE_AUTO``: ``wx.DefaultCoord`` size values are taken to indicate a wxPython-supplied
         default size.
       * ``wx.SIZE_USE_EXISTING``: existing dimensions should be used if ``wx.DefaultCoord`` values are supplied.
       * ``wx.SIZE_ALLOW_MINUS_ONE``: allow negative dimensions (i.e. value of ``wx.DefaultCoord``)
         to be interpreted as real dimensions, not default values.
       * ``wx.SIZE_FORCE``: normally, if the position and the size of the window are already
         the same as the parameters of this function, nothing is done. but with this flag a window
         resize may be forced even in this case (supported in wx 2.6.2 and later and only implemented
         for MSW and ignored elsewhere currently).


   .. method:: ExpandPanels(self, direction, maximum_amount)


   .. method:: GetDefaultBorder(self)

      Returns the default border style for :class:`RibbonPage`. 


   .. method:: GetIcon(self)

      Get the icon used for the page in the ribbon bar tab area (only displayed if the
      ribbon bar is actually showing icons).


   .. method:: GetMajorAxis(self)

      Get the direction in which ribbon panels are stacked within the page.
      
      This is controlled by the style of the containing :class:`~wx.lib.agw.ribbon.bar.RibbonBar`, meaning that all
      pages within a bar will have the same major axis. As well as being the direction
      in which panels are stacked, it is also the axis in which scrolling will occur
      (when required).
      
      :returns: ``wx.HORIZONTAL`` or ``wx.VERTICAL`` (never ``wx.BOTH``).


   .. method:: GetMinSize(self)

      Returns the minimum size of the window, an indication to the sizer layout mechanism
      that this is the minimum required size.
      
      This method normally just returns the value set by `SetMinSize`, but it can be overridden
      to do the calculation on demand.


   .. method:: HideScrollButtons(self)


   .. method:: Layout(self)

      Layout() -> bool
      
      Lays out the children of this window using the associated sizer.


   .. method:: OnEraseBackground(self, event)

      Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`RibbonPage`.
      
      :param `event`: a :class:`EraseEvent` event to be processed.


   .. method:: OnPaint(self, event)

      Handles the ``wx.EVT_PAINT`` event for :class:`RibbonPage`.
      
      :param `event`: a :class:`PaintEvent` event to be processed.


   .. method:: OnSize(self, event)

      Handles the ``wx.EVT_SIZE`` event for :class:`RibbonPage`.
      
      :param `event`: a :class:`wx.SizeEvent` event to be processed.


   .. method:: Realize(self)

      Perform a full re-layout of all panels on the page.
      
      Should be called after panels are added to the page, or the sizing behaviour of
      a panel on the page changes (i.e. due to children being added to it). Usually
      called automatically when :meth:`RibbonBar.Realize() <lib.agw.ribbon.bar.RibbonBar.Realize>` is called. Will invoke
      :meth:`RibbonPanel.Realize() <lib.agw.ribbon.panel.RibbonPanel.Realize>` for all child panels.
      
      :note: Reimplemented from :class:`~wx.lib.agw.ribbon.control.RibbonControl`.


   .. method:: RemoveChild(self, child)

      Remove all references to the child from the collapse stack. 


   .. method:: ScrollLines(self, lines)

      Scroll the page by some amount up / down / left / right.
      
      When the page's children are too big to fit in the onscreen area given to the
      page, scroll buttons will appear, and the page can be programmatically scrolled.
      Positive values of will scroll right or down, while negative values will scroll
      up or left (depending on the direction in which panels are stacked). A line is
      equivalent to a constant number of pixels.
      
      :param integer `lines`: number of lines to scroll the page.
      
      :returns: ``True`` if the page scrolled at least one pixel in the given direction,
       ``False`` if it did not scroll.
      
      :note: Reimplemented from :class:`wx.Window`.
      
      :see: :meth:`~RibbonPage.GetMajorAxis`, :meth:`~RibbonPage.ScrollPixels`


   .. method:: ScrollPixels(self, pixels)

      Scroll the page by a set number of pixels up / down / left / right.
      
      When the page's children are too big to fit in the onscreen area given to the
      page, scroll buttons will appear, and the page can be programmatically scrolled.
      Positive values of will scroll right or down, while negative values will scroll
      up or left (depending on the direction in which panels are stacked).
      
      :param integer `pixels`: number of pixels to scroll the page.
      
      :returns: ``True`` if the page scrolled at least one pixel in the given direction,
       ``False`` if it did not scroll.
      
      :see: :meth:`~RibbonPage.GetMajorAxis`, :meth:`~RibbonPage.ScrollLines`


   .. method:: SetArtProvider(self, art)

      Set the art provider to be used.
      
      Normally called automatically by :class:`~wx.lib.agw.ribbon.bar.RibbonBar` when the page is created, or the
      art provider changed on the bar. The new art provider will be propagated to the
      children of the page.
      
      :param `art`: an art provider.
      
      :note: Reimplemented from :class:`~wx.lib.agw.ribbon.control.RibbonControl`.


   .. method:: SetSizeWithScrollButtonAdjustment(self, x, y, width, height)

      Set the size of the page and the external scroll buttons (if any).
      
      When a page is too small to display all of its children, scroll buttons will
      appear (and if the page is sized up enough, they will disappear again). Slightly
      counter-intuively, these buttons are created as siblings of the page rather than
      children of the page (to achieve correct cropping and paint ordering of the
      children and the buttons).
      
      When there are no scroll buttons, this function behaves the same as `SetSize`,
      however when there are scroll buttons, it positions them at the edges of the
      given area, and then calls `SetSize` with the remaining area. This is provided
      as a separate function to `SetSize` rather than within the implementation
      of `SetSize`, as iteracting algorithms may not expect `SetSize` to also
      set the size of siblings.
      
      :param `x`: the page `x` position, in pixels;
      :param `y`: the page `y` position, in pixels;
      :param `width`: the page width, in pixels;
      :param `height`: the page height, in pixels.


   .. method:: Show(self, show=True)

      Show(show=True) -> bool
      
      Shows or hides the window.


   .. method:: ShowScrollButtons(self)


