home
wiki
classes/clusters list
class information
+
Point of view
ROOT_WINDOW
ANY
TEXT_CURSOR_JOB
ROOT_WINDOW
WINDOW
WIDGET
EXTENSION_DEVICE
DRAW_STYLE
DRAWABLE_HANDLER
VISION
DRAWABLE
CONTAINER
LAYOUT
INTERNALS_HANDLER
All features
class TEXT_FIELD
Summary
top
Class creates a text field which allows the user to grab a single line of text.
Direct parents
inherit list:
SUB_WINDOW
Class invariant
top
width >= 1
height >= 1
std_width > 0
std_height > 0
Overview
top
creation features
make
(p:
CONTAINER
)
make_layout
(p:
CONTAINER
, lo:
LAYOUT
)
sub_window_create
(x:
INTEGER_32
, y:
INTEGER_32
, w:
INTEGER_32
, h:
INTEGER_32
, parent_window:
WINDOW
)
default_create
Default creation method.
exported features
text
:
UNICODE_STRING
set_text
(new_text:
UNICODE_STRING
)
default_init
set_parent
(p:
CONTAINER
)
set_background_color
(c:
COLOR
)
The color is copied, next changes to c won't change the background.
set_background_pixmap
(p:
PIXMAP
)
Call this function again if you modify the pixmap (copy may have been done)
map
unmap
mapped
:
BOOLEAN
Warning: this information is asynchronous
expose_event
clear_without_expose
clear the all the drawable area.
area
:
RECT
refresh
clear and update entire object (sub_window(s) are not updated).
clear
clear and update entire object (sub_window(s) are not updated).
as_x_root
(x:
INTEGER_32
):
INTEGER_32
TODO: add basic conversion to speed up
as_y_root
(y:
INTEGER_32
):
INTEGER_32
TODO: add basic conversion to speed up
adjust_size
layout
:
LAYOUT
width
:
INTEGER_32
height
:
INTEGER_32
min_width
:
INTEGER_32
min_height
:
INTEGER_32
std_width
:
INTEGER_32
std_height
:
INTEGER_32
layout_update_paused
:
BOOLEAN
TODO: suppress.
set_layout
(l:
LAYOUT
)
Change the layout for the container (layout choose children position and size).
layout_pause
TODO: remove when mapped ready
layout_continue
TODO: remove when mapped ready
child_attach
(w:
WIDGET
)
Add widget
w
in this container.
child_detach
(w:
WIDGET
)
Remove widget
w
from this container.
has_child
(w:
WIDGET
):
BOOLEAN
last_child
:
WIDGET
is_empty
:
BOOLEAN
clear_area
(x:
INTEGER_32
, y:
INTEGER_32
, w:
INTEGER_32
, h:
INTEGER_32
)
clear area and emit expose event (contents will be drawn) x and y are relative to current object
done
:
BOOLEAN
TODO: suppress.
child_requisition_changed
layout_ready
:
BOOLEAN
drawing_widget
:
POINTER
Because Windows can not paint on widgets like windows or bitmaps, it needs another object (Device Context) attached to the widget.
parent
:
CONTAINER
pos_x
:
INTEGER_32
pos_y
:
INTEGER_32
x_shrink_allowed
:
BOOLEAN
x_expand_allowed
:
BOOLEAN
y_shrink_allowed
:
BOOLEAN
y_expand_allowed
:
BOOLEAN
valid_width
(w:
INTEGER_32
):
BOOLEAN
valid_height
(h:
INTEGER_32
):
BOOLEAN
root_area
:
RECT
set_x_shrink
(b:
BOOLEAN
)
set_x_expand
(b:
BOOLEAN
)
set_y_shrink
(b:
BOOLEAN
)
set_y_expand
(b:
BOOLEAN
)
set_shrink
(b:
BOOLEAN
)
change both x and y shrink state
set_expand
(b:
BOOLEAN
)
change both x and y expand state
state
:
INTEGER_32
use values from
STATE_CONSTANTS
is_state_normal
:
BOOLEAN
is_state_active
:
BOOLEAN
is_state_prelight
:
BOOLEAN
is_state_selected
:
BOOLEAN
is_state_insensitive
:
BOOLEAN
hash_code
:
INTEGER_32
The hash-code value of
Current
.
is_equal
(other: TEXT_FIELD):
BOOLEAN
Is
other
attached to an object considered equal to current object?
widget
:
POINTER
widget identifier from the native graphic API.
when_left_down
(p:
PROCEDURE
[
TUPLE
])
when_left_down_signal
:
SIGNAL_0
when_left_up
(p:
PROCEDURE
[
TUPLE
])
when_left_up_signal
:
SIGNAL_0
when_middle_down
(p:
PROCEDURE
[
TUPLE
])
when_middle_down_signal
:
SIGNAL_0
when_middle_up
(p:
PROCEDURE
[
TUPLE
])
when_middle_up_signal
:
SIGNAL_0
when_right_down
(p:
PROCEDURE
[
TUPLE
])
when_right_down_signal
:
SIGNAL_0
when_right_up
(p:
PROCEDURE
[
TUPLE
])
when_right_up_signal
:
SIGNAL_0
when_wheel_up
(p:
PROCEDURE
[
TUPLE
])
when_wheel_up_signal
:
SIGNAL_0
when_wheel_down
(p:
PROCEDURE
[
TUPLE
])
when_wheel_down_signal
:
SIGNAL_0
when_pointer_move
(p:
PROCEDURE
[
TUPLE 2
[
INTEGER_32
,
INTEGER_32
]])
when_pointer_move_signal
:
SIGNAL_2
[
INTEGER_32
,
INTEGER_32
]
when_pointer_enter
(p:
PROCEDURE
[
TUPLE
])
when_pointer_enter_signal
:
SIGNAL_0
when_pointer_leave
(p:
PROCEDURE
[
TUPLE
])
when_pointer_leave_signal
:
SIGNAL_0
when_key_down
(p:
PROCEDURE
[
TUPLE
])
when_key_down_signal
:
SIGNAL_0
when_key_up
(p:
PROCEDURE
[
TUPLE
])
when_key_up_signal
:
SIGNAL_0
when_mapped
(p:
PROCEDURE
[
TUPLE
])
when_mapped_signal
:
SIGNAL_0
when_unmapped
(p:
PROCEDURE
[
TUPLE
])
when_unmapped_signal
:
SIGNAL_0
when_geometry_change
(p:
PROCEDURE
[
TUPLE 4
[
INTEGER_32
,
INTEGER_32
,
INTEGER_32
,
INTEGER_32
]])
when_geometry_change_signal
:
SIGNAL_4
[
INTEGER_32
,
INTEGER_32
,
INTEGER_32
,
INTEGER_32
]
when_expose
(p:
PROCEDURE
[
TUPLE
])
when_expose_signal
:
SIGNAL_0
text
:
UNICODE_STRING
writable attribute
top
set_text
(new_text:
UNICODE_STRING
)
effective procedure
top
default_init
effective procedure
top
set_parent
(p:
CONTAINER
)
effective procedure
top
require
p = Void implies parent /= Void
p /= Void implies parent = Void
p /= Void implies p.has_child(Current)
ensure
parent = p
set_background_color
(c:
COLOR
)
effective procedure
top
The color is copied, next changes to c won't change the background.
Call clear_area (or refresh) to update the background from application, not needed from renderer
require
c /= Void
set_background_pixmap
(p:
PIXMAP
)
effective procedure
top
Call this function again if you modify the pixmap (copy may have been done)
require
p /= Void
map
effective procedure
top
unmap
effective procedure
top
mapped
:
BOOLEAN
writable attribute
top
Warning: this information is asynchronous
expose_event
effective procedure
top
clear_without_expose
effective procedure
top
clear the all the drawable area.
WARNING: don't redraw the content (no expose event)
area
:
RECT
effective function
top
refresh
effective procedure
top
clear and update entire object (sub_window(s) are not updated).
clear
effective procedure
top
clear and update entire object (sub_window(s) are not updated).
as_x_root
(x:
INTEGER_32
):
INTEGER_32
effective function
top
TODO: add basic conversion to speed up
require
x >= 0
x <
width
x >= pos_x
x < pos_x + width
as_y_root
(y:
INTEGER_32
):
INTEGER_32
effective function
top
TODO: add basic conversion to speed up
require
y >= 0
y <
height
y >= pos_y
y < pos_y + height
adjust_size
effective procedure
top
layout
:
LAYOUT
writable attribute
top
width
:
INTEGER_32
writable attribute
top
height
:
INTEGER_32
writable attribute
top
min_width
:
INTEGER_32
writable attribute
top
min_height
:
INTEGER_32
writable attribute
top
std_width
:
INTEGER_32
writable attribute
top
std_height
:
INTEGER_32
writable attribute
top
layout_update_paused
:
BOOLEAN
writable attribute
top
TODO: suppress.
Handle this with mapped
set_layout
(l:
LAYOUT
)
effective procedure
top
Change the layout for the container (layout choose children position and size).
The layout has to be free (not used by another container).
require
l /= Void
l.container = Void
ensure
layout
= l
layout
.container = Current
not
layout_update_paused
implies
layout_ready
layout_pause
effective procedure
top
TODO: remove when mapped ready
require
not
layout_update_paused
ensure
layout_update_paused
layout_continue
effective procedure
top
TODO: remove when mapped ready
require
layout_update_paused
ensure
layout_ready
not
layout_update_paused
child_attach
(w:
WIDGET
)
effective procedure
top
Add widget
w
in this container.
See also
child_detach
,
has_child
.
require
layout
/= Void
w /= Void
w.parent = Void
not
has_child
(w)
ensure
w.parent = Current
has_child
(w)
last_child
= w
not
layout_update_paused
implies
layout_ready
or not
done
TODO: not mapped implies not layout_ready???
child_detach
(w:
WIDGET
)
effective procedure
top
Remove widget
w
from this container.
See also
child_attach
,
has_child
.
require
w /= Void
has_child
(w)
ensure
not
has_child
(w)
w.parent = Void
not
layout_update_paused
implies
layout_ready
TODO: not mapped implies not layout_ready???
has_child
(w:
WIDGET
):
BOOLEAN
effective function
top
last_child
:
WIDGET
effective function
top
require
not
is_empty
is_empty
:
BOOLEAN
effective function
top
clear_area
(x:
INTEGER_32
, y:
INTEGER_32
, w:
INTEGER_32
, h:
INTEGER_32
)
effective procedure
top
clear area and emit expose event (contents will be drawn) x and y are relative to current object
require
w > 0
h > 0
area
.include(x, y)
area
.include(x + w - 1, y + h - 1)
done
:
BOOLEAN
writable attribute
top
TODO: suppress.
Handle this with mapped
child_requisition_changed
effective procedure
top
require
layout
/= Void
ensure
not
layout_update_paused
implies
layout_ready
or not
done
layout_ready
:
BOOLEAN
writable attribute
top
drawing_widget
:
POINTER
writable attribute
top
Because Windows can not paint on widgets like windows or bitmaps, it needs another object (Device Context) attached to the widget.
For X11, it is the same value as widget.
parent
:
CONTAINER
writable attribute
top
pos_x
:
INTEGER_32
writable attribute
top
pos_y
:
INTEGER_32
writable attribute
top
x_shrink_allowed
:
BOOLEAN
writable attribute
top
x_expand_allowed
:
BOOLEAN
writable attribute
top
y_shrink_allowed
:
BOOLEAN
writable attribute
top
y_expand_allowed
:
BOOLEAN
writable attribute
top
valid_width
(w:
INTEGER_32
):
BOOLEAN
effective function
top
valid_height
(h:
INTEGER_32
):
BOOLEAN
effective function
top
root_area
:
RECT
effective function
top
set_x_shrink
(b:
BOOLEAN
)
effective procedure
top
set_x_expand
(b:
BOOLEAN
)
effective procedure
top
set_y_shrink
(b:
BOOLEAN
)
effective procedure
top
set_y_expand
(b:
BOOLEAN
)
effective procedure
top
set_shrink
(b:
BOOLEAN
)
effective procedure
top
change both x and y shrink state
set_expand
(b:
BOOLEAN
)
effective procedure
top
change both x and y expand state
state
:
INTEGER_32
writable attribute
top
use values from
STATE_CONSTANTS
is_state_normal
:
BOOLEAN
frozen
effective function
top
is_state_active
:
BOOLEAN
frozen
effective function
top
is_state_prelight
:
BOOLEAN
frozen
effective function
top
is_state_selected
:
BOOLEAN
frozen
effective function
top
is_state_insensitive
:
BOOLEAN
frozen
effective function
top
hash_code
:
INTEGER_32
deferred function
top
The hash-code value of
Current
.
ensure
good_hash_value:
Result >= 0
is_equal
(other: TEXT_FIELD):
BOOLEAN
deferred function
top
Is
other
attached to an object considered equal to current object?
require
other /= Void
ensure
Result implies
hash_code
= other.
hash_code
commutative:
generating_type = other.generating_type implies Result = other.is_equal(Current)
widget
:
POINTER
writable attribute
top
widget identifier from the native graphic API.
when_left_down
(p:
PROCEDURE
[
TUPLE
])
effective procedure
top
when_left_down_signal
:
SIGNAL_0
effective function
top
when_left_up
(p:
PROCEDURE
[
TUPLE
])
effective procedure
top
when_left_up_signal
:
SIGNAL_0
effective function
top
when_middle_down
(p:
PROCEDURE
[
TUPLE
])
effective procedure
top
when_middle_down_signal
:
SIGNAL_0
effective function
top
when_middle_up
(p:
PROCEDURE
[
TUPLE
])
effective procedure
top
when_middle_up_signal
:
SIGNAL_0
effective function
top
when_right_down
(p:
PROCEDURE
[
TUPLE
])
effective procedure
top
when_right_down_signal
:
SIGNAL_0
effective function
top
when_right_up
(p:
PROCEDURE
[
TUPLE
])
effective procedure
top
when_right_up_signal
:
SIGNAL_0
effective function
top
when_wheel_up
(p:
PROCEDURE
[
TUPLE
])
effective procedure
top
when_wheel_up_signal
:
SIGNAL_0
effective function
top
when_wheel_down
(p:
PROCEDURE
[
TUPLE
])
effective procedure
top
when_wheel_down_signal
:
SIGNAL_0
effective function
top
when_pointer_move
(p:
PROCEDURE
[
TUPLE 2
[
INTEGER_32
,
INTEGER_32
]])
effective procedure
top
when_pointer_move_signal
:
SIGNAL_2
[
INTEGER_32
,
INTEGER_32
]
effective function
top
when_pointer_enter
(p:
PROCEDURE
[
TUPLE
])
effective procedure
top
when_pointer_enter_signal
:
SIGNAL_0
effective function
top
when_pointer_leave
(p:
PROCEDURE
[
TUPLE
])
effective procedure
top
when_pointer_leave_signal
:
SIGNAL_0
effective function
top
when_key_down
(p:
PROCEDURE
[
TUPLE
])
effective procedure
top
when_key_down_signal
:
SIGNAL_0
effective function
top
when_key_up
(p:
PROCEDURE
[
TUPLE
])
effective procedure
top
when_key_up_signal
:
SIGNAL_0
effective function
top
when_mapped
(p:
PROCEDURE
[
TUPLE
])
effective procedure
top
when_mapped_signal
:
SIGNAL_0
effective function
top
when_unmapped
(p:
PROCEDURE
[
TUPLE
])
effective procedure
top
when_unmapped_signal
:
SIGNAL_0
effective function
top
when_geometry_change
(p:
PROCEDURE
[
TUPLE 4
[
INTEGER_32
,
INTEGER_32
,
INTEGER_32
,
INTEGER_32
]])
effective procedure
top
when_geometry_change_signal
:
SIGNAL_4
[
INTEGER_32
,
INTEGER_32
,
INTEGER_32
,
INTEGER_32
]
effective function
top
when_expose
(p:
PROCEDURE
[
TUPLE
])
effective procedure
top
when_expose_signal
:
SIGNAL_0
effective function
top