The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

PyFrame Guide to wxPython

Copyright and License information Home

__ A B C D E F G H I L M P R S T U V W

wxStyledTextCtrl - Scrolling

  • GetEndAtLastLine

  • GetScrollWidth

  • GetUseHorizontalScrollBar

  • GetXOffset

  • LineScroll

  • ScrollToColumn

  • ScrollToLine

  • SetEndAtLastLine

  • SetHScrollBar

  • SetScrollWidth

  • SetUseHorizontalScrollBar

  • SetVScrollBar

  • SetXOffset

Summary:

This section deals with scrolling, and has two methods not shown in the Scintilla documentation: ScrollToColumn and ScrollToLine.

Note that the SetHScrollBar method does not perform as one might think from the Scintilla documentation, it works differently in wxPython/wxWindows: in 'pure' Scintilla, SetHScrollBar turns the horizontal scrollbar on and off. In wxPython, this is done with SetUseHorizontalScrollBar. In wxPython, SetHScrollBar allows you to change the horizontal scrollbar widget. Also, there's no GetHScrollBar, as you might expect. That functionality (seeing whether or not the scrollbar is active) is provided by GetUseHorizontalScrollBar. Finally, there's also a SetVScrollBar method that allows you to change the vertical scrollbar widget.

Also note: SetXCaretPolicy and SetYCaretPolicy are here. SetVisiblePolicy is here. The ScrollCaret method shown in the Scintilla documentation is renamed to EnsureCaretVisible, in the caret documentation.

----

GetEndAtLastLine()

Returns an integer with the maximum scroll range mode. See SetEndAtLastLine.

top

----

GetScrollWidth()

Returns an integer with the assumed document width in pixels. See SetScrollWidth.

top

----

GetUseHorizontalScrollBar()

Returns an integer with the value 1 if the horizontal scroll bar is in use or 0 if it is not in use.

top

----

GetXOffset()

Returns an integer with the horizontal scroll position. See SetXOffset

top

----

LineScroll(columns,lines)

The integer parameters columns and lines are used to specify how far to scroll the display from the current position. Positive values for line move the text upwards (and increase the line number, which may or may not be shown by you), negative values move the text downwards. Returns None.

top

----

ScrollToColumn(column)

Scroll enough to make the column that's specified by the integer parameter column visible. Returns None.

top

----

ScrollToLine(line)

Scroll enough to make the line that's specified by the integer parameter line visible. Returns None.

top

----

SetEndAtLastLine(endAtLastLine)

This method allows you to choose whether or not the scroll range ends with the last line at the bottom of the view (endAtLastLine=1, the default) or whether scrolling should continue until one page below the last line (endAtLastLine=0). Returns None.

top

----

SetHScrollBar(bar)

This method allows you to substitute a different scroll bar than the one normally used by the STC. The bar argument must be an instance of a wxScrollBar. Returns None. NOTE: this method behaves much differently than the one that's documented in the Scintialla docs (which turns the scrollbar on/off; to do that, see SetUseHorizontalScrollBar). You may need to turn off the STC scrollbar (?). Returns None.

top

----

SetScrollWidth(pixelwidth)

Sets the document width to the value of the integer parameter pixelwidth (default = 2000 pixels). This is used to set the display parameters for the horizontal scrollbar widget; basically making sure the scroller's thumb is the right width and that the scrollbar roughly corresponds to the width of the document. Returns None.

top

----

SetUseHorizontalScrollBar(show)

Turn the horizontal scrollbar on (1) or off (0) depending on the value of the integer parameter show. Has no effect if the bar's state would be the same (if show=1 but bar is shown and vice-versa). Returns None.

top

----

SetVScrollBar(bar)

Substitute a different vertical scroll bar for the one provided by the STC. The parameter must be an instance of a wxScrollBar. (Need to shut off the STC's scrollbar??). Returns None.

top

----

SetXOffset(newOffset)

The horizontal scroll position in pixels of the start of the text view is set to the value of the integer parameter newOffset. A value of 0 is the normal position with the first text column visible at the left of the view. Returns None.

top

----