⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bilabel.html

📁 在流览器上仿CS界面的JAVASCRIPT脚本
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><!--
Generated using api.website.xsl version 2003-07-17
-->
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>BiLabel</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link type="text/css" rel="stylesheet" href="api.css"><script type="text/javascript">

				function showDerivedClasses() {
					var ul = document.getElementById("api-derived-classes");
					var lis = ul.childNodes;
					var l = lis.length;
					for (var i = 1; i < l; i++)
						lis[i].style.display = "";
					lis[0].style.display = "none";
				}

			</script></head>
<body>
<h1 id="BiLabel">BiLabel</h1>
<p>
		This class is used to show text
	</p>
<p>This class extends
		<code><a href="BiComponent.html">BiComponent</a></code>
		and therefore all methods and fields available for
		<code><a href="BiComponent.html">BiComponent</a></code>
		are also available for <code>BiLabel</code>.</p>
<ul class="partial-class-tree">
<li><code><a href="BiObject.html">BiObject</a></code><ul>
<li><code><a href="BiEventTarget.html">BiEventTarget</a></code><ul><li><code><a href="BiComponent.html">BiComponent</a></code><ul><li><code>BiLabel</code><ul id="api-derived-classes"><li><code><a href="javascript:showDerivedClasses()">Show derived classes</a></code></li><li style="display:none"><code><a href="BiButton.html">BiButton</a></code></li><li style="display:none"><code><a href="BiChartLegendLabel.html">BiChartLegendLabel</a></code></li><li style="display:none"><code><a href="BiCheckBox.html">BiCheckBox</a></code></li><li style="display:none"><code><a href="BiGaugeTitle.html">BiGaugeTitle</a></code></li><li style="display:none"><code><a href="BiGridHeader.html">BiGridHeader</a></code></li><li style="display:none"><code><a href="BiGroupBoxTitle.html">BiGroupBoxTitle</a></code></li><li style="display:none"><code><a href="BiListItem.html">BiListItem</a></code></li><li style="display:none"><code><a href="BiPopup.html">BiPopup</a></code></li><li style="display:none"><code><a href="BiRadioButton.html">BiRadioButton</a></code></li><li style="display:none"><code><a href="BiStatusBarPanel.html">BiStatusBarPanel</a></code></li><li style="display:none"><code><a href="BiToolBarButton.html">BiToolBarButton</a></code></li><li style="display:none"><code><a href="BiTreeViewDragHeader.html">BiTreeViewDragHeader</a></code></li></ul></li></ul></li></ul></li></ul>
</li>
</ul>
<h2>Constructor</h2>
<p><code>

	new BiLabel([<span class="methodArgument">sText</span>])</code></p>
<h3>Parameters</h3>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>sText</code></td>
<td><code class="type">String</code></td>
<td class="optional-column"><img src="check.png" alt="checked"></td>
<td><code>""</code></td>
<td>The text to show on the label</td>
</tr>
</tbody>
</table>
<h2>Properties</h2>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="get-header">get</td>
<td class="set-header">set</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><a name="align"></a><code>align</code></td>
<td><code class="type">String</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>
				The text alignment. Valid values are:<br>
				<br>
				<code>left</code><br>
				<code>right</code><br>
				<code>center</code><br>
				<code>justify</code>
			</td>
</tr>
<tr>
<td><a name="font"></a><code>font</code></td>
<td><code class="type"><code><a href="BiFont.html">BiFont</a></code></code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>This is used to describe how to paint the text on the label.</td>
</tr>
<tr>
<td><a name="html"></a><code>html</code></td>
<td><code class="type">String</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>The HTML text shown on the label</td>
</tr>
<tr>
<td><a name="icon"></a><code>icon</code></td>
<td><code class="type"><code><a href="BiImage.html">BiImage</a></code></code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>The icon image to show on the label. Note that changing
				the image object does not update the label icon. You'll have to
				set the icon property to update the label icon.</td>
</tr>
<tr>
<td><a name="iconPosition"></a><code>iconPosition</code></td>
<td><code class="type">String</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>
				The position of the icon relative to the text. Valid values are:<br>
				<br>
				<code>left</code><br>
				<code>right</code><br>
				<code>top</code><br>
				<code>bottom</code>
			</td>
</tr>
<tr>
<td><a name="iconTextGap"></a><code>iconTextGap</code></td>
<td><code class="type">Number</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>The gap between the icon and the text (in pixels)</td>
</tr>
<tr>
<td><a name="labelFor"></a><code>labelFor</code></td>
<td><code class="type"><code><a href="BiComponent.html">BiComponent</a></code></code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>If this is set then focusing on the current label moves the focus to another component</td>
</tr>
<tr>
<td><a name="mnemonic"></a><code>mnemonic</code></td>
<td><code class="type">String</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>A character used to give UI hints about the access key for the label</td>
</tr>
<tr>
<td><a name="paddingBottom"></a><code>paddingBottom</code></td>
<td><code class="type">Number</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>The bottom padding (in pixels)</td>
</tr>
<tr>
<td><a name="paddingLeft"></a><code>paddingLeft</code></td>
<td><code class="type">Number</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>The left padding (in pixels)</td>
</tr>
<tr>
<td><a name="paddingRight"></a><code>paddingRight</code></td>
<td><code class="type">Number</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>The right padding (in pixels)</td>
</tr>
<tr>
<td><a name="paddingTop"></a><code>paddingTop</code></td>
<td><code class="type">Number</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>The top padding (in pixels)</td>
</tr>
<tr>
<td><a name="text"></a><code>text</code></td>
<td><code class="type">String</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>The plain text shown on the label</td>
</tr>
<tr>
<td><a name="verticalAlign"></a><code>verticalAlign</code></td>
<td><code class="type">String</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>
				NOT IMPLEMENTED<br>
				<br>
				The vertical text alignment. Valid values are:<br>
				<br>
				<code>top</code><br>
				<code>middle</code><br>
				<code>bottom</code>
			</td>
</tr>
<tr>
<td><a name="wrap"></a><code>wrap</code></td>
<td><code class="type">Boolean</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>Whether to wrap the text if the label is not wide enough</td>
</tr>
</tbody>
</table>
<h2>Methods</h2>
<table>
<thead>
<tr>
<td>Name</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="#setPadding">setPadding</a></code></td>
<td>
				Sets the padding on more than one side. This method can ba called with
				1, 2 or 4 arguments. In case of 1 argument it sets the padding on all
				sides. If 2 arguments are used then the padding on the left/right and
				top/bottom are set to the same. And if called with 4 all 4 sides can have
				different padding,<br>
				<br>
				<code>setPadding(nPadding)</code> - Sets the padding on all sides to
				<code>nPadding</code><br>
				<code>setPadding(nLeftRight, nTopBottom)</code> - Sets the padding on
				the left and right to <code>nLeftRight</code> and the padding on the
				top and bottom to <code>nTopBottom</code><br>
				<code>setPadding(nLeft, nRight, nTop, nBottom)</code> - Sets the padding
				on all sides to <code>nLeft</code>, <code>nRight</code>, <code>nTop</code>
				and <code>nBottom</code> respectively.
			</td>
</tr>
</tbody>
</table>
<h2>Events</h2>
<p>None.</p>
<h2>Static Methods</h2>
<table>
<thead>
<tr>
<td>Name</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="#addMnemonic">addMnemonic</a></code></td>
<td>Changes an HTML string to designate a character as a mnemonic</td>
</tr>
<tr>
<td><code><a href="#htmlToText">htmlToText</a></code></td>
<td>Strips HTML markup from an HTML string and returns a plain text string</td>
</tr>
<tr>
<td><code><a href="#textToHtml">textToHtml</a></code></td>
<td>Converts a plain text string to HTML. This includes adding line breaks and entities.</td>
</tr>
</tbody>
</table>
<h2>Static Fields</h2>
<p>None.</p>
<h2>Remarks</h2>
<p>
		To change the font of the component you have to use
		<code><a href="BiLabel.html#font">setFont()</a></code>. Changing the
		font object without calling <code><a href="BiLabel.html#font">setFont()</a></code>
		will not update the component.<br>
		<br>
		To change the icon of the component you have to use
		<code><a href="BiLabel.html#icon">setIcon()</a></code>. Changing the
		image object without calling <code><a href="BiLabel.html#icon">setIcon()</a></code>
		will not update the component.
	</p>
<h2>Method Details</h2>
<h3><a name="setPadding"></a>setPadding</h3>
<p>
				Sets the padding on more than one side. This method can ba called with
				1, 2 or 4 arguments. In case of 1 argument it sets the padding on all
				sides. If 2 arguments are used then the padding on the left/right and
				top/bottom are set to the same. And if called with 4 all 4 sides can have
				different padding,<br>
				<br>
				<code>setPadding(nPadding)</code> - Sets the padding on all sides to
				<code>nPadding</code><br>
				<code>setPadding(nLeftRight, nTopBottom)</code> - Sets the padding on
				the left and right to <code>nLeftRight</code> and the padding on the
				top and bottom to <code>nTopBottom</code><br>
				<code>setPadding(nLeft, nRight, nTop, nBottom)</code> - Sets the padding
				on all sides to <code>nLeft</code>, <code>nRight</code>, <code>nTop</code>
				and <code>nBottom</code> respectively.
			</p>
<h4>Syntax</h4>
<pre class="method-syntax">object.setPadding(<span class="methodArgument">nLeft</span> [, <span class="methodArgument">nRight</span> [, <span class="methodArgument">nTop</span> [, <span class="methodArgument">nBottom</span>]]])</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>nLeft</code></td>
<td><code class="type">Number</code></td>
<td class="optional-column"></td>
<td></td>
<td>Left padding</td>
</tr>
<tr>
<td><code>nRight</code></td>
<td><code class="type">Number</code></td>
<td class="optional-column"><img src="check.png" alt="checked"></td>
<td></td>
<td>Right padding</td>
</tr>
<tr>
<td><code>nTop</code></td>
<td><code class="type">Number</code></td>
<td class="optional-column"><img src="check.png" alt="checked"></td>
<td></td>
<td>Top padding</td>
</tr>
<tr>
<td><code>nBottom</code></td>
<td><code class="type">Number</code></td>
<td class="optional-column"><img src="check.png" alt="checked"></td>
<td></td>
<td>Bottom padding</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">void</code></p>
<h2>Static Method Details</h2>
<h3><a name="addMnemonic"></a>addMnemonic</h3>
<p>Changes an HTML string to designate a character as a mnemonic</p>
<h4>Syntax</h4>
<pre class="method-syntax">BiLabel.addMnemonic(<span class="methodArgument">sHtml</span>, <span class="methodArgument">sMnemonic</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>sHtml</code></td>
<td><code class="type">String</code></td>
<td class="optional-column"></td>
<td></td>
<td>The HTML text to add the mnemonic to</td>
</tr>
<tr>
<td><code>sMnemonic</code></td>
<td><code class="type">String</code></td>
<td class="optional-column"></td>
<td></td>
<td>The mnemonic character</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">String</code></p>
<h3><a name="htmlToText"></a>htmlToText</h3>
<p>Strips HTML markup from an HTML string and returns a plain text string</p>
<h4>Syntax</h4>
<pre class="method-syntax">BiLabel.htmlToText(<span class="methodArgument">sHtml</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>sHtml</code></td>
<td><code class="type">String</code></td>
<td class="optional-column"></td>
<td></td>
<td>The HTML string to convert</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">String</code></p>
<h3><a name="textToHtml"></a>textToHtml</h3>
<p>Converts a plain text string to HTML. This includes adding line breaks and entities.</p>
<h4>Syntax</h4>
<pre class="method-syntax">BiLabel.textToHtml(<span class="methodArgument">sText</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>sText</code></td>
<td><code class="type">String</code></td>
<td class="optional-column"></td>
<td></td>
<td>The plain text string to convert</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">String</code></p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -