public static class ColorTable.ColorChooserDialog
extends java.lang.Object
Each public method emulates an option of the statement. They do a quick validation. If successful, they return a reference to this object to allow other method to be chained.
The execute()
method does the final checks, send the request with gathered options
to client, awaits the user to interact and finally sets up the response and confirmation
variable update
.
Modifier and Type | Field and Description |
---|---|
private int |
colorRef
The (index of the) selected color that is to be modified by user.
|
private handle |
inWindow
Specifies the parent window for the dialog box to be displayed.
|
private logical |
toUpdate
A logical variable used as output parameter that will contain the status of the user's
dialog interaction: if the user validates it by selecting the
OK button, the
value of the variable is set to TRUE on return. |
Modifier | Constructor and Description |
---|---|
private |
ColorChooserDialog(int64 colRef)
The constructor.
|
private |
ColorChooserDialog(long colRef)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
execute()
Instructs the client to show the
Color Chooser dialog using the configured
options using previously chained methods. |
static ColorRgb |
getColor(WindowWidget window,
ColorRgb init)
Worker method for getting the color from user using the specific dialog.
|
ColorTable.ColorChooserDialog |
setWindow(handle window)
Configures the file dialog to be created as child of a certain windows.
|
ColorTable.ColorChooserDialog |
update(logical update)
Configures the variable to be set when the file selection dialog is closed.
|
private int colorRef
private logical toUpdate
OK
button, the
value of the variable is set to TRUE
on return. If the user rejects the dialog by
pressing the Cancel
button, the variable's value on return will be FALSE
.private handle inWindow
private ColorChooserDialog(int64 colRef)
execute
.colRef
- The (index of the) selected color that is to be selected by user.private ColorChooserDialog(long colRef)
execute
.colRef
- The (index of the) selected color that is to be selected by user.public ColorTable.ColorChooserDialog setWindow(handle window)
window
- A handle to a window that will be the parent of the dialog. The handle must
refer a window or an error condition will be issued.FileDialog
. Used for chaining.inWindow
public ColorTable.ColorChooserDialog update(logical update)
update
- A variable that will hold the return status of the dialog. That is true
if the dialog was accepted and false
otherwise.FileDialog
. Used for chaining.toUpdate
public void execute()
Color Chooser
dialog using the configured
options using previously chained methods. When the client returns, updates the
toUpdate
variable, if set, to let the programmer know whether the client
accepted the dialog or rejected it. If a new color is selected, the entry in the palette
is updated to the newly selected RGB value.public static ColorRgb getColor(WindowWidget window, ColorRgb init)
window
- The parent window. If it is null
the default window is used.init
- The initial color.null
if the color chooser dialog was
rejected.