Table Of Contents

Previous topic

scrolledpanel

Next topic

sheet

This Page

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

Inheritance diagram of ScrolledPanel


super_classes Known Superclasses

PyScrolledWindow


method_summary Methods Summary

__init__  
OnChildFocus If the child window that gets the focus is not fully visible,
ScrollChildIntoView Scroll the panel so that the specified child window is in
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.


Methods



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


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.



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



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.