.. include:: headings.inc .. currentmodule:: lib.scrolledpanel .. highlight:: python .. _lib.scrolledpanel.ScrolledPanel: ========================================================================================================================================== |phoenix_title| **ScrolledPanel** ========================================================================================================================================== ScrolledPanel fills a "hole" in the implementation of wx.ScrolledWindow, providing automatic scrollbar and scrolling behavior and the tab traversal management that wxScrolledWindow lacks. This code was based on the original demo code showing how to do this, but is now available for general use as a proper class (and the demo is now converted to just use it.) It is assumed that the ScrolledPanel will have a sizer, as it is used to calculate the minimal virtual size of the panel and etc. | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **ScrolledPanel** .. raw:: html

Inheritance diagram of ScrolledPanel

| |super_classes| Known Superclasses ================================== :class:`PyScrolledWindow` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~lib.scrolledpanel.ScrolledPanel.__init__` :meth:`~lib.scrolledpanel.ScrolledPanel.OnChildFocus` If the child window that gets the focus is not fully visible, :meth:`~lib.scrolledpanel.ScrolledPanel.ScrollChildIntoView` Scroll the panel so that the specified child window is in :meth:`~lib.scrolledpanel.ScrolledPanel.SetupScrolling` This function sets up the event handling necessary to handle ================================================================================ ================================================================================ | |api| Class API =============== .. class:: ScrolledPanel( PyScrolledWindow ) ScrolledPanel fills a "hole" in the implementation of wx.ScrolledWindow, providing automatic scrollbar and scrolling behavior and the tab traversal management that wxScrolledWindow lacks. This code was based on the original demo code showing how to do this, but is now available for general use as a proper class (and the demo is now converted to just use it.) It is assumed that the ScrolledPanel will have a sizer, as it is used to calculate the minimal virtual size of the panel and etc. .. method:: __init__(self, parent, id=-1, pos = DefaultPosition, size = DefaultSize, style = TAB_TRAVERSAL, name = "scrolledpanel") .. 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. .. method:: ScrollChildIntoView(self, child) Scroll the panel so that the specified child window is in view. NOTE. This method looks redundant if evt.Skip() is called as well - the base wx.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 ScrolledPanel, once the controls on the panel have been constructed and thus the size of the scrolling area can be determined.