Difference between revisions of "LGUI2:Text Scanners"
Jump to navigation
Jump to search
(Replaced content with "'''This topic is being replaced with up to date information'''") |
|||
Line 1: | Line 1: | ||
− | + | A [[LavishGUI 2]] Text Scanner selects a [[LGUI2:Text Type|Text Type]] and any related options for decorating text, such as colors and fonts for special portions of text (for example, syntax highlighting). | |
+ | |||
+ | Each LavishGUI 2 Element with Text (any [[LGUI2:commandbox|commandbox]], [[LGUI2:textbox|textbox]], [[LGUI2:textblock|textblock]]) can have its own Text Scanner defined. | ||
+ | |||
+ | |||
+ | == Defining a Text Scanner == | ||
+ | A Text Scanner is defined as a JSON Object, usually as part of an [[LGUI2:Element|Element]] (currently including [[LGUI2:commandbox|commandbox]], [[LGUI2:textbox|textbox]], [[LGUI2:textblock|textblock]]) | ||
+ | |||
+ | |||
+ | {| border="1" style="border-collapse:collapse" cellpadding="5" | ||
+ | !colspan="2"|Text Scanner properties | ||
+ | |- | ||
+ | ! type | ||
+ | | The [[LGUI2:Text Type|Text Type]], usually a type of container, to process text as | ||
+ | |- | ||
+ | ! <type_name> | ||
+ | | An object specifying optional "color", "backgroundBrush" and "font" properties for a specified type | ||
+ | |- | ||
+ | ! <type_name> | ||
+ | | ... (same as above, any number of these may be present) | ||
+ | |} | ||
+ | |||
+ | |||
+ | == Examples == | ||
+ | ; A LavishScript 1 command lines Text Scanner, with background colors specified for Data Sequence, Index, and Type Casts | ||
+ | "textScanner": { | ||
+ | "type": "ls1_commandlines", | ||
+ | "ls1_commandline": { "color": [ 0.8,1.0,0.8] }, | ||
+ | "ls1_${": { "color": [ 1.0, 1.0, 0.0 ] }, | ||
+ | "ls1_$": { "color": [ 1.0,0.2,0.2 ] }, | ||
+ | "ls1_}": { "color": [ 1.0, 1.0, 0.0 ] }, | ||
+ | "ls1_[": { "color": [ 1.0, 0.5, 0.5 ] }, | ||
+ | "ls1_]": { "color": [ 1.0, 0.5, 0.5 ] }, | ||
+ | "ls1_(": { "color": [ 0.5, 0.5, 1.0 ] }, | ||
+ | "ls1_)": { "color": [ 0.5, 0.5, 1.0 ] }, | ||
+ | "ls1_,": { "color": [ 1.0, 0.5, 0.5 ] }, | ||
+ | "ls1_\"": { "color": [ 1.0, 0.5, 0.0 ] }, | ||
+ | "escape": { "color": [ 0.5, 0.5, 0.5 ] }, | ||
+ | "ls1_datasequence_inner": { }, | ||
+ | "ls1_datasequence": { "backgroundBrush": { "color": [ 0.2, 0.2, 0.0 ] } }, | ||
+ | "ls1_index": { "backgroundBrush": { "color": [ 0.2, 0.1, 0.1 ] } }, | ||
+ | "ls1_typecast": { "backgroundBrush": { "color": [ 0.1, 0.1, 0.2 ] } }, | ||
+ | "ls1_index_inner": { }, | ||
+ | "ls1_quoted": { }, | ||
+ | "ls1_other": { }, | ||
+ | "ls1_commandlines": { } | ||
+ | } | ||
+ | |||
+ | This example requires loading relevant [[LGUI2:Text Types|Text Types]]. | ||
+ | |||
+ | |||
+ | {{LGUI2:TextTypes}} | ||
+ | {{LGUI2:Topic}} | ||
+ | |||
+ | [[Category:LavishGUI 2 Text]] |
Latest revision as of 15:40, 10 December 2018
A LavishGUI 2 Text Scanner selects a Text Type and any related options for decorating text, such as colors and fonts for special portions of text (for example, syntax highlighting).
Each LavishGUI 2 Element with Text (any commandbox, textbox, textblock) can have its own Text Scanner defined.
Defining a Text Scanner
A Text Scanner is defined as a JSON Object, usually as part of an Element (currently including commandbox, textbox, textblock)
Text Scanner properties | |
---|---|
type | The Text Type, usually a type of container, to process text as |
<type_name> | An object specifying optional "color", "backgroundBrush" and "font" properties for a specified type |
<type_name> | ... (same as above, any number of these may be present) |
Examples
- A LavishScript 1 command lines Text Scanner, with background colors specified for Data Sequence, Index, and Type Casts
"textScanner": { "type": "ls1_commandlines", "ls1_commandline": { "color": [ 0.8,1.0,0.8] }, "ls1_${": { "color": [ 1.0, 1.0, 0.0 ] }, "ls1_$": { "color": [ 1.0,0.2,0.2 ] }, "ls1_}": { "color": [ 1.0, 1.0, 0.0 ] }, "ls1_[": { "color": [ 1.0, 0.5, 0.5 ] }, "ls1_]": { "color": [ 1.0, 0.5, 0.5 ] }, "ls1_(": { "color": [ 0.5, 0.5, 1.0 ] }, "ls1_)": { "color": [ 0.5, 0.5, 1.0 ] }, "ls1_,": { "color": [ 1.0, 0.5, 0.5 ] }, "ls1_\"": { "color": [ 1.0, 0.5, 0.0 ] }, "escape": { "color": [ 0.5, 0.5, 0.5 ] }, "ls1_datasequence_inner": { }, "ls1_datasequence": { "backgroundBrush": { "color": [ 0.2, 0.2, 0.0 ] } }, "ls1_index": { "backgroundBrush": { "color": [ 0.2, 0.1, 0.1 ] } }, "ls1_typecast": { "backgroundBrush": { "color": [ 0.1, 0.1, 0.2 ] } }, "ls1_index_inner": { }, "ls1_quoted": { }, "ls1_other": { }, "ls1_commandlines": { } }
This example requires loading relevant Text Types.
LavishGUI 2 Text Types
LavishGUI 2 Topics