User Tools

Site Tools


code:windows:colordialog

Differences

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

Link to this comparison view

Next revision
Previous revision
code:windows:colordialog [2011/01/29 15:09] – created jmgrcode:windows:colordialog [2011/04/20 20:28] (current) – removed jmgr
Line 1: Line 1:
-====== ColorDialog ====== 
-This object represents a window. 
  
-===== Functions ===== 
- 
-==== ColorDialog ==== 
-Constructor function. 
- 
-=== Syntax === 
-<code javascript> 
-var myObject = new ColorDialog(); 
-</code> 
-<code javascript> 
-var myObject = new ColorDialog(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 
-    * showAlphaChannel - (boolean) show the alpha channel 
-    * color - ([[code:core:color|Color]]) the selected color 
-    * onClosed - ([[#onclosed|OnClosed]]) the OnClosed event 
-    * onColorSelected - ([[#oncolorselected|OnColorSelected]]) the OnColorSelected event 
-    * onColorChanged - ([[#oncolorchanged|OnColorChanged]]) the OnColorChanged event 
- 
-=== Exceptions === 
-  * (ParameterTypeError) incorrect parameter type 
-  * (ParameterCountError) incorrect parameter count 
- 
-=== Example === 
-<code javascript> 
-var myObject = new ColorDialog(); 
-</code> 
-<code javascript> 
-var myObject = new ColorDialog({ 
- title: "My title", 
- opacity: 0.5 
-}); 
-</code> 
- 
-===== Methods ===== 
- 
-==== setTitle ==== 
-Sets the window's title. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setTitle(title); 
-</code> 
- 
-=== Arguments === 
-  - title - (string) the window's title 
- 
-=== Returns === 
-  * (ColorDialog) this ColorDialog 
- 
-==== setPosition ==== 
-Sets the window's position. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setPosition(point); 
-</code> 
- 
-=== Arguments === 
-  - point - ([[code:core:point|Point]]) the window's position 
- 
-=== Returns === 
-  * (ColorDialog) this ColorDialog 
- 
-==== setOpacity ==== 
-Sets the window's opacity. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setOpacity(opacity); 
-</code> 
- 
-=== Arguments === 
-  - opacity - (float) the window's opacity 
- 
-=== Returns === 
-  * (ColorDialog) this ColorDialog 
- 
-==== setEnabled ==== 
-Sets the window's enabled status. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setEnabled(enabled); 
-</code> 
- 
-=== Arguments === 
-  - enabled - (boolean) the window's enabled status 
- 
-=== Returns === 
-  * (ColorDialog) this ColorDialog 
- 
-==== setVisible ==== 
-Sets the window's visible status. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setVisible(visible); 
-</code> 
- 
-=== Arguments === 
-  - visible - (boolean) the window's visible status 
- 
-=== Returns === 
-  * (ColorDialog) this ColorDialog 
- 
-==== close ==== 
-Closes the window. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.close(); 
-</code> 
- 
-=== Returns === 
-  * (ColorDialog) this ColorDialog 
- 
-==== 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 
- 
-==== showAlphaChannel ==== 
-Sets if the alpha channel should be visible. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.showAlphaChannel(showAlphaChannel); 
-</code> 
- 
-=== Arguments === 
-  - showAlphaChannel - (boolean) the alpha channel visibility status 
- 
-=== Returns === 
-  * (ColorDialog) this ColorDialog 
- 
-==== setColor ==== 
-Sets the current color. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.setColor(color); 
-</code> 
- 
-=== Arguments === 
-  - color - ([[code:core:color|Color]]) the current color 
- 
-=== Returns === 
-  * (ColorDialog) this ColorDialog 
- 
-==== 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 === 
-  * (ColorDialog) this ColorDialog 
- 
-==== showModal ==== 
-Show the window. (blocking) 
- 
-=== Syntax === 
-<code javascript> 
-myObject.showModal(); 
-</code> 
- 
-=== Returns === 
-  * (integer) the window result (0 means that it has been canceled) 
- 
-==== color ==== 
-Returns the current color. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.color(); 
-</code> 
- 
-=== Returns === 
-  * ([[code:core:color|Color]]) the current color 
- 
-===== 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> 
- 
-==== onColorSelected ==== 
-Called when a color has been selected. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.onColorSelected = function(color) {}; 
-</code> 
- 
-=== Arguments === 
-  - color - ([[code:core:color|Color]]) the selected color 
- 
-=== Example === 
-<code javascript> 
-myObject.onColorSelected = function(color) 
-{ 
- //Event action 
-}; 
-</code> 
- 
-==== onColorChanged ==== 
-Called when the current color has been changed. 
- 
-=== Syntax === 
-<code javascript> 
-myObject.onColorChanged = function(color) {}; 
-</code> 
- 
-=== Arguments === 
-  - color - ([[code:core:color|Color]]) the current color 
- 
-=== Example === 
-<code javascript> 
-myObject.onColorChanged = function(color) 
-{ 
- //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) 
code/windows/colordialog.1296313794.txt.gz · Last modified: 2021/02/13 11:23 (external edit)