Class EditableTextList |
A scrollable editable text area. An {Event} is generated whenever the contents are changed by the user.
Details |
Constructor |
printable | The printable characters
|
cursor_x | |
cursor_y | |
changed | |
long_line | |
moved | |
startdragx | |
enddragx | |
startdragy | |
enddragy | |
donedrag | |
undolist | |
redolist | |
wordlist | |
noedit | |
modified | not the same as "changed"; external needs-to-be-saved flag
|
Methods: |
Move cursor so that it is in the text area, if possible. May not be possible if cursor at end of line to the left of the text area.
Move the text area displayed so that the cursor is on the screen.
This method added to support Cut It removes the highlighted region from self.contents This cut was modeled after Emacs editor and therefore removes the carriage return at the end of lines so they are merged.
Added Editable Textlist version of draw
draw23(s, left_pos, yp, i, sx, ex, nc)
___________________________________________________________________
get_cutregion_1_line(i, sx, ex, undo, flag1)
method to cut on just one line no vertical drag
get_cutregion_cr(i, ex, ey, sx, sy)
method to remove carriage return on the line before(forward drag) or after(backward drag). This will merge the two lines.
get_cutregion_first(i, ex, ey, sx, sy, flag2)
method to cut the highlighted regions of the first and last lines when more than one line is highlighted set flag1 if drag on last line does not include the entire line. This will indicate that the carriage return on the previous line must be deleted so the lines will be merged and will behave like the Emacs Editor.
get_cutregion_last(i, ex, ey, sx, sy, flag1)
get_cutregion_mid(s, i, ex, ey, sx, sy)
method to cut the lines in the middle of the highlighted region
get_max_width() allows for the actual line with the tabs
returns the string that is highlighted for each line of self.contents s is the line of self.contents and i is line number or y position
method added to retieve a highlighted section swj returns a list of strings for Copy #
handle_map_pos(posx, pos_line2, tabpos)
helper method for map_pos
added to prevent reset of drag positions when ^x,^c,^v
Redo the last undo. Only one redo allowed. Undo puts the last undo on the redolist so redo pulls it off and calls undo with a parameter no_redo so the redo does not get put on the redolist again.
Add tab character at cursor position and tab cursor
The undo list is built for each event. This method gets the last item off the list and undos it using the same routines. A non-null parameter is passed to cut_selection, set_selection, and handle_return so that these undo actions are not put back on the undo list.
map_pos(pos_line, vertical_key)
offset_pos(tab_line, endpos, use_selfcontents)
This method returns the offset(or number of added blanks because of the tabs) up to the end position. If the use_selfcontents parameter is null then the number of blanks up to the position (endpos) in the actual line (the line with the blanks that is displayed) is returned. If use_selfcontents is not null, then the number of blanks that would be inserted up to the position (endpos) in self.contents is returned.
##
Move cursor y to line n, and constrain x within range of that line.
method added to support paste parameter s is a list of strings
____________________________________________________________________
text_area_to_high_spell(cx, cy)
________________________________________________________________________
Fields: |