| Did you know ... | Search Documentation: |
| Send methods |
->advance<-message
iff it is a code object,
always is @on
or text_item<-modified
is @on and text_item<-selection
succeeds. The following arguments are forwarded:
@receiver The text_item @arg1 The text_item <-selection.
<-value_text
and update the visualisation if the method was accepted. This allows all text
object manipulation methods such as string->append
and string->insert
to be applied directly on a text_item
object. See also
text->catch_all.->selection” .
This method is meaningless when type is not name or some
other type that allows for” .->insert_self.
This method is the central method of the text_item's completion
mechanism. This completion mechanism both deals selecting in
hierarchical organised data (like the Unix file-system) and with simple
lists of possible values. The second case is generally handled by text_item<->value_set.
For selecting from hierarchical organised data the following methods
need to be redefined:
<-split_completion
Split the currently typed value in a directory part and a
file part.<-completions
Return a set of possible files in the indicated
directory using the result of text_item<-split_completion.->indicate_directory
Indicate the match of a directory.
In this documentation we refer to files and directories,
but in general this may refer to any organised data using any
syntactical convention. The Prolog library file file_item.pl
illustrated how the methods described above may be redefined to select a
file from the Unix file-system.
When text_item->complete
is invoked, it attempts to complete the current entry. To do so, it
locates the first choice-point and the set of objects that may be
selected after this choice-point using chain<-complete_name.
If the current point is a choice-point it will pop-up the browser
object @completer with all possible completions. If the
current point is a unique description of a completed value it will
indicate such using the error sole_completion. Otherwise it will replace text_item<-displayed_value
with the text leading to the first choice-point or completion.
->indicate_directory -value_set<-style
is combobox, text_item->complete
the value. Otherwise use text_item->next
to advance to the next dialog item. See also
device->advance.<-value_text,
the label and value positions and the
text_item<-reference.|function->restore
the text_item.<-displayed_value->enter
is by default bound the the RETURN key. It's behaviour is rather
complicated to get proper default action both if the dialog window in
which the text_item resides has a‘dialog
text_item<-default_button’and if
this is not the case.
->typed
to the graphical<-window
of the text_item. If the window has an accelerator for RET this
will be activated. If this message returns successfully the text_item
considers the RETURN handled.->apply
the text_item. If this succeeds and
text_item<-advance
= clear, clear the text_item using text_item->selection ” .
Otherwise proceed to the next text_item using text_item->next.
<->active
equals @off:
fail->caret).->post
this event to @completer. Otherwise invoke text_item->typed.->apply: @on.
See also
text_item->enter.stepper buttons. See also text_item->style:
stepper.->complete
if the expansion is unique. It provides a possibility to indicate that
this string represents a
directory. Class file_item from the PCE/Prolog library
defines this method as:
indicate_directory(_FI, Dir:string) :->
( send(directory(Dir), exists)
-> send(Dir, ensure_suffix, /)
; true
).
->complete|function], message=[code]*->default’->modified
runs text_item<-selection
to reset the -selection and -print_name slots.<-device.
This invokes
device->advance
using the receiver as argument. This method is normally bound to the TAB
key.
See also text_item->complete_or_next.
<-cute_buffer’. By default
invoked from text_item->event
on a middle button click.->quit_completer.<-default
value and sets the text_item->selection
to this value.->complete.
It's function is to allow the user to select a value from the set of
possible values. Prefix is the value entered so far,
By default this method pops-up the browser @completer. This may be redefined.
@completer calls this method with a single argument representing the selected text.
This method appends the argument value to the prefix resulting from text_item<-split_completion,
sets the text_item<-value of the text_item
and hides @completer.
<-selection.
If the given value is not equal to the
text_item<-selection,
convert it to text_item<-type
using type<-check.
If the value is still not equal to the text_item<-selection,
obtain a printable representation using object<-print_name
with the value as argument. Finally assign
text_item<-selection
with the (converted) value and object<-print_name
with the textual representation and update the display.
See also text_item<-selection
and text_item->default.
->select_completion.active, show the caret (text->show_caret).
Otherwise the caret is not visible.|event_idtext_item from @key_bindings.
This key_binding
object will map the typed keys onto functions (selectors) which will
then be invoked on the text_item.
For example, if the user types an a to a text_item the
following sequence of method is traversed:
->event->typed->insert_self: @default,
97->insert_self is delegated to text_item<-value_text->length.
New code should use text_item->length,
to avoid the ambiguity with graphical->width.
Inherits description from: text_item-length, text_item->length