User Tools

Site Tools


code:windows:messagebox

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

code:windows:messagebox [2011/01/29 21:24] – created jmgrcode: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> 
-<code javascript> 
-var myObject = new MessageBox(parameters); 
-</code> 
- 
-=== Arguments === 
-  - parameters - (object) window parameters 
-    * title - (string) the window's title 
-    * position - ([[code:core:point|Point]]) the window's position 
-    * opacity - (float) the window's opacity 
-    * enabled - (boolean) the window's enabled status 
-    * visible - (boolean) the window's visible status 
-    * text - (string) the text 
-    * detailedText - (string) the detailed text 
-    * informativeText - (string) the informative text (appended to text) 
-    * buttons - ([[#standardbutton|StandardButton]]) a flag list of buttons 
-    * icon - ([[#icon|Icon]]) the number of decimals 
-    * defaultButton - ([[#standardbutton|StandardButton]]) the default selected button 
-    * escapeButton - ([[#standardbutton|StandardButton]]) the button pressed when pressing escape 
-    * onClosed - ([[#onclosed|OnClosed]]) event called when the window is closed 
- 
-=== Exceptions === 
-  * (ParameterTypeError) incorrect parameter type 
-  * (ParameterCountError) incorrect parameter count 
- 
-=== Example === 
-<code javascript> 
-var myObject = new MessageBox(); 
-</code> 
-<code javascript> 
-var myObject = new MessageBox({ 
- title: "Press yes or no", 
- icon: MessageBox.Warning 
- buttons: MessageBox.Yes | MessageBox.No 
-}); 
-</code> 
- 
-===== Methods ===== 
- 
-==== setTitle ==== 
-Sets the window's title. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setTitle(title); 
-</code> 
- 
-=== Arguments === 
-  - title - (string) the window's title 
- 
-=== Returns === 
-  * (MessageBox) this MessageBox 
- 
-==== setPosition ==== 
-Sets the window's position. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setPosition(point); 
-</code> 
- 
-=== Arguments === 
-  - point - ([[code:core:point|Point]]) the window's position 
- 
-=== Returns === 
-  * (MessageBox) this MessageBox 
- 
-==== setOpacity ==== 
-Sets the window's opacity. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setOpacity(opacity); 
-</code> 
- 
-=== Arguments === 
-  - opacity - (float) the window's opacity 
- 
-=== Returns === 
-  * (MessageBox) this MessageBox 
- 
-==== setEnabled ==== 
-Sets the window's enabled status. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setEnabled(enabled); 
-</code> 
- 
-=== Arguments === 
-  - enabled - (boolean) the window's enabled status 
- 
-=== Returns === 
-  * (MessageBox) this MessageBox 
- 
-==== setVisible ==== 
-Sets the window's visible status. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setVisible(visible); 
-</code> 
- 
-=== Arguments === 
-  - visible - (boolean) the window's visible status 
- 
-=== Returns === 
-  * (MessageBox) this MessageBox 
- 
-==== close ==== 
-Closes the window. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.close(); 
-</code> 
- 
-=== Returns === 
-  * (MessageBox) this MessageBox 
- 
-==== title ==== 
-Returns the window's title. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.title(); 
-</code> 
- 
-=== Returns === 
-  * (string) the window's title 
- 
-==== position ==== 
-Returns the window's position. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.position(); 
-</code> 
- 
-=== Returns === 
-  * ([[code:core:point|Point]]) the window's position 
- 
-==== opacity ==== 
-Returns the window's opacity. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.opacity(); 
-</code> 
- 
-=== Returns === 
-  * (float) the window's opacity 
- 
-==== enabled ==== 
-Returns the window's enabled status. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.enabled(); 
-</code> 
- 
-=== Returns === 
-  * (boolean) the window's enabled status 
- 
-==== visible ==== 
-Returns the window's visible status. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.visible(); 
-</code> 
- 
-=== Returns === 
-  * (boolean) the window's visible status 
- 
-==== setText ==== 
-Sets the text. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setText(text); 
-</code> 
- 
-=== Arguments === 
-  - text - (string) the text 
- 
-=== Returns === 
-  * (MessageBox) this MessageBox 
- 
-==== setDetailedText ==== 
-Sets the detailed text. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setDetailedText(detailedText); 
-</code> 
- 
-=== Arguments === 
-  - detailedText - (string) the detailed text 
- 
-=== Returns === 
-  * (MessageBox) this MessageBox 
- 
-==== setInformativeText ==== 
-Sets the informative text (appended to text). 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setInformativeText(informativeText); 
-</code> 
- 
-=== Arguments === 
-  - informativeText - (string) the informative text 
- 
-=== Returns === 
-  * (MessageBox) this MessageBox 
- 
-==== setButtons ==== 
-Sets the buttons to use. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setButtons(buttons); 
-</code> 
- 
-=== Arguments === 
-  - buttons - ([[#standardbutton|StandardButton]]) the buttons to use (flag) 
- 
-=== Returns === 
-  * (MessageBox) this MessageBox 
- 
-==== setIcon ==== 
-Sets the icon to use. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setIcon(icon); 
-</code> 
- 
-=== Arguments === 
-  - buttons - ([[#icon|Icon]]) the icon to use 
- 
-=== Returns === 
-  * (MessageBox) this MessageBox 
- 
-==== setDefaultButton ==== 
-Sets the default selected button. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setDefaultButton(button); 
-</code> 
- 
-=== Arguments === 
-  - button - ([[#standardbutton|StandardButton]]) the default button 
- 
-=== Returns === 
-  * (MessageBox) this MessageBox 
- 
-==== setEscapeButton ==== 
-Sets the button pressed when pressing the escape key. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setEscapeButton(button); 
-</code> 
- 
-=== Arguments === 
-  - button - ([[#standardbutton|StandardButton]]) the button pressed when pressing the escape key 
- 
-=== Returns === 
-  * (MessageBox) this MessageBox 
- 
-==== addCustomButton ==== 
-Adds a custom button. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.addCustomButton(button, text); 
-</code> 
- 
-=== Arguments === 
-  - button - ([[#standardbutton|StandardButton]]) the standard button corresponding to this custom 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 [[#onclosed|OnClosed]] event to know when the window has been closed. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.show(); 
-</code> 
- 
-=== Returns === 
-  * (MessageBox) this MessageBox 
- 
-==== showModal ==== 
-Show the window. (blocking) 
- 
-=== Syntax === 
-<code javascript> 
-myObject.showModal(); 
-</code> 
- 
-=== 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) {}; 
-</code> 
- 
-=== Arguments === 
-  - result - (integer) the window result (0 means that it has been canceled) 
- 
-=== Example === 
-<code javascript> 
-myObject.onClosed = function(result) 
-{ 
- if(result) 
- { 
- //Event action 
- } 
-}; 
-</code> 
- 
-===== Attributes ===== 
- 
-==== title ==== 
-The window's title. (string) 
- 
-==== position ==== 
-The window's position. ([[code:core:point|Point]]) 
- 
-==== opacity ==== 
-The window's opacity. (float) 
- 
-==== enabled ==== 
-The window's enabled status. (boolean) 
- 
-==== visible ==== 
-The window's visible status. (boolean) 
- 
-===== Enumerations ===== 
- 
-==== StandardButton ==== 
-A standard button. 
- 
-=== Values === 
-  - Ok: an "ok" button 
-  - Open: an "open" button 
-  - Save: a "save" button 
-  - Cancel: a "cancel" button 
-  - Close: a "close" button 
-  - Discard: a "discard" button 
-  - Apply: an "apply" button 
-  - Reset: a "reset" button 
-  - RestoreDefaults: a "restore defaults" button 
-  - Help: a "help" button 
-  - SaveAll: a "save all" button 
-  - Yes: a "yes" button 
-  - YesToAll: a "yes to all" button 
-  - No: a "no" button 
-  - NoToAll: a "no to all" button 
-  - Abort: an "abort" button 
-  - Retry: a "retry" button 
-  - Ignore: an "ignore" button 
-  - NoButton: no button 
- 
-=== Notes === 
-This is a flag enumeration, this means that you can use multiple values using the | operator. 
-Example : 
-<code javascript> 
-myObject.setButtons(MessageBox.Yes | MessageBox.Save); //Show yes and save buttons 
-</code> 
- 
-==== Icon ==== 
-An icon. 
- 
-=== Values === 
-  - NoIcon: no icon 
-  - Question: a question mark icon 
-  - Information: an information icon 
-  - Warning: a warning icon 
-  - Critical: a critical icon (error) 
code/windows/messagebox.1296336276.txt.gz · Last modified: 2021/02/13 11:23 (external edit)