code:windows:messagebox
Differences
This shows you the differences between two versions of the page.
code:windows:messagebox [2011/01/29 21:24] – created jmgr | code:windows:messagebox [2011/04/20 20:31] (current) – removed jmgr | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== MessageBox ====== | ||
- | This object represents a window showing some text to the user. | ||
- | ===== Functions ===== | ||
- | |||
- | ==== MessageBox ==== | ||
- | Constructor function. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | var myObject = new MessageBox(); | ||
- | </ | ||
- | <code javascript> | ||
- | var myObject = new MessageBox(parameters); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - parameters - (object) window parameters | ||
- | * title - (string) the window' | ||
- | * position - ([[code: | ||
- | * opacity - (float) the window' | ||
- | * enabled - (boolean) the window' | ||
- | * visible - (boolean) the window' | ||
- | * text - (string) the text | ||
- | * detailedText - (string) the detailed text | ||
- | * informativeText - (string) the informative text (appended to text) | ||
- | * buttons - ([[# | ||
- | * icon - ([[# | ||
- | * defaultButton - ([[# | ||
- | * escapeButton - ([[# | ||
- | * onClosed - ([[# | ||
- | |||
- | === Exceptions === | ||
- | * (ParameterTypeError) incorrect parameter type | ||
- | * (ParameterCountError) incorrect parameter count | ||
- | |||
- | === Example === | ||
- | <code javascript> | ||
- | var myObject = new MessageBox(); | ||
- | </ | ||
- | <code javascript> | ||
- | var myObject = new MessageBox({ | ||
- | title: "Press yes or no", | ||
- | icon: MessageBox.Warning | ||
- | buttons: MessageBox.Yes | MessageBox.No | ||
- | }); | ||
- | </ | ||
- | |||
- | ===== Methods ===== | ||
- | |||
- | ==== setTitle ==== | ||
- | Sets the window' | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.setTitle(title); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - title - (string) the window' | ||
- | |||
- | === Returns === | ||
- | * (MessageBox) this MessageBox | ||
- | |||
- | ==== setPosition ==== | ||
- | Sets the window' | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.setPosition(point); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - point - ([[code: | ||
- | |||
- | === Returns === | ||
- | * (MessageBox) this MessageBox | ||
- | |||
- | ==== setOpacity ==== | ||
- | Sets the window' | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.setOpacity(opacity); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - opacity - (float) the window' | ||
- | |||
- | === Returns === | ||
- | * (MessageBox) this MessageBox | ||
- | |||
- | ==== setEnabled ==== | ||
- | Sets the window' | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.setEnabled(enabled); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - enabled - (boolean) the window' | ||
- | |||
- | === Returns === | ||
- | * (MessageBox) this MessageBox | ||
- | |||
- | ==== setVisible ==== | ||
- | Sets the window' | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.setVisible(visible); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - visible - (boolean) the window' | ||
- | |||
- | === Returns === | ||
- | * (MessageBox) this MessageBox | ||
- | |||
- | ==== close ==== | ||
- | Closes the window. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.close(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (MessageBox) this MessageBox | ||
- | |||
- | ==== title ==== | ||
- | Returns the window' | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.title(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (string) the window' | ||
- | |||
- | ==== position ==== | ||
- | Returns the window' | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.position(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * ([[code: | ||
- | |||
- | ==== opacity ==== | ||
- | Returns the window' | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.opacity(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (float) the window' | ||
- | |||
- | ==== enabled ==== | ||
- | Returns the window' | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.enabled(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (boolean) the window' | ||
- | |||
- | ==== visible ==== | ||
- | Returns the window' | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.visible(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (boolean) the window' | ||
- | |||
- | ==== setText ==== | ||
- | Sets the text. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.setText(text); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - text - (string) the text | ||
- | |||
- | === Returns === | ||
- | * (MessageBox) this MessageBox | ||
- | |||
- | ==== setDetailedText ==== | ||
- | Sets the detailed text. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.setDetailedText(detailedText); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - detailedText - (string) the detailed text | ||
- | |||
- | === Returns === | ||
- | * (MessageBox) this MessageBox | ||
- | |||
- | ==== setInformativeText ==== | ||
- | Sets the informative text (appended to text). | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.setInformativeText(informativeText); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - informativeText - (string) the informative text | ||
- | |||
- | === Returns === | ||
- | * (MessageBox) this MessageBox | ||
- | |||
- | ==== setButtons ==== | ||
- | Sets the buttons to use. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.setButtons(buttons); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - buttons - ([[# | ||
- | |||
- | === Returns === | ||
- | * (MessageBox) this MessageBox | ||
- | |||
- | ==== setIcon ==== | ||
- | Sets the icon to use. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.setIcon(icon); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - buttons - ([[# | ||
- | |||
- | === Returns === | ||
- | * (MessageBox) this MessageBox | ||
- | |||
- | ==== setDefaultButton ==== | ||
- | Sets the default selected button. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.setDefaultButton(button); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - button - ([[# | ||
- | |||
- | === Returns === | ||
- | * (MessageBox) this MessageBox | ||
- | |||
- | ==== setEscapeButton ==== | ||
- | Sets the button pressed when pressing the escape key. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.setEscapeButton(button); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - button - ([[# | ||
- | |||
- | === Returns === | ||
- | * (MessageBox) this MessageBox | ||
- | |||
- | ==== addCustomButton ==== | ||
- | Adds a custom button. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.addCustomButton(button, | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - button - ([[# | ||
- | - text - (string) the text of this button | ||
- | |||
- | === Returns === | ||
- | * (MessageBox) this MessageBox | ||
- | |||
- | === Exceptions === | ||
- | * (AddCustomButtonError) add custom button failed | ||
- | |||
- | ==== show ==== | ||
- | Show the window. (non-blocking) | ||
- | Use the [[# | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.show(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (MessageBox) this MessageBox | ||
- | |||
- | ==== showModal ==== | ||
- | Show the window. (blocking) | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.showModal(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * (integer) the window result (0 means that it has been canceled) | ||
- | |||
- | ===== Events ===== | ||
- | |||
- | ==== onClosed ==== | ||
- | Called when the window is closed. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.onClosed = function(result) {}; | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - result - (integer) the window result (0 means that it has been canceled) | ||
- | |||
- | === Example === | ||
- | <code javascript> | ||
- | myObject.onClosed = function(result) | ||
- | { | ||
- | if(result) | ||
- | { | ||
- | //Event action | ||
- | } | ||
- | }; | ||
- | </ | ||
- | |||
- | ===== Attributes ===== | ||
- | |||
- | ==== title ==== | ||
- | The window' | ||
- | |||
- | ==== position ==== | ||
- | The window' | ||
- | |||
- | ==== opacity ==== | ||
- | The window' | ||
- | |||
- | ==== enabled ==== | ||
- | The window' | ||
- | |||
- | ==== visible ==== | ||
- | The window' | ||
- | |||
- | ===== Enumerations ===== | ||
- | |||
- | ==== StandardButton ==== | ||
- | A standard button. | ||
- | |||
- | === Values === | ||
- | - Ok: an " | ||
- | - Open: an " | ||
- | - Save: a " | ||
- | - Cancel: a " | ||
- | - Close: a " | ||
- | - Discard: a " | ||
- | - Apply: an " | ||
- | - Reset: a " | ||
- | - RestoreDefaults: | ||
- | - Help: a " | ||
- | - SaveAll: a "save all" button | ||
- | - Yes: a " | ||
- | - YesToAll: a "yes to all" button | ||
- | - No: a " | ||
- | - NoToAll: a "no to all" button | ||
- | - Abort: an " | ||
- | - Retry: a " | ||
- | - Ignore: an " | ||
- | - NoButton: no button | ||
- | |||
- | === Notes === | ||
- | This is a flag enumeration, | ||
- | Example : | ||
- | <code javascript> | ||
- | myObject.setButtons(MessageBox.Yes | MessageBox.Save); | ||
- | </ | ||
- | |||
- | ==== Icon ==== | ||
- | An icon. | ||
- | |||
- | === Values === | ||
- | - NoIcon: no icon | ||
- | - Question: a question mark icon | ||
- | - Information: | ||
- | - Warning: a warning icon | ||
- | - Critical: a critical icon (error) |
code/windows/messagebox.1296336276.txt.gz · Last modified: 2021/02/13 11:23 (external edit)