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

.. 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>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.scrolledpanel.ScrolledPanel.html" title="ScrolledPanel fills a 'hole' in the implementation of" alt="" coords="5,469,253,499"/> <area shape="rect" id="node2" href="wx.ScrolledWindow.html" title="Scrolled window derived from wx.Panel." alt="" coords="53,392,205,421"/> <area shape="rect" id="node4" href="wx.Window.html" title="wx.Window  is the base class for all windows and represents any visible object on screen." alt="" coords="81,237,178,267"/> <area shape="rect" id="node5" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="64,160,195,189"/> <area shape="rect" id="node6" href="wx.EvtHandler.html" title="A class that can handle events from the windowing system." alt="" coords="70,83,189,112"/> <area shape="rect" id="node7" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="24,5,112,35"/> <area shape="rect" id="node8" href="wx.Trackable.html" title="Add-on base class for a trackable object." alt="" coords="137,5,247,35"/> </map> 
   </p>
   </div>

|


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