.. wxPython Phoenix documentation

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

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

.. include:: headings.inc



.. _wx.ribbon.RibbonPage:

==========================================================================================================================================
|phoenix_title|  **wx.ribbon.RibbonPage**
==========================================================================================================================================

Container for related ribbon panels, and a tab within a ribbon bar.          









.. seealso:: :ref:`wx.ribbon.RibbonBar`    







.. seealso:: :ref:`wx.ribbon.RibbonPanel`  







|

|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.ribbon.RibbonPage_inheritance.png" alt="Inheritance diagram of RibbonPage" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.Control.html" title="wx.Control" alt="" coords="60,237,148,267"/> <area shape="rect" id="node6" href="wx.ribbon.RibbonControl.html" title="wx.ribbon.RibbonControl" alt="" coords="17,315,191,344"/> <area shape="rect" id="node2" href="wx.Window.html" title="wx.Window" alt="" coords="59,160,148,189"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="5,5,87,35"/> <area shape="rect" id="node4" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="48,83,159,112"/> <area shape="rect" id="node5" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="112,5,213,35"/> <area shape="rect" id="node7" href="wx.ribbon.RibbonPage.html" title="wx.ribbon.RibbonPage" alt="" coords="24,392,183,421"/> </map> 
   </p>

|


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

================================================================================ ================================================================================
:meth:`~wx.ribbon.RibbonPage.__init__`                                           Default constructor.
:meth:`~wx.ribbon.RibbonPage.AdjustRectToIncludeScrollButtons`                   Expand a rectangle of the page to include external scroll buttons (if any).
:meth:`~wx.ribbon.RibbonPage.Create`                                             Create a ribbon page in two-step ribbon page construction.
:meth:`~wx.ribbon.RibbonPage.DismissExpandedPanel`                               Dismiss the current externally expanded panel, if there is one.
:meth:`~wx.ribbon.RibbonPage.GetClassDefaultAttributes`                          
:meth:`~wx.ribbon.RibbonPage.GetIcon`                                            Get the icon used for the page in the ribbon bar tab area (only displayed if the ribbon bar is actually showing icons).
:meth:`~wx.ribbon.RibbonPage.GetMajorAxis`                                       Get the direction in which ribbon panels are stacked within the page.
:meth:`~wx.ribbon.RibbonPage.Realize`                                            Perform a full re-layout of all panels on the page.
:meth:`~wx.ribbon.RibbonPage.ScrollLines`                                        Scroll the page by some amount up / down / left / right.
:meth:`~wx.ribbon.RibbonPage.ScrollPixels`                                       Scroll the page by a set number of pixels up / down / left / right.
:meth:`~wx.ribbon.RibbonPage.ScrollSections`                                     Scroll the page by an entire child section.
:meth:`~wx.ribbon.RibbonPage.SetArtProvider`                                     Set the art provider to be used.
:meth:`~wx.ribbon.RibbonPage.SetSizeWithScrollButtonAdjustment`                  Set the size of the page and the external scroll buttons (if any).
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.ribbon.RibbonPage.Icon`                                               See :meth:`~wx.ribbon.RibbonPage.GetIcon`
:attr:`~wx.ribbon.RibbonPage.MajorAxis`                                          See :meth:`~wx.ribbon.RibbonPage.GetMajorAxis`
================================================================================ ================================================================================


|


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


.. class:: wx.ribbon.RibbonPage(RibbonControl)

   **Possible constructors**::

       RibbonPage()
       
       RibbonPage(parent, id=ID_ANY, label="", icon=NullBitmap, style=0)
       
   
   Container for related ribbon panels, and a tab within a ribbon bar.



   .. method:: __init__(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **__init__** `(self)`
      
      Default constructor.                  
      
      With this constructor, :meth:`Create`   should be called in order to create the ribbon page.                   
      
      
      
      
      **~~~**

      
      **__init__** `(self, parent, id=ID_ANY, label=EmptyString, icon=NullBitmap, style=0)`
      
      Constructs a ribbon page, which must be a child of a ribbon bar.                  
      
      
      
      
      :param `parent`: Pointer to a parent :ref:`wx.ribbon.RibbonBar`  (unlike most controls, a :ref:`wx.ribbon.RibbonPage`  can only have :ref:`wx.ribbon.RibbonBar`  as a parent).   
      :type `parent`: wx.ribbon.RibbonBar
      :param `id`: Window identifier.   
      :type `id`: wx.WindowID
      :param `label`: Label to be used in the :ref:`wx.ribbon.RibbonBar`'s tab list for this page (if the ribbon bar is set to display labels).   
      :type `label`: string
      :param `icon`: Icon to be used in the :ref:`wx.ribbon.RibbonBar`'s tab list for this page (if the ribbon bar is set to display icons).   
      :type `icon`: wx.Bitmap
      :param `style`: Currently unused, should be zero.   
      :type `style`: long
      
      
      
      
      
      
      
      
      
      
      
      
                        
      
      
      
      
      **~~~**






   .. 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.   
      :type `rect`: wx.Rect




                  





   .. method:: Create(self, parent, id=ID_ANY, label=EmptyString, icon=NullBitmap, style=0)

      Create a ribbon page in two-step ribbon page construction.                  

      Should only be called when the default constructor is used, and arguments have the same meaning as in the full constructor.                  


      :param `parent`: 
      :type `parent`: wx.ribbon.RibbonBar
      :param `id`: 
      :type `id`: wx.WindowID
      :param `label`: 
      :type `label`: string
      :param `icon`: 
      :type `icon`: wx.Bitmap
      :param `style`: 
      :type `style`: long




      :rtype: `bool`








   .. 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. 

                

      :rtype: `bool`







      :returns: 

         ``True`` if a panel was minimised, ``False`` otherwise.   








   .. staticmethod:: GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)




      :param `variant`: 
      :type `variant`: wx.WindowVariant




      :rtype: :ref:`VisualAttributes`








   .. 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).                  

      :rtype: :ref:`Bitmap`








   .. method:: GetMajorAxis(self)

      Get the direction in which ribbon panels are stacked within the page.                  

      This is controlled by the style of the containing :ref:`wx.ribbon.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). 

                

      :rtype: :ref:`wx.Orientation`







      :returns: 

         ``wx.HORIZONTAL`` or ``wx.VERTICAL`` (never ``wx.BOTH``).   








   .. 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:`wx.ribbon.RibbonBar.Realize`   is called. 

      Will invoke :meth:`wx.ribbon.RibbonPanel.Realize`   for all child panels.                  

      :rtype: `bool`








   .. 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 `lines`  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 `lines`: 
      :type `lines`: int




      :rtype: `bool`







      :returns: 

         ``True`` if the page scrolled at least one pixel in the given direction, ``False`` if it did not scroll.  







      .. seealso:: :meth:`GetMajorAxis`     







      .. seealso:: :meth:`ScrollPixels`     







      .. seealso:: :meth:`ScrollSections`     








   .. 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 `lines`  will scroll right or down, while negative values will scroll up or left (depending on the direction in which panels are stacked). 

                


      :param `pixels`: 
      :type `pixels`: int




      :rtype: `bool`







      :returns: 

         ``True`` if the page scrolled at least one pixel in the given direction, ``False`` if it did not scroll.  







      .. seealso:: :meth:`GetMajorAxis`     







      .. seealso:: :meth:`ScrollLines`     







      .. seealso:: :meth:`ScrollSections`     








   .. method:: ScrollSections(self, sections)

      Scroll the page by an entire child section.                  

      The `sections`  parameter value should be 1 or -1. This will scroll enough to uncover a partially visible child section or totally uncover the next child section that may not be visible at all. 

                


      :param `sections`: 
      :type `sections`: int




      :rtype: `bool`







      :returns: 

         ``True`` if the page scrolled at least one pixel in the given direction, ``False`` if it did not scroll.  







      .. versionadded:: 2.9.5 
     







      .. seealso:: :meth:`ScrollPixels`     







      .. seealso:: :meth:`ScrollSections`   








   .. method:: SetArtProvider(self, art)

      Set the art provider to be used.                  

      Normally called automatically by :ref:`wx.ribbon.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`: 
      :type `art`: wx.ribbon.RibbonArtProvider







   .. 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-intuitively, 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 :meth:`SetSize` , however when there are scroll buttons, it positions them at the edges of the given area, and then calls :meth:`SetSize`   with the remaining area. 

      This is provided as a separate function to :meth:`SetSize`   rather than within the implementation of :meth:`SetSize` , as interacting algorithms may not expect :meth:`SetSize`   to also set the size of siblings.                  


      :param `x`: 
      :type `x`: int
      :param `y`: 
      :type `y`: int
      :param `width`: 
      :type `width`: int
      :param `height`: 
      :type `height`: int







   .. attribute:: Icon

      See :meth:`~wx.ribbon.RibbonPage.GetIcon`


   .. attribute:: MajorAxis

      See :meth:`~wx.ribbon.RibbonPage.GetMajorAxis`

