| Did you know ... | Search Documentation: |
| Send methods |
\e DEL)->typed
@see text<-pointed<-string.
In addition, if text<-string
does not accept the method, but class string
does, the text<-string
is converted to a string
object holding the same characters. See also
text->has_send_method.<-area
from the text<-string, text<-font
and text<-margin.->typed
on itself if the event if a keyboard event and the text<-show_caret
yields
@on. See also graphical->keyboard_focus.<-string,
text<-font
and text<-margin.<-string
and of class string.
See also text->catch_all.<-string
defaults to” , the text<-format
to left and the text<-font
to the
text.font<-margin
in the text<-fonts ex units
(see font<-ex).
New code should use the more advanced text->margin
method.<-wrap:
->margin: @nil).
The graphical is as big as needed to display the string->margin:
width, clip) The graphical has fixed width. If the string is too long it
will be clipped.->margin:
width, wrap) The graphical has a text<-margin
defined. If the string is too long to fit within the margin it will be
wrapped on multiple physical lines. Wrapping only happens at word
boundaries.->margin:
width, wrap_fixed_width) Similar to wrap-1, but the graphical<-width
of the graphical equals the margin rather than the width occupied by the
displayed characters.
-wrap<-cut_buffer.->resizefrom is @nil
to must be omitted and the selection is cleared. Otherwise default
values do not change the corresponding end of the selection.
See also text<-selected_text,
class edit_text_gesture
and the Prolog library(pce_editable_text).
|{passive}->typed
@see text<-pointed<-background.
The value @on
is equivalent to text->background: @nil
and @off to text->background:
@default.|event_idtext does not provide default
event-handling, but editable text
objects are easily created by forwarding keyboard-events to this method:
:- pce_global(@edit_text_recogniser,
new(handler(keyboard,
message(@receiver,
typed,
@arg1)))).
text_make_editable(T) :-
send(T, recogniser, @edit_text_recogniser).
This method uses the key_binding
object called text from @key_bindings
to map the typed keys on selectors and then invokes methods on class text.
With the above, if the user types control-U to the text the following
happens:
->typed
using
@edit_text_recogniser.<-id
is processed by the text key_binding
object and mapped on the selector clear. text->clear
does not require arguments and the key_binding
object just invokes text->clear.->clear erases all characters from
the text.
Diagnostics: Fails if the keyboard event could not be handled.
->show_caret ->caret <-pointed .key_binding <-key_binding |colour