1Prima::Drawable::MarkupU(s3e)r Contributed Perl DocumentaPtriiomna::Drawable::Markup(3)
2
3
4
6 Prima::Markup - Allow markup in Prima Widgets
7
9 use Prima qw(Application Buttons Drawable::Markup);
10 Prima::Button->new(
11 text => Prima::Drawable::Markup->new(markup => "B<Bold> bU<u>tton"),
12 hotKey => 'u',
13 );
14 run Prima;
15
17 "Prima::Markup" adds the ability to recognize POD-like markup to Prima
18 widgets. Supported markup sequences are "B" (bold text), "I" (italic
19 text), "U" (underlined text), "F" (change font), "S" (change font
20 size), "C" (change foreground color), "Q" (change background color),
21 "M" (move pointer), "W" (disable wrapping), and "P" (picture).
22
23 The "F" sequence is used as follows: "F<n|text>", where "n" is a
24 0-based index into the "fontPalette".
25
26 The "S" sequence is used as follows: "S<n|text>", where "n" is the
27 number of points relative to the current font size. The font size may
28 optionally be preceded by "+" or "-".
29
30 The "C" and "Q" sequences are used as follows: "C<c|text>", where "c"
31 is either: a color in any form accepted by Prima, including the "cl"
32 constants ("Black" "Blue" "Green" "Cyan" "Red" "Magenta" "Brown"
33 "LightGray" "DarkGray" "LightBlue" "LightGreen" "LightCyan" "LightRed"
34 "LightMagenta" "Yellow" "White" "Gray"). Or, a 0-based index into the
35 "colorPalette". Also, "default" can be used to set the color that the
36 canvas originaly had. For "Q" a special value "off" can be used to turn
37 off background color and set it as transparent.
38
39 The "M" command has three parameters, comma-separated: X, Y, and flags.
40 X and Y are coordinates how much to move the current pointer. By
41 default X and are in pixels, and do not extend block width. "flags" is
42 a set of characters, where each is:
43
44 m - set units to font height
45 p - set units to points
46 x - also extend the block width
47
48 The text inside "W" sequence will not be wrapped during "text_wrap"
49 calls.
50
51 The "P" sequence is used as follows:"P<n>", where "n" is a 0-based
52 index into the "picturePalette".
53
54 The methods "text_out" and "get_text_width" are affected by
55 "Prima::Markup". "text_out" will write formatted text to the canvas,
56 and "get_text_width" will return the width of the formatted text.
57 NOTE: These methods do not save state between calls, so your markup
58 cannot span lines (since each line is drawn or measured with a separate
59 call).
60
62 The following properties are used:
63
64 colorPalette([@colorPalette])
65 Gets or sets the color palette to be used for "C" sequences within
66 this widget. Each element of the array should be a "cl::"
67 constant.
68
69 fontPalette([@fontPalette])
70 Gets or sets the font palette to be used for "F" sequences within
71 this widget. Each element of the array should be a hashref
72 suitable for setting a font.
73
74 picturePalette([@picturePalette])
75 Gets or sets the picture palette to be used for "P" sequences
76 within this widget. Each element of the array should be a
77 "Prima::Image" descendant.
78
79 bidi BOOLEAN = 1
80 If 0, bidirection text processing if off. If 1, set to 1 iff
81 "Prima::Bidi" is loaded and enabled.
82
84 Prima::Drawable::TextBlock
85
87 Copyright 2003 Teo Sankaro
88
89 You may redistribute and/or modify this module under the same terms as
90 Perl itself. (Although a credit would be nice.)
91
93 This module based on work by Teo Sankaro, <teo_sankaro@hotmail.com>.
94
95
96
97perl v5.30.0 2019-08-21 Prima::Drawable::Markup(3)