Class EditableTextList

Summary


  A scrollable editable text area.  An {Event} is generated whenever the
  contents are changed by the user.

Superclasses:
ScrollArea

Package:
(main)
File:
editabletextlist.icn
Methods:
clear_modified, constrain_cursor, constrain_line, cut_selection, display, draw, draw23, get_cutregion_1_line, get_cutregion_cr, get_cutregion_first, get_cutregion_last, get_cutregion_mid, get_max_width, get_region, get_selection, handle_default, handle_delete_1, handle_delete_2, handle_delete_line, handle_drag, handle_end_of_line, handle_event, handle_key_down, handle_key_end, handle_key_home, handle_key_left, handle_key_page_down, handle_key_page_up, handle_key_right, handle_key_up, handle_map_pos, handle_nodefault, handle_notify, handle_press, handle_redo, handle_release, handle_return, handle_start_of_line, handle_tab_text, handle_undo, map_pos, offset_pos, reset_drag, reset_spell, resize, select_all, set_contents, set_cursor_y, set_selection, text_area_to_high, text_area_to_high_spell

Methods inherited from Component:
accepts_tab_focus, attrib, clear_accepts_tab_focus, clear_draw_border, clear_is_shaded, clear_no_updates, do_shading, error, final_setup, firstly, generate_all_components, generate_components, get_cbwin_reference, get_cwin_reference, get_h_reference, get_parent_Dialog, get_parent_buffer_win, get_parent_win, get_visible_reference, get_w_reference, get_x_reference, get_y_reference, got_focus, in_region, is_hidden, is_shaded, is_unhidden, is_unshaded, lost_focus, parse_pos, redisplay, set_abs_coords, set_abs_size, set_accepts_tab_focus, set_align, set_attribs, set_attribs_list, set_draw_border, set_is_shaded, set_no_updates, set_parent_Dialog, set_pos, set_size, set_tooltip, toggle_draw_border, toggle_is_shaded, unique_end, unique_start

Methods inherited from MetaComponent:
set_fields

Methods inherited from ScrollArea:
actual_line, clear_selections, compute_and_redisplay, end_state, finally, get_checked, get_contents, get_last_line, get_left_pos, get_line, get_line_height, get_page_size, get_prev_down, get_selections, get_which_down, goto_pos, handle_tab_texts, object_get_prev_down, object_get_selections, object_get_which_down, object_set_selections, refresh, set_checked, set_internal_fields, set_select_many, set_select_one, set_selections, text_area_to_buffer, tick

Methods inherited from Ticker:
is_ticking, retime_ticker, set_ticker, stop_ticker

Fields:
changed, cursor_x, cursor_y, donedrag, enddragx, enddragy, long_line, modified, moved, noedit, printable, redolist, startdragx, startdragy, undolist, wordlist

Source code.

Details
Constructor

EditableTextList(printable, cursor_x, cursor_y, changed, long_line, moved, startdragx, enddragx, startdragy, enddragy, donedrag, undolist, redolist, wordlist, noedit, modified)

Parameters:
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:

clear_modified()


constrain_cursor()


 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.


constrain_line()


 Move the text area displayed so that the cursor is on the screen.


cut_selection(undo, ev)


  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. 


display(buffer_flag)


This method overrides display in class ScrollArea

draw(s, left_pos, yp, i)


  Added Editable Textlist version of draw

This method overrides draw in class ScrollArea

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()


  get_max_width() allows for the actual line with the tabs

This method overrides get_max_width in class ScrollArea

get_region(i)


  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
 


get_selection()

  method added to retieve a highlighted section swj 
  returns a list of strings for Copy
#


handle_default(e, cntl, undo)


handle_delete_1(e, undo)


handle_delete_2(e, no_offset)


handle_delete_line(e)


handle_drag(e)

This method overrides handle_drag in class ScrollArea

handle_end_of_line(e)


handle_event(e)

This method overrides handle_event in class ScrollArea

handle_key_down(e)

This method overrides handle_key_down in class ScrollArea

handle_key_end(e)

This method overrides handle_key_end in class ScrollArea

handle_key_home(e)

This method overrides handle_key_home in class ScrollArea

handle_key_left(e)

This method overrides handle_key_left in class ScrollArea

handle_key_page_down(e)

This method overrides handle_key_page_down in class ScrollArea

handle_key_page_up(e)

This method overrides handle_key_page_up in class ScrollArea

handle_key_right(e)

This method overrides handle_key_right in class ScrollArea

handle_key_up(e)

This method overrides handle_key_up in class ScrollArea

handle_map_pos(posx, pos_line2, tabpos)


 helper method for map_pos


handle_nodefault()


 added to prevent reset of drag positions when ^x,^c,^v 


handle_notify(e)

This method overrides handle_notify in class ScrollArea

handle_press(e)

This method overrides handle_press in class ScrollArea

handle_redo(e)


 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.


handle_release(e)

This method overrides handle_release in class ScrollArea

handle_return(e, undo)


handle_start_of_line(e)


handle_tab_text(e, undo)


 Add tab character at cursor position and tab cursor


handle_undo(e, no_redo)


 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. 
  


reset_drag()


reset_spell(x, y)


resize()

This method overrides resize in class ScrollArea

select_all()


set_contents(x)

##

This method overrides set_contents in class ScrollArea

set_cursor_y(n)


 Move cursor y to line n, and constrain x within range of that line.


set_selection(slst, undo)


  method added to support paste
  parameter s is a list of strings


text_area_to_high()

____________________________________________________________________


text_area_to_high_spell(cx, cy)

________________________________________________________________________


Fields:
changed

cursor_x

cursor_y

donedrag

enddragx

enddragy

long_line

modified -- not the same as "changed"; external needs-to-be-saved flag

moved

noedit

printable -- The printable characters

redolist

startdragx

startdragy

undolist

wordlist


This page produced by UniDoc on 2021/04/15 @ 23:59:53.