Difference between revisions of "LMD VCL - MiniHTML"

From LMD
Jump to: navigation, search
m
Line 1: Line 1:
 
{{Head-StartRes}}
 
{{Head-StartRes}}
<h2>Supported subset of HTML tags</h2>
+
== Supported subset of HTML tags ==
<p>LMD 2007 shared Runtime (or better) integrates Mini HTML for controls with HTML support. Following subset of HTML tags are available:</p>
+
 
<table border=1>
+
LMD 2007 shared Runtime (or better) integrates Mini HTML for controls with HTML support. Following subset of HTML tags are available:
<tr><td>Tag</td><td>Syntax</td><td>Comments &amp; samples</td></tr>
+
 
<tr><td>Bold</td><td>&lt;b&gt;, &lt;/b&gt;</td><td><b>bold</b></td></tr>
+
{| border="1"
<tr><td>Italic</td><td>&lt;i&gt;, &lt;/i&gt;</td><td><i>italic</i></td></tr>
+
|-
<tr><td>Underline</td><td>&lt;u&gt;, &lt;/u&gt;</td><td><u>underline</u></td></tr>
+
| Tag
<tr><td>Strikeout</td><td>&lt;strikeout&gt;, &lt;/strikeout&gt; or &lt;s&gt;, &lt;/s&gt;</td><td><s>striked out</s></td></tr>
+
| Syntax
<tr><td>Paragraph</td><td>&lt;p [align="left|right|center"]&gt;</td><td>Use <i>align</i> parameter to specify the alignment of the text in the paragraph. Default value for align is "left".</td></tr>
+
| Comments &amp; samples
<tr><td>Subscript</td><td>&lt;sub&gt;, &lt;/sub&gt;</td><td>Subscript text is drawn with smaller font and with baseline moved down.</td></tr>
+
|-
<tr><td>Superscript</td><td>&lt;sup&gt;, &lt;/sup&gt;</td><td>Superscript text is drawn with smaller font and with baseline moved up.</td></tr>
+
| Bold
<tr><td>Unordered list of elements</td><td>&lt;ul&gt;&lt;li&gt;item&lt;/li&gt;...&lt;/ul&gt;</td>
+
| &lt;b&gt;, &lt;/b&gt;
<td>
+
| '''bold'''
<ul>
+
|-
<li>item 1</li>
+
| Italic
<li>item 2</li>
+
| &lt;i&gt;, &lt;/i&gt;
</ul>
+
| ''italic''
</td></tr>
+
|-
<tr><td>Ordered list of elements</td><td>&lt;ol&gt;&lt;li&gt;item&lt;/li&gt;...&lt;/ol&gt;</td>
+
| Underline
<td>
+
| &lt;u&gt;, &lt;/u&gt;
<ol>
+
| <u>underline</u>
<li>item 1</li>
+
|-
<li>item 2</li>
+
| Strikeout
</ol>
+
| &lt;strikeout&gt;, &lt;/strikeout&gt; or &lt;s&gt;, &lt;/s&gt;
</td></tr>
+
| <s>striked out</s>
<tr><td>Horizontal divider</td><td>&lt;hr [width="width"]&gt;</td><td>If no value for <i>width</i> attribute is specified, then it will take maximum available value.</td></tr>
+
|-
<tr><td>Line break</td><td>&lt;br&gt;</td><td>&nbsp;</td></tr>
+
| Paragraph
<tr><td>Font</td><td>&lt;font [name="fontname"] [size="x|+x|-x"] [color={"#rrggbb"|"color name"}] [bgcolor={"#rrggbb"|"color name"}]&gt;text&lt;/font&gt; </td>
+
| &lt;p [align="left&#124;right&#124;center"]&gt;
<td>You can specify the name of the font name, size (absolute size or increase, decrease of size)  
+
| 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 <i>background</i> synonym for <i>bgcolor</i> attribute.  
+
| Subscript
<br><b>Note</b>: If <i>size</i> 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>
+
| &lt;sub&gt;, &lt;/sub&gt;
<font face="Arial" size="2">&lt;font name="Arial" size=2&gt;</font><br>
+
| Subscript text is drawn with smaller font and with baseline moved down.
<font face="Arial" size="3">&lt;font name="Arial" size=3&gt;</font><br>
+
|-
<font face="Arial" size="4">&lt;font name="Arial" size=4&gt;</font><br>
+
| Superscript
</td></tr>
+
| &lt;sup&gt;, &lt;/sup&gt;
<tr><td>Hyperlink</td><td>&lt;a href="link"&gt;link text&lt;/a&gt;</td><td><i>Link</i> parameter value is passed to OnLinkClick event handler, present in some controls (not all controls support clicking on the URLs.</td></tr>
+
| Superscript text is drawn with smaller font and with baseline moved up.
<tr><td>Embedded image</td><td>&lt;img src="image" [width="w"] [height="h"]&gt;</td><td>The <i>src</i> 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>
+
| Unordered list of elements
<code>
+
| &lt;ul&gt;&lt;li&gt;item&lt;/li&gt;...&lt;/ul&gt;
procedure TForm1.LMDHTMLLabel1ImageNeeded(Sender: TObject; SourceName: TLMDString; var Image: TPicture);<br>
+
|
begin<br>
+
* item 1
&nbsp;&nbsp;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>
+
| &lt;ol&gt;&lt;li&gt;item&lt;/li&gt;...&lt;/ol&gt;
&nbsp;&nbsp;ImageList1.GetBitmap(strtoint(SourceName), Image.Bitmap);<br>
+
|
end;<br>
+
# item 1
</code>
+
# item 2
</td><tr>
+
 
</table>
+
|-
 +
| Horizontal divider
 +
| &lt;hr [width="width"]&gt;
 +
| If no value for ''width'' attribute is specified, then it will take maximum available value.
 +
|-
 +
| Line break
 +
| &lt;br&gt;
 +
| &nbsp;
 +
|-
 +
| Font
 +
| &lt;font [name="fontname"] [size="x&#124;+x&#124;-x&#124;x px"] [color={"#rrggbb"&#124;"color name"}] [bgcolor={"#rrggbb"&#124;"color name"}]&gt;text&lt;/font&gt;
 +
| 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">&lt;font name="Arial" size=2&gt;</font><br><font face="Arial" size="3">&lt;font name="Arial" size=3&gt;</font><br><font face="Arial" size="4">&lt;font name="Arial" size=4&gt;</font><br>
 +
 
 +
|-
 +
| Hyperlink
 +
| &lt;a href="link"&gt;link text&lt;/a&gt;
 +
| ''Link'' parameter value is passed to OnLinkClick event handler, present in some controls (not all controls support clicking on the URLs.
 +
|-
 +
| Embedded image
 +
| &lt;img src="image" [width="w"] [height="h"]&gt;
 +
| 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>&nbsp;&nbsp;Image.LoadFromFile(SourceName);<br>end;<br><br>procedure TForm1.LMDHTMLLabel1ImageNeeded(Sender: TObject; SourceName: TLMDString; var Image: TPicture);<br>begin<br>&nbsp;&nbsp;ImageList1.GetBitmap(strtoint(SourceName), Image.Bitmap);<br>end;<br></code>
 +
 
 +
|-
 +
|}
  
 
<h2>Supported special symbols</h2>
 
<h2>Supported special symbols</h2>

Revision as of 19:53, 20 October 2008

<< Back to Getting started or Product Resources page

[edit]

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> striked out
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>
  • item 1
  • item 2
Ordered list of elements <ol><li>item</li>...</ol>
  1. item 1
  2. 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.
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:
<font name="Arial" size=2>
<font name="Arial" size=3>
<font name="Arial" size=4>

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:

procedure TForm1.LMDHTMLLabel1ImageNeeded(Sender: TObject; SourceName: TLMDString; var Image: TPicture);
begin
  Image.LoadFromFile(SourceName);
end;

procedure TForm1.LMDHTMLLabel1ImageNeeded(Sender: TObject; SourceName: TLMDString; var Image: TPicture);
begin
  ImageList1.GetBitmap(strtoint(SourceName), Image.Bitmap);
end;

Supported special symbols

&Aacute Á &cent ¢ &Iacute Í &oacute ó &sup1 ¹
&aacute á &copy © &iacute í &Ocirc Ô &sup2 ²
&Acirc  &curren ¤ &Icirc Î &ocirc ô &sup3 ³
&acirc â &deg ° &icirc î &Ograve Ò &szlig ß
&acute ´ &divide ÷ &iexcl ¡ &ograve ò &THORN Þ
&AElig Æ &Eacute É &Igrave Ì &ordf ª &times ×
&aelig æ &eacute é &igrave ì &ordm º &trade
&Agrave À &Ecirc Ê &iquest ¿ &Oslash Ø &UacuteÚ
&agrave à &ecirc ê &Iuml Ï &oslash ø &uacuteú
&amp & &Egrave È &iuml ï &Otilde Õ &Ucirc Û
&Aring Å &egrave è &laquo « &otilde õ &UgraveÙ
&aring å &ETH Ð &lt < &Ouml Ö &ugraveù
&Atilde à &eth ð &macr ¯ &ouml ö &uml ¨
&atilde ã &Euml Ë &micro µ &para &Uuml Ü
&Auml Ä &euml ë &middot · &plusmn ± &YacuteÝ
&auml ä &euro &nbsp   &pound £ &yen ¥
&brvbar ¦ &frac12 ½ &not ¬ &quot "   
&Ccedil Ç &frac14 ¼ &Ntilde Ñ &raquo »   
&ccedil ç &frac34 ¾ &ntilde ñ &reg ®   
&cedil ¸ &gt > &Oacute Ó &sect §