1 USING: arrays colors fonts help.markup help.syntax
3 IN: ui.gadgets.line-support
6 { $class-description "Base class for gadgets that implements display of sequences of text."
8 "Line gadgets have the following slots:"
12 { "a " { $link font } "." }
15 { $slot "selection-color" }
16 { "a " { $link color } "." }
20 { "The preferred minimum number of visible rows when the gadget is contained in a viewport." }
24 { "The preferred maximum number of visible rows when the gadget is cotnained in a viewport." }
28 { "The preferred minimum number of visible columns when the gadget is contained in a viewport." }
32 { "The preferred maximum number of visible columns when the gadget is contained in a viewport." }
37 HELP: pref-viewport-dim*
38 { $values { "gadget" line-gadget } { "dim" array } }
39 { $description "Calculates the preferred viewport dimensions of the line gadget." }
40 { $see-also pref-viewport-dim } ;
42 ARTICLE: "ui.gadgets.line-support" "Gadget line support"
43 "The " { $vocab-link "ui.gadgets.line-support" } " vocabulary provides common code shared by gadgets which display a sequence of lines of text. Currently, the two gadgets that use it are " { $link "ui.gadgets.editors" } " and " { $link "ui.gadgets.tables" } "."
45 "The class of line gadgets:"
50 "Line gadgets are backed by a model which must be a sequence. The number of lines in the gadget is the length of the sequence."
52 "Line gadgets cannot be created and used directly, instead a subclass must be defined:"
53 { $subsections new-line-gadget }
54 "Subclasses must implement a generic word:"
55 { $subsections draw-line }
56 "Two optional generic words may be implemented; if they are not implemented in the subclass, a default implementation based on font metrics will be used:"
61 "Validating line numbers:"
62 { $subsections validate-line }
63 "Working with visible lines:"
69 "Converting y co-ordinates to line numbers, and vice versa:"
75 ABOUT: "ui.gadgets.line-support"