bidialog.html

来自「ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.」· HTML 代码 · 共 725 行 · 第 1/2 页

HTML
725
字号
<!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>BiDialog</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="BiDialog">BiDialog</h1><p>This class is used for dialog windows. Dialog windows are internal windows that require immediate attention. Dialog windows are modal to the application.<br>				<br>		 Example usage:<br>				<br>				<code>var confirm = new<code><a href="BiDialog.html">BiDialog</a></code>("Are you sure");<br>			 // add components to the dialog<br>			 confirm.addEventListener("dialogresult", this.doSomething, this);<br>			 confirm.setVisible(true);</code>	</p><p>This class extends		<code><a href="BiWindow.html">BiWindow</a></code>		and therefore all methods and fields available for		<code><a href="BiWindow.html">BiWindow</a></code>		are also available for <code>BiDialog</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><a href="BiWindow.html">BiWindow</a></code><ul><li><code>BiDialog</code><ul id="api-derived-classes"><li><code><a href="BiColorPicker.html">BiColorPicker</a></code></li><li><code><a href="BiWizard.html">BiWizard</a></code></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul><h2>Constructor</h2><p><code>	new BiDialog([<span class="methodArgument">sCaption</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>sCaption</code></td><td><code class="type">String</code></td><td class="optional-column"><img src="check.png" alt="checked"></td><td></td><td>Optional caption text</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="centered"></a><code>centered</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>This property decides whether to automatically center the dialog when it is shown</td></tr><tr><td><a name="defaultFocusedComponent"></a><code>defaultFocusedComponent</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>This allows you to set the component that should be focused when the dialog is shown. If <code>null</code> then the acceptButton is used for this.</td></tr><tr><td><a name="dialogResult"></a><code>dialogResult</code></td><td><code class="type">Object</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 value set by the dialog before it is closed. the dialogResult should be set by the content of the dialog before it is closed</td></tr></tbody></table><h2>Methods</h2><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td><code><a href="#centerDialog">centerDialog</a></code></td><td>Centers the dialog window inside the application window</td></tr></tbody></table><h2>Events</h2><table><thead><tr><td>Name</td><td>Type</td><td class="bubbles-header">Bubbles</td><td>Descripton</td></tr></thead><tbody><tr><td><a name="dialogresult"></a><code>dialogresult</code></td><td><code class="type">				<code><a href="BiEvent.html">BiEvent</a></code>			</code></td><td class="bubbles-column"></td><td>This event is called when the dialog is 								closed (or hidden). This is the main event                                 to use with dialogs since it is fired when                                 the user closes it or selects a value in it.</td></tr></tbody></table><h2>Static Methods</h2><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td><code><a href="#createConfirmDialog">createConfirmDialog</a></code></td><td>Creates a new <code><a href="BiDialog.html">BiDialog</a></code> with a <code><a href="BiOptionPane.html">option pane</a></code> as the <code><a href="BiWindow.html#contentPane">contentPane</a></code> of the dialog window.<br>								<br>				 This dialog is used to ask the user to confirm something. The buttons shown are set by the <code><a href="#optionType">optionType</a></code>.<br>								<br>				 The <code><a href="BiDialog.html#dialogResult">dialogResult</a></code> for the dialog reflects the button clicked. The values are:<br>								<br>				 ok - The "OK" button was clicked<br>				 cancel - The "Cancel" button was clicked<br>				 yes - The "Yes" button was clicked<br>				 no  - The "No" button was clicked<br>								<br>				 This method uses the static method provided by the<code><a href="BiOptionPane.html">BiOptionPane</a></code> class.</td></tr><tr><td><code><a href="#createInputDialog">createInputDialog</a></code></td><td>Creates a new<code><a href="BiDialog.html">BiDialog</a></code> with a <code><a href="BiOptionPane.html">option pane</a></code> as the <code><a href="BiWindow.html#contentPane">contentPane</a></code> of the dialog window.<br>								<br>				 This dialog is used to allow the user to enter a text value. The default text value can be provided using the <code>sDefaultValue</code> argument. The buttons provided for these dialogs are always an "OK" and a "Cancel" button.<br>								<br>				 The <code><a href="BiDialog.html#dialogResult">dialogResult</a></code> for the dialog reflects whether the user entered any value and pressed "OK" or pressed "Cancel". The value is <code>null</code> when the user canceled the dialog, otherwise the entered string value is used.<br>								<br>				 This method uses the static method provided by the<code><a href="BiOptionPane.html">BiOptionPane</a></code> class.</td></tr><tr><td><code><a href="#createMessageDialog">createMessageDialog</a></code></td><td>Creates a new <code><a href="BiDialog.html">BiDialog</a></code> with a <code><a href="BiOptionPane.html">option pane</a></code> as the <code><a href="BiWindow.html#contentPane">contentPane</a></code> of the dialog window.<br>								<br>				 This dialog is used to show a simple message. The iamge can either be set using the option type or by setting using the image argument.<br>								<br>				 The <code><a href="BiDialog.html#dialogResult">dialogResult</a></code> for the dialog reflects the button clicked. The values are:<br>								<br>				 ok - The "OK" button was clicked<br>				 cancel - The "Cancel" button was clicked<br>				 yes - The "Yes" button was clicked<br>				 no  - The "No" button was clicked<br>								<br>				 This method uses the static method provided by the <code><a href="BiOptionPane.html">BiOptionPane</a></code> class.</td></tr><tr><td><code><a href="#createOptionDialog">createOptionDialog</a></code></td><td>Creates a new<code><a href="BiDialog.html">BiDialog</a></code> with a <code><a href="BiOptionPane.html">option pane</a></code> as the <code><a href="BiWindow.html#contentPane">contentPane</a></code> of the dialog window.<br>								<br>				 This dialog is used to show custom option buttons that the user can select between. The options argument should be used to define the buttons to use.<br>								<br>				 The <code><a href="BiDialog.html#dialogResult">dialogResult</a></code> for the dialog reflects the button clicked. The value will be the object that the clicked button was created from.<br>								<br>				 This method uses the static method provided by the <code><a href="BiOptionPane.html">BiOptionPane</a></code> class.</td></tr></tbody></table><h2>Static Fields</h2><p>None.</p><h2>Remarks</h2><p>When the dialog is closed it is also disposed and can therefore 			not be used any more. To be able to reuse the dialog catch the             <code><a href="BiWindow.html#beforeclose">beforeclose</a></code>             event and prevent the default action.</p><h2>Method Details</h2><h3><a name="centerDialog"></a>centerDialog</h3><p>Centers the dialog window inside the application window</p><h4>Syntax</h4><pre class="method-syntax">object.centerDialog()</pre><h4>Parameters</h4><p>No arguments.</p><h4>Return Type</h4><p><code class="type">void</code></p><h2>Static Method Details</h2><h3><a name="createConfirmDialog"></a>createConfirmDialog</h3><p>Creates a new <code><a href="BiDialog.html">BiDialog</a></code> with a <code><a href="BiOptionPane.html">option pane</a></code> as the <code><a href="BiWindow.html#contentPane">contentPane</a></code> of the dialog window.<br>								<br>				 This dialog is used to ask the user to confirm something. The buttons shown are set by the <code><a href="#optionType">optionType</a></code>.<br>								<br>				 The <code><a href="BiDialog.html#dialogResult">dialogResult</a></code> for the dialog reflects the button clicked. The values are:<br>								<br>				 ok - The "OK" button was clicked<br>				 cancel - The "Cancel" button was clicked<br>				 yes - The "Yes" button was clicked<br>				 no  - The "No" button was clicked<br>								<br>				 This method uses the static method provided by the<code><a href="BiOptionPane.html">BiOptionPane</a></code> class.</p><h4>Syntax</h4><pre class="method-syntax">BiDialog.createConfirmDialog(<span class="methodArgument">oMessage</span> [, <span class="methodArgument">sCaption</span> [, <span class="methodArgument">sMessageType</span> [, <span class="methodArgument">sOptionType</span> [, <span class="methodArgument">oImage</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>oMessage</code></td><td><code class="type">Object</code></td><td class="optional-column"></td><td></td><td>The text or<code><a href="BiComponent.html">BiComponent</a></code> to show as a message 							inside the dialog</td></tr><tr><td><code>sCaption</code></td><td><code class="type">String</code></td><td class="optional-column"><img src="check.png" alt="checked"></td><td><code>Select an Option</code></td><td>The caption text to show on the dialog window </td></tr><tr><td><code>sMessageType</code></td><td><code class="type">String</code></td><td class="optional-column"><img src="check.png" alt="checked"></td><td><code>question</code></td><td>The type of the message that is shown. This sets the image on the option pane if no other image is provided. Valid values are:<br>												<br>						                                 plain - No image<br>						

⌨️ 快捷键说明

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