.. wxPython Phoenix documentation

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

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

.. include:: headings.inc

.. currentmodule:: wx.lib.scrolledpanel

.. highlight:: python



.. _wx.lib.scrolledpanel.ScrolledPanel:

==========================================================================================================================================
|phoenix_title|  **wx.lib.scrolledpanel.ScrolledPanel**
==========================================================================================================================================

:class:`ScrolledPanel` fills a "hole" in the implementation of
:class:`ScrolledWindow`, providing automatic scrollbar and scrolling
behavior and the tab traversal management that :class:`ScrolledWindow` lacks.



|

|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>ScrolledPanel</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.scrolledpanel.ScrolledPanel_inheritance.png" alt="Inheritance diagram of ScrolledPanel" 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.ScrolledWindow.html" title="wx.ScrolledWindow" alt="" coords="51,392,191,421"/> <area shape="rect" id="node8" href="wx.lib.scrolledpanel.ScrolledPanel.html" title="wx.lib.scrolledpanel.ScrolledPanel" alt="" coords="5,469,237,499"/> <area shape="rect" id="node3" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="13,5,115,35"/> <area shape="rect" id="node4" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="65,83,176,112"/> <area shape="rect" id="node6" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="61,160,181,189"/> <area shape="rect" id="node5" href="wx.Object.html" title="wx.Object" alt="" coords="139,5,220,35"/> <area shape="rect" id="node7" href="wx.Window.html" title="wx.Window" alt="" coords="77,237,165,267"/> </map> 
   </p>

|


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

:class:`wx.ScrolledWindow`

|


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

================================================================================ ================================================================================
:meth:`~wx.lib.scrolledpanel.ScrolledPanel.__init__`                             Default class constructor.
:meth:`~wx.lib.scrolledpanel.ScrolledPanel.OnChildFocus`                         If the child window that gets the focus is not fully visible,
:meth:`~wx.lib.scrolledpanel.ScrolledPanel.ScrollChildIntoView`                  Scroll the panel so that the specified child window is in view.
:meth:`~wx.lib.scrolledpanel.ScrolledPanel.SetupScrolling`                       This function sets up the event handling necessary to handle
================================================================================ ================================================================================


|


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


.. class:: ScrolledPanel(wx.ScrolledWindow)

   :class:`ScrolledPanel` fills a "hole" in the implementation of
   :class:`ScrolledWindow`, providing automatic scrollbar and scrolling
   behavior and the tab traversal management that :class:`ScrolledWindow` lacks.

   .. method:: __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.TAB_TRAVERSAL, name="scrolledpanel")

      Default class constructor.
      
      :param wx.Window `parent`: parent window. Must not be ``None``;
      :param integer `id`: window identifier. A value of -1 indicates a default value;
      :param `pos`: the control position. A value of (-1, -1) indicates a default position,
       chosen by either the windowing system or wxPython, depending on platform;
      :type `pos`: tuple or :class:`wx.Point`
      :param `size`: the control size. A value of (-1, -1) indicates a default size,
       chosen by either the windowing system or wxPython, depending on platform;
      :type `size`: tuple or :class:`wx.Size`
      :param integer `style`: the underlying :class:`wx.ScrolledWindow` style;
      :param string `name`: the scrolled panel name.


   .. method:: OnChildFocus(self, evt)

      If the child window that gets the focus is not fully visible,
      this handler will try to scroll enough to see it.
      
      :param `evt`: a :class:`ChildFocusEvent` event to be processed.


   .. method:: ScrollChildIntoView(self, child)

      Scroll the panel so that the specified child window is in view.
      
      :param wx.Window `child`: any :class:`wx.Window` - derived control.
      
      .. note:: This method looks redundant if `evt.Skip()` is
         called as well - the base :class:`ScrolledWindow` widget now seems
         to be doing the same thing anyway.


   .. method:: SetupScrolling(self, scroll_x=True, scroll_y=True, rate_x=20, rate_y=20, scrollToTop=True, scrollIntoView=True)

      This function sets up the event handling necessary to handle
      scrolling properly. It should be called within the `__init__`
      function of any class that is derived from :class:`ScrolledPanel`,
      once the controls on the panel have been constructed and
      thus the size of the scrolling area can be determined.
      
      :param bool `scroll_x`: ``True`` to allow horizontal scrolling, ``False`` otherwise;
      :param bool `scroll_y`: ``True`` to allow vertical scrolling, ``False`` otherwise;
      :param int `rate_x`: the horizontal scroll increment;
      :param int `rate_y`: the vertical scroll increment;
      :param bool `scrollToTop`: ``True`` to scroll all way to the top, ``False`` otherwise;
      :param bool `scrollIntoView`: ``True`` to scroll a focused child into view, ``False`` otherwise.


