Difference between revisions of "LMD VCL - MiniHTML"
m |
|||
Line 1: | Line 1: | ||
{{Head-StartRes}} | {{Head-StartRes}} | ||
− | + | == Supported subset of HTML tags == | |
− | + | ||
− | + | LMD 2007 shared Runtime (or better) integrates Mini HTML for controls with HTML support. Following subset of HTML tags are available: | |
− | + | ||
− | + | {| border="1" | |
− | + | |- | |
− | + | | Tag | |
− | + | | Syntax | |
− | + | | Comments & samples | |
− | + | |- | |
− | + | | Bold | |
− | + | | <b>, </b> | |
− | + | | '''bold''' | |
− | + | |- | |
− | + | | Italic | |
− | + | | <i>, </i> | |
− | + | | ''italic'' | |
− | + | |- | |
− | + | | Underline | |
− | + | | <u>, </u> | |
− | + | | <u>underline</u> | |
− | + | |- | |
− | + | | Strikeout | |
− | + | | <strikeout>, </strikeout> or <s>, </s> | |
− | + | | <s>striked out</s> | |
− | + | |- | |
− | + | | Paragraph | |
− | + | | <p [align="left|right|center"]> | |
− | + | | Use ''align'' parameter to specify the alignment of the text in the paragraph. Default value for align is "left". | |
− | and font background color. Color must be a valid hexadecimal value in common HTML format, valid VCL color identifier | + | |- |
− | (clWhite, clBtnFace for example) or valid HTML color identifier (red, black, btnshadow for example. You can use | + | | Subscript |
− | <br> | + | | <sub>, </sub> |
− | <font face="Arial" size="2"><font name="Arial" size=2></font><br> | + | | Subscript text is drawn with smaller font and with baseline moved down. |
− | <font face="Arial" size="3"><font name="Arial" size=3></font><br> | + | |- |
− | <font face="Arial" size="4"><font name="Arial" size=4></font><br> | + | | Superscript |
− | + | | <sup>, </sup> | |
− | + | | Superscript text is drawn with smaller font and with baseline moved up. | |
− | + | |- | |
− | The simplest OnImageNeeded event handlers:<br><br> | + | | Unordered list of elements |
− | <code> | + | | <ul><li>item</li>...</ul> |
− | procedure TForm1.LMDHTMLLabel1ImageNeeded(Sender: TObject; SourceName: TLMDString; var Image: TPicture);<br> | + | | |
− | begin<br> | + | * item 1 |
− | Image.LoadFromFile(SourceName);<br> | + | * item 2 |
− | end;<br> | + | |
− | <br> | + | |- |
− | procedure TForm1.LMDHTMLLabel1ImageNeeded(Sender: TObject; SourceName: TLMDString; var Image: TPicture);<br> | + | | Ordered list of elements |
− | begin<br> | + | | <ol><li>item</li>...</ol> |
− | ImageList1.GetBitmap(strtoint(SourceName), Image.Bitmap);<br> | + | | |
− | end;<br> | + | # item 1 |
− | </code> | + | # item 2 |
− | + | ||
− | + | |- | |
+ | | Horizontal divider | ||
+ | | <hr [width="width"]> | ||
+ | | If no value for ''width'' attribute is specified, then it will take maximum available value. | ||
+ | |- | ||
+ | | Line break | ||
+ | | <br> | ||
+ | | | ||
+ | |- | ||
+ | | Font | ||
+ | | <font [name="fontname"] [size="x|+x|-x|x px"] [color={"#rrggbb"|"color name"}] [bgcolor={"#rrggbb"|"color name"}]>text</font> | ||
+ | | You can specify the name of the font name, size (absolute size or increase, decrease of size) | ||
+ | and font background color. Color must be a valid hexadecimal value in common HTML format, valid VCL color identifier (clWhite, clBtnFace for example) or valid HTML color identifier (red, black, btnshadow for example. You can use ''background'' synonym for ''bgcolor'' attribute. <br>'''Note''': If ''size'' value is greater than 0 and less than 10 and there is no plus or minus sign, then it means standard font increase relative to default size. Example:<br><font face="Arial" size="2"><font name="Arial" size=2></font><br><font face="Arial" size="3"><font name="Arial" size=3></font><br><font face="Arial" size="4"><font name="Arial" size=4></font><br> | ||
+ | |||
+ | |- | ||
+ | | Hyperlink | ||
+ | | <a href="link">link text</a> | ||
+ | | ''Link'' parameter value is passed to OnLinkClick event handler, present in some controls (not all controls support clicking on the URLs. | ||
+ | |- | ||
+ | | Embedded image | ||
+ | | <img src="image" [width="w"] [height="h"]> | ||
+ | | The ''src'' parameter value is passed to the OnImageNeeded event handler. You can specify the width and height of the image rectangle if needed. By default the width and height are taken from the image you provide in event handler, but you can stretch image on drawing by specifying width and height explicitly.<br> | ||
+ | The simplest OnImageNeeded event handlers:<br><br><code>procedure TForm1.LMDHTMLLabel1ImageNeeded(Sender: TObject; SourceName: TLMDString; var Image: TPicture);<br>begin<br> Image.LoadFromFile(SourceName);<br>end;<br><br>procedure TForm1.LMDHTMLLabel1ImageNeeded(Sender: TObject; SourceName: TLMDString; var Image: TPicture);<br>begin<br> ImageList1.GetBitmap(strtoint(SourceName), Image.Bitmap);<br>end;<br></code> | ||
+ | |||
+ | |- | ||
+ | |} | ||
<h2>Supported special symbols</h2> | <h2>Supported special symbols</h2> |
Revision as of 18:53, 20 October 2008
<< Back to Getting started or Product Resources page
Supported subset of HTML tags
LMD 2007 shared Runtime (or better) integrates Mini HTML for controls with HTML support. Following subset of HTML tags are available:
Tag | Syntax | Comments & samples |
Bold | <b>, </b> | bold |
Italic | <i>, </i> | italic |
Underline | <u>, </u> | underline |
Strikeout | <strikeout>, </strikeout> or <s>, </s> | |
Paragraph | <p [align="left|right|center"]> | Use align parameter to specify the alignment of the text in the paragraph. Default value for align is "left". |
Subscript | <sub>, </sub> | Subscript text is drawn with smaller font and with baseline moved down. |
Superscript | <sup>, </sup> | Superscript text is drawn with smaller font and with baseline moved up. |
Unordered list of elements | <ul><li>item</li>...</ul> |
|
Ordered list of elements | <ol><li>item</li>...</ol> |
|
Horizontal divider | <hr [width="width"]> | If no value for width attribute is specified, then it will take maximum available value. |
Line break | <br> | |
Font | <font [name="fontname"] [size="x|+x|-x|x px"] [color={"#rrggbb"|"color name"}] [bgcolor={"#rrggbb"|"color name"}]>text</font> | You can specify the name of the font name, size (absolute size or increase, decrease of size)
and font background color. Color must be a valid hexadecimal value in common HTML format, valid VCL color identifier (clWhite, clBtnFace for example) or valid HTML color identifier (red, black, btnshadow for example. You can use background synonym for bgcolor attribute. |
Hyperlink | <a href="link">link text</a> | Link parameter value is passed to OnLinkClick event handler, present in some controls (not all controls support clicking on the URLs. |
Embedded image | <img src="image" [width="w"] [height="h"]> | The src parameter value is passed to the OnImageNeeded event handler. You can specify the width and height of the image rectangle if needed. By default the width and height are taken from the image you provide in event handler, but you can stretch image on drawing by specifying width and height explicitly. The simplest OnImageNeeded event handlers: |
Supported special symbols
Á | Á | ¢ | ¢ | Í | Í | ó | ó | ¹ | ¹ |
á | á | © | © | í | í | Ô | Ô | ² | ² |
 |  | ¤ | ¤ | Î | Î | ô | ô | ³ | ³ |
â | â | ° | ° | î | î | Ò | Ò | ß | ß |
´ | ´ | ÷ | ÷ | ¡ | ¡ | ò | ò | Þ | Þ |
Æ | Æ | É | É | Ì | Ì | ª | ª | × | × |
æ | æ | é | é | ì | ì | º | º | &trade | ™ |
À | À | Ê | Ê | ¿ | ¿ | Ø | Ø | Ú | Ú |
à | à | ê | ê | Ï | Ï | ø | ø | ú | ú |
& | & | È | È | ï | ï | Õ | Õ | Û | Û |
Å | Å | è | è | « | « | õ | õ | Ù | Ù |
å | å | Ð | Ð | < | < | Ö | Ö | ù | ù |
à | à | ð | ð | ¯ | ¯ | ö | ö | ¨ | ¨ |
ã | ã | Ë | Ë | µ | µ | ¶ | ¶ | Ü | Ü |
Ä | Ä | ë | ë | · | · | ± | ± | Ý | Ý |
ä | ä | &euro | € |   | £ | £ | ¥ | ¥ | |
¦ | ¦ | ½ | ½ | ¬ | ¬ | " | " | ||
Ç | Ç | ¼ | ¼ | Ñ | Ñ | » | » | ||
ç | ç | ¾ | ¾ | ñ | ñ | ® | ® | ||
¸ | ¸ | > | > | Ó | Ó | § | § |