Extends TextFormatter with functionality for tracking a displayed area
within the formatted text, tracking a cursor, and regular expression
search through the text.
|
__init__(self,
text)
Create a viewport on the given Text object positioned at [0,0] |
|
|
|
|
|
set_tail(self,
tail)
Instruct this viewport to start or stop tailing the content. |
|
|
|
set_size(self,
height,
width)
Set the size of this viewport, adjusting position to ensure that the
cursor is visible. |
|
|
|
_align_display(self)
If necessary, adjust display_pos to ensure that cursor_pos is within
the viewport. |
|
|
|
_len_curline(self)
Return the length of the line containing the cursor. |
|
|
MutableText
|
get_lines(self,
search=None)
Get formatted lines appropriate for drawing to a UI window. |
|
|
|
_get_trim(self)
Easy access to the trim format. |
|
|
|
|
Coordinates
|
get_cursor_pos(self)
Get the cursor position relative to the top left corner of the output
from get_lines(). |
|
|
Coordinates
|
get_end_pos(self)
Get the text end position relative to the top left corner of the
output from get_lines(). |
|
|
|
move_cursor_left(self,
count) |
|
|
|
move_display_left(self,
count) |
|
|
|
move_cursor_right(self,
count) |
|
|
|
move_display_right(self,
count) |
|
|
|
move_cursor_up(self,
count) |
|
|
|
move_display_up(self,
count) |
|
|
|
move_cursor_down(self,
count) |
|
|
|
move_display_down(self,
count) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
move_search(self,
pattern,
forward=True,
from_end=False)
Update the display and cursor positions to the next match of the
given pattern. |
|
|
Inherited from text_formatter.TextFormatter :
char_at ,
coord_diff ,
coord_down_fline ,
coord_line_start ,
coord_up_fline ,
coord_visi ,
get_format ,
get_text ,
search ,
set_format ,
set_text ,
text_width
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|