Ceci est une ancienne révision du document !
Table des matières
ColorDialog [En cours de Traduction Wismerheal][WSL]
Cet objet représente une fenêtre permettant à l'utilisateur de choisir une couleur.
Fonctions
ColorDialog
Fonction de construction.
Syntaxe
var myObject = new ColorDialog();
var myObject = new ColorDialog(parameters);
Arguments
- paramètres - (object) paramètre de fenêtre
- title - (string) le titre de la fenêtre
- position - (Point) la position de la fenêtre
- opacity - (float) l'opacité de la fenêtre
- enabled - (boolean) le statut d'activation de la fenêtre
- visible - (boolean) le statut de la fenêtre visible
- showAlphaChannel - (boolean) montre le cannal alpha
- color - (Colorl'évènènement "OnClosed" (à la fermeture)
- onColorSelected - (OnColorSelected) l'évènement "OnColorSelected" (à la sélection de la couleur)
- onColorChanged - (OnColorChanged) l'évènement "OnColorChanged" (au changement de la couleur)
Exceptions
- (ParameterTypeError) type de paramètre incorrect
- (ParameterCountError) paramètre de compteur incorrect
Example
var myObject = new ColorDialog();
var myObject = new ColorDialog({ title: "My title", opacity: 0.5 });
Méthodes
setTitle
Définit le titre de la fenêtre.
Syntaxe
myObject.setTitle(title);
Arguments
- title - (string) le titre de la fenêtre
Renvoi
- (ColorDialog) ce "ColorDialog"
setPosition
Définit la position de la fenêtre.
Syntaxe
myObject.setPosition(point);
Arguments
- point - (Point) la position de la fenêtre
Renvoi
- (ColorDialog) ce "ColorDialog"
setOpacity
Définit l'opacité de la fenêtre.
Syntaxe
myObject.setOpacity(opacity);
Arguments
- opacity - (float) l'opacité de la fenêtre
Returns
- (ColorDialog) ce ColorDialog
setEnabled
Définit le statut d'activité de la fenêtre.
Syntaxe
myObject.setEnabled(enabled);
Arguments
- enabled - (boolean) le statut d'activité de la fenêtre
nvoiturns ===
- (ColorDialog) ce "ColorDialog"
setVisible
Définit le statut visible de la fenêtre.
Syntaxe
myObject.setVisible(visible);
Arguments
- visible - (boolean) le statut visible de la fenêtre
Renvoi
- (ColorDialog) ce "ColorDialog"
close
Ferme la fenêtre.
Syntaxe
myObject.close();
Renvoi
- (ColorDialog) ce "ColorDialog"
title
Renvoi le titre de la fenêtre.
Syntaxe
myObject.title();
Renvoi
- (string) le titre de la fenêtre
position
Renvoi la position de la fenêtre.
Syntaxe
myObject.position();
Renvoi
- (Point) la position de la fenêtre
opacity
Renvoi l'opacité de la fenêtre.
Syntaxe
myObject.opacity();
Renvoi
- (float) l'opacité de la fenêtre
enabled
Renvoi le statut d'activité de la fenêtre.
Syntaxe
myObject.enabled();
Renvoi
- (boolean) le statut d'activité de la fenêtre
visible
Renvoi le statut visible de la fenêtre.
Syntaxe
myObject.visible();
Renvoi
- (boolean) le statut visible de la fenêtre
showAlphaChannel
Définit si le cannal alpha doit être visible.
Syntax
myObject.showAlphaChannel(showAlphaChannel);
Arguments
- showAlphaChannel - (boolean) the alpha channel visibility status
Returns
- (ColorDialog) this ColorDialog
setColor
Sets the current color.
Syntax
myObject.setColor(color);
Arguments
- color - (Color) the current color
Returns
- (ColorDialog) this ColorDialog
show
Show the window. (non-blocking) Use the OnClosed event to know when the window has been closed.
Syntax
myObject.show();
Returns
- (ColorDialog) this ColorDialog
showModal
Show the window. (blocking)
Syntax
myObject.showModal();
Returns
- (integer) the window result (0 means that it has been canceled)
color
Returns the current color.
Syntax
myObject.color();
Returns
- (Color) the current color
Events
onClosed
Called when the window is closed.
Syntax
myObject.onClosed = function(result) {};
Arguments
- result - (integer) the window result (0 means that it has been canceled)
Example
myObject.onClosed = function(result) { if(result) { //Event action } };
onColorSelected
Called when a color has been selected.
Syntax
myObject.onColorSelected = function(color) {};
Arguments
- color - (Color) the selected color
Example
myObject.onColorSelected = function(color) { //Event action };
onColorChanged
Called when the current color has been changed.
Syntax
myObject.onColorChanged = function(color) {};
Arguments
- color - (Color) the current color
Example
myObject.onColorChanged = function(color) { //Event action };
Attributes
title
The window's title. (string)
position
The window's position. (Point)
opacity
The window's opacity. (float)
enabled
The window's enabled status. (boolean)
visible
The window's visible status. (boolean)