| Did you know ... | Search Documentation: |
| Instance variables |
->append.
Backward compatibility only.
->append<-defaults bound to the
built-in key_binding
object named editor. This implies that bindings created
using editor->key_binding
are local to the editor.
->typed<-caret
is the current insertion point. In ranges from 0 up to and
including editor<-size.
Zero implies insert at the beginning; editor<-size
implies append at the end.
The method editor->caret
is invoked explicitly from all internal methods that manipulate the
caret and this method may thus be redefined to keep track of the users
caret-movements.
The editor<-mark
is a mark that moves with inserts and, together with the editor<-caret,
defines the region. The region can be in various modes as described by editor<-mark_status.
To get the caret from an event, see text_image<-index.
The location of the caret is visualised by a text_cursor
object that can be requested using editor<-text_cursor.
-mark->dabbrev_expanddabbrev_origin to dabbrev_pos.
->dabbrev_expand->dabbrev_expand->dabbrev_expand
See also editor->show_caret
for hiding the caret on read-only editors.
BUG: In the original design, methods were fixed and methods
either implemented behaviour intended for user interaction or methods
intended for program interaction. The editor->editable
flag only affected interactive methods. Some of this distinction still
remains. It is adviced to set editable to @on
before modifying a read-only editor
object from the program to avoid confusion.
-modified->report.
When defined, editor->report
will execute this message with arguments given below:
@receiver: The editor (or view) @arg1 idem @arg2 The type (status/warning/inform/error) @arg3 String representing the message itself
See visual->report
for a general discussion on the reporting system.
Defaults: @nil
->inform ->alert->switch_case_mode
sets editor<-exact case according to the
argument:
@default toggle editor <-exact_case> 0 editor ->exact_case: @on<= 0 editor <-exact_case: @off
Defaults: @off (Resource determined).
->save_buffer ->save ->load<->right_margin
while inserting text.
editor->auto_fill_mode
may be used to set editor<-fill_mode
interactively:
@default: toggle editor <-fill_mode> 0 editor ->fill_mode: @on<= 0 editor ->fill_mode: @off
->insert_self_fill ->insert_self<->focus_function
variable is used to process commands that start a kind of sub-mode,
such as entering a numeric argument, doing incremental search, doing a
dabbrev expansion, etc.
An interactive behaviour that uses such a sub-loop sets this variable
to the selector that handles the loop. As a consequence, editor->typed
will invoke this method on each subsequent character typed until
<->focus_function
to @nil. If
the method invoked via editor<->focus_function
succeeds, editor->typed
assumes the character is handled.
By convention, the method that is invoked by the focus function has the same name than the method that set the focus preceded by an underscore:
quoted_insert ->
_quoted_insert
text_image ->tab_stopsSet vector of tab-stops text_image ->wrapControl line-wrapping
Direct access may also be used to attach event-handling to the
editor. For example, if a popup is attached to the editor as a whole it
might contradict with the editor<-scroll_bar.
Associating the popup with the
editor<-image
ensures it only operates in the text area.
This group of commands is intended for editing source-code.
Defaults: 4 (Resource defined)
->label.
See also editor<->show_label.->fill, editor->justify_paragraph,
editor->fill_mode,
etc. The method editor->set_fill_column
may be used to set both methods interactively (Dope compatibility):
@default Report current margins > 0 Set editor ->right_margin< 0 Set editor ->left_margin to the absolute value.
Defaults: 0
<-style,
and editor->style.
When the editor->margin_width
is set to a value > 0 and there is no editor<-margin,
a margin is created.
Defaults: @nil (no margin)
->margin_width -caret
->mark,
the old mark is pushed into the ring. The maximum size of the ring is
hard-coded to 16. The command editor->set_mark
with a prefix argument cycles throught the saved marks.<-selection_style.
Region commands are effective if the mark is in this state.->exchange_point_and_mark
(C-x C-x). The regions is made inactive with the command editor->keyboard_quit
(C-g).->select_line.
See also editor->caret
and editor->selection.
<->modified
attribute of the associated text_buffer changes and this message is not @nil,
this message is executed with the following arguments:
@receiver Editor or view @arg1 New value of editor <->modified
-modified
Inherits description from: editor-left_margin
->width
to 0 before the editor is displayed effectively removes it.
->isearch_forward->isearch_forward
and
editor->isearch_backward
to resp. forward and backward.
->isearch_backward ->isearch_forward->isearch_forward
and
editor->isearch_backward.
Used to return when the search is canceled.
->isearch_forward->isearch_forward<-selected_fragment_style.
There is no default user-interface for selecting fragments. text_buffer<-find_fragment
and text_margin<-fragment
may be useful methods for defining a user-interface.
-selected_fragment_style -selected_fragment
@see text_margin-styles @see class fragment<-ex
of the current editor<-font.,
height in font<-height.
The methods editor->_size, graphical->area
and graphical->set
may still be used to handle the pixel size directly.
<-style
onto style objects
that determine the actual appearance of a fragment. This separates
semantical information represented by the fragment from visualisation as
achieved in the editor. Setting the style to
@nil deletes
the visual appearance of fragments with this name.
The following skeleton illustrates this. E is an editor. The final code fragment creates a fragment to turn the current selection into a title.
:- pce_global(@title_style,
new(style(font :=
font(helvetica, bold, 16)))).
...
send(E, style, title, @title_style),
...
...
get(E, selection, point(Start, End)),
Length is End - Start,
new(F, fragment(E, Start, Length, title)),
...
<-ex
units of the current editor<-font.
Mainly used for handling source-code. When editor->tab_stops
is defined the value of this variable is ignored.<-text_buffer
stores the text. Class editor
delegates messages not understood to the editor<-text_buffer.
A text_buffer can have multiple editors operating on it simultaneously.
The text_buffer
object associated to an editor may be changed anytime.