A style object
describes the visual appearance of a fragment
object in an editor
object or dict_item
objects in a list_browser
object: font, highlighting, underlining, etc. Style
objects are associated with editors using the editor->style
method. Fragments that have fragment<->style
equal to name will be displayed according to the associated style.
The online manual uses various styles. E.g.
title Section titles in helvetica bold font code code fragments in a fixed-width screen font active attribute-bold for links to definitions.
An elaborate example of using editors, fragments and styles is the
XPCE help browser, whose sources are in the XPCE library file pce_helper.pl.
A simple example is in the example
Multiple Fonts.
Bugs:
When a style is changed, the corresponding text is not immediately updated. It is adviced to use styles in a read-only fashion.
->underline, style->highlight, style->grey, style->closed
and style->bold.|pixmap|elevation]->colour.->background.Defaults: @default
(meaning use editor<->font).
->margin_width.
In combination with text_image->wrap,
the margins may be used to realise quotations and intended lists in
WYSIWYG like editors.
Class text_image fetches the new margins whenever it starts a new screen line.
-left_margin|texture_name|colour]<-bold<-bold->hidden: @on,
the text will be made invisible. Currently this attribute is ignored if
the style is used for a dict_item
object.
May be used to implement outline editors or to hide
control sequences.
<-bold|texture_name|colour],
bold=[bool], grey=[bool], background=[colour|pixmap|elevation],
hidden=[bool], left_margin=[int], right_margin=[int],
strikethrough=[bool|texture_name|colour]
send(Editor, style, section_header,
style(font := huge)).
The arguments are:
style ->iconImage shown in text_margin object style ->fontFont used to display characters style ->colourColour for characters style ->highlightSwap colour and background style ->underlineUnderline text style ->boldPrint bold style ->greyPrint grey using colour <-reducestyle ->backgroundColour/elevation for background style ->hiddenIf true, text is invisible style ->left_marginLeft margin (pixels) style ->right_marginRight margin (pixels from right)
NOTE: this method defines a large number of arguments. It is advised
to use the keyword := value construct for specifying the
arguments. The following two terms define a bold style:
style(bold := @on) style(@default, @default, @default, @default, @default, @on)
See also class := and send_method->send.
Inherits description from: style<-bold
|texture_name|colour]
style ->boldbold-face using double-strike (see also style ->font)style ->underlineunderlined text. style ->highlightinverted background and foreground. style ->greygreyed-out by and'ing with @grey50_image.
Bugs:
style<->closed is not implemented.
Future versions might use this to hide the text of a
fragment temporary.
->hidden