Class TextField

Summary

#
  A class for a single input line of text.  The text can
  scroll within the area specified.  By default, a border
  surrounds the text area; this can be turned of by using
  {toggle_draw_border()}.

  The horizontal size must be set by the {set_size()} method:
  there is no default (the vertical size will default, however).

  An event is generated when return is pressed (with code 0),
  and whenever the contents are changed (with code 1).

  @example
  @ t := TextField()
  @ t$set_pos(50, 250)
  @ # Vertical size will default
  @ t$set_size(100)
  @ t$set_contents("Initial string")
  @ self$add(t)

Superclasses:
Component

Package:
(main)
File:
textfield.icn
Methods:
display, get_contents, handle_default, handle_delete1, handle_delete_2, handle_delete_line, handle_end_of_line, handle_event, handle_key_left, handle_key_right, handle_press, handle_return, handle_start_of_line, resize, set_contents, set_displaychar, set_filter

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, finally, 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, handle_notify, 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 Ticker:
is_ticking, retime_ticker, set_ticker, stop_ticker, tick

Fields:
contents, cursor, displaychar, filter, leftmost, printable, rightmost, tw, tx

Source code.

Details
Constructor

TextField(argv)

Methods:

display(buffer_flag)

This method overrides display in class Component

get_contents()

#
  Return the present contents of the text field.


handle_default(e)


handle_delete1(e)


 Delete


handle_delete_2(e)


handle_delete_line(e)


handle_end_of_line(e)


handle_event(e)

This method overrides handle_event in class Component

handle_key_left(e)


handle_key_right(e)


handle_press()


 Mouse click - compute new cursor position, re-display


handle_return(e)


handle_start_of_line(e)


resize()

This method overrides resize in class Component

set_contents(x)

#
  Set the contents of the field.  If not invoked then
  the initial content is the empty string.
  @param x   The contents


set_displaychar(c)


set_filter(c)

#
  Set a filter on the characters allowed to be input to the text field.
  @param c  The cset of permissible characters.
  @example
  @ # Permit only hexadecimal characters as input
  @ set_filter('0987654321abcdefABCDEF')


Fields:
contents

cursor

displaychar -- char to print on screen

filter -- Cset for filtering characters

leftmost

printable -- The printable characters

rightmost

tw

tx


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