Class TextField
- Superclasses :
-
gui::Component
- Subclasses :
-
gui::EditListTextField
gui::SpinTextField
- Package :
- gui
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 off 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 ACTION_EVENT is generated when return is pressed,
a CONTENT_CHANGED_EVENT whenever the contents are changed,
a CURSOR_MOVED_EVENT when the cursor moves, and a
SELECTION_CHANGED_EVENT whenver the selection changes.
- Example :
t := TextField()
t.set_pos(50, 250)
# Vertical size will default
t.set_size(100)
t.set_contents("Initial string")
self.add(t)
- Source
Methods inherited from gui::Component |
accepts_focus()
add(c, i)
all_valid()
can_drag(ev)
can_drop(d)
child_validated(c)
clear_accepts_focus()
clear_allow_drag()
clear_allow_drop()
clear_draw_border()
clear_is_shaded()
compute_absolutes()
create_event_and_fire(type, param)
do_handle_event(e)
do_shading(W)
drag_event(d)
drag_reset()
end_drag(d, c)
fatal(s)
finally()
find_accel(e)
find_focus()
fire_icon_events_on_mouse(p, e)
firstly()
generate_components()
get_accel()
get_cbwin_reference()
get_children()
get_cwin_reference()
get_h_reference()
get_parent()
get_parent_buffer_win()
get_parent_dialog()
get_parent_dialog_reference()
get_parent_win()
get_w_reference()
get_x_reference()
get_y_reference()
handle_accel(e)
in_region()
init()
invalidate()
invoke_can_drag(ev)
invoke_can_drop(d)
invoke_drag_event(d)
invoke_drag_reset()
invoke_end_drag(d, c)
is_attrib(s)
is_dialog_open()
is_hidden()
is_shaded()
is_ticking()
is_unhidden()
is_unshaded()
parse_pos(total, s)
remove(c)
retime_ticker(n)
set_abs_coords(x, y)
set_abs_size(w, h)
set_accel(k)
set_accepts_focus()
set_align(x_align, y_align)
set_allow_drag()
set_allow_drop()
set_attribs(x[])
set_attribs_list(l)
set_draw_border()
set_is_shaded()
set_parent(c)
set_parent_dialog(c)
set_pos(x_spec, y_spec)
set_size(w_spec, h_spec)
set_ticker(n, d)
set_tooltip(x)
stop_ticker()
toggle_draw_border()
toggle_is_shaded()
unique_end(x)
unique_start()
validate()
|
Methods inherited from util::SetFields |
as_attrib(attr, val)
attrib(a[])
cset_val(attr, val)
field_error(s)
int_val(attr, val)
int_vals(attr, val, n)
numeric_val(attr, val)
numeric_vals(attr, val, n)
set_fields(l)
string_val(attr, val)
string_vals(attr, val, n)
test_flag(attr, val)
|
Variables inherited from util::Connectable |
listeners
|
clear_mark()
-
- Source
delete_region(e)
-
- Source
display(buffer_flag)
- Overrides display(buffer_flag) in gui::Component
-
- Source
end_handle(e)
-
- Source
get_contents()
-
Return the present contents of the text field.
- Source
get_pasteable_clipboard()
-
- Source
get_region()
-
- Source
got_focus(e)
- Overrides got_focus(e) in gui::Component
-
- Source
handle_copy(e)
-
- Source
handle_cut(e)
-
- Source
handle_default(e)
-
- Source
handle_delete_left(e)
- Private method, not intended for client invocation
handle_delete_line(e)
-
- Source
handle_delete_right(e)
-
- Source
handle_drag(e)
-
- Source
handle_end_of_line(e)
-
- Source
handle_event(e)
- Overrides handle_event(e) in gui::Component
-
- Source
handle_key_left(e)
-
- Source
handle_key_right(e)
-
- Source
handle_paste(e)
-
- Source
handle_press(e)
- Private method, not intended for client invocation
handle_redo()
-
- Source
handle_release(e)
-
- Source
handle_return(e)
-
- Source
handle_select_all(e)
-
- Source
handle_start_of_line(e)
-
- Source
handle_undo()
-
- Source
has_region()
-
- Source
initially()
- Overrides initially() in util::Connectable
-
keeps(e)
- Overrides keeps(e) in gui::Component
-
- Source
keyboard_mark()
-
- Source
lost_focus(e)
- Overrides lost_focus(e) in gui::Component
-
- Source
resize()
- Overrides resize() in gui::Component
-
- Source
set_contents(x)
-
Set the contents of the field. If not invoked then
the initial content is the empty string.
- Parameters :
- x - The contents
- Source
set_displaychar(c)
-
Set the displaychar attribute
- Source
set_filter(c)
-
Set a filter on the characters allowed to be input to the text field.
- Example :
# Permit only hexadecimal characters as input
set_filter('0987654321abcdefABCDEF')
- Parameters :
- c - The cset of permissible characters.
- Source
set_one(attr, val)
- Overrides set_one(attr, val) in util::SetFields
-
- Source
start_handle(e)
-
- Source
tick()
- Overrides tick() in gui::Component
-
- Source
whereis_x()
-
- Source
changed
-
contents
-
cursor
-
displaychar
-
filter
-
going_left
-
is_held
-
leftmost
-
mark
-
old_cursor
-
old_has_region
-
printable
-
rightmost
-
tw
-
tx
-
undo_manager
-