]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/gadgets/line-support/line-support-docs.factor
f52b2efe1f554041bf8513021b59c7cea3090795
[factor.git] / basis / ui / gadgets / line-support / line-support-docs.factor
1 IN: ui.gadgets.line-support
2 USING: help.markup help.syntax ;
3
4 ARTICLE: "ui.gadgets.line-support" "Gadget line support"
5 "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" } "."
6 $nl
7 "The class of line gadgets:"
8 { $subsections
9     line-gadget
10     line-gadget?
11 }
12 "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."
13 $nl
14 "Line gadgets cannot be created and used directly, instead a subclass must be defined:"
15 { $subsections new-line-gadget }
16 "Subclasses must implement a generic word:"
17 { $subsections draw-line }
18 "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:"
19 { $subsections
20     line-height
21     line-leading
22 }
23 "Validating line numbers:"
24 { $subsections validate-line }
25 "Working with visible lines:"
26 { $subsections
27     visible-lines
28     first-visible-line
29     last-visible-line
30 }
31 "Converting y co-ordinates to line numbers, and vice versa:"
32 { $subsections
33     line>y
34     y>line
35 } ;
36
37 ABOUT: "ui.gadgets.line-support"