ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Miscellaneous WINDEV functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
SelectColor (Function)
In french: SelectCouleur
Opens the window for color selection while selecting the specified color.
Windows color picker
Windows color picker
WEBDEV - Browser code
Color picker
Color picker
Java Remark: The picker corresponds to the color picker supplied with the JRE.
Example
Reports and QueriesWindowsJavaUser code (UMC)
Value is int
SelectionResult is boolean
 
Value =  RGB(10, 17, 69)
Info("Initial color: " + Value)
SelectionResult = SelectColor(Value, scInit)
Info("Final color: " + Value)
WEBDEV - Browser code
// == Browser button click code
// Color selection in Browser code
SelectColor(RGB(42,56,99), SelectColor_Callback)
 
INTERNAL PROCÉDURE SelectColor_Callback(coColor is Color)
CELL_NoName1.BackgroundColor = coColor
END
WEBDEV - Browser code
// Browser button to save the color that can later be used by the server
// Browser button click code
SelectColor(RGB(42,56,99), SelectColor_Callback)
 
INTERNAL PROCEDURE SelectColor_Callback(coColor is Color)
// Adds the color to the database
// and synchronizes the browser variable with the details
AJAXExecute(ajaxSynchronizeServerVariables + ajaxUpdateControls, AddSrvColor, coColor)
END
 
// Ajax procedure
PROCEDURE AddSrvColor(coColorToSave)
CELL_NoName2.BackgroundColor = coColorToSave
Syntax
Reports and QueriesWindowsJavaUser code (UMC)

Selecting a color on Windows Hide the details

<Result> = SelectColor(<Initial value> [, <Options> [, <Custom colors>]])
<Result>: Boolean
Exit mode from the window for color selection:
  • True if the OK button was clicked by the user,
  • False otherwise (Cancel button).
<Initial value>: Integer
Initial color selected in the window for color selection. This color can correspond to:
When the color selection window is closed, <Initial value> contains the value of the selected color if the user validated the window using the OK button.
<Options>: Optional constant or optional combination of constants
Options for displaying the window for color selection
scAnyColorAll the colors are allowed.
Window displayed: Color selection window.
scHelpEnables the help button.
Window displayed: Standard window for color selection of Windows.
scInit
(Default value)
The default color selected in the color selection window is the color passed as parameter to SelectColor.
Window displayed: Color selection window.
scNotPersoColorThe custom color creation button is dimmed.
Window displayed: Standard window for color selection of Windows.
scPersoColor
  • If <Custom colors> is specified, the Windows standard color selection window is displayed and the button for creating custom colors is enabled.
  • If <Custom colors> is not specified, the color selection window is displayed.
scSolidColorOnly non-hatched colors are allowed.
Window displayed: Color selection window.
scSystemDisplays the standard window for color selection of Windows.

Remark: When combining constants, the new window for color selection is displayed only if all the requested features are available in this window.
Java This parameter is ignored.
<Custom colors>: Optional address
Address of an array of 16 integers containing the RGB codes of the custom colors. If this parameter is not specified, 16 shades of gray are proposed.
Java This parameter is ignored.
WEBDEV - Browser code

Selecting a color in browser code Hide the details

SelectColor(<Initial value> , <WLanguage procedure>)
<Initial value>: Integer
Initial color selected in the window for color selection. This color can correspond to:
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback") executed when the color selection popup is closed. For more details on this procedure, see Parameters of the procedure used by SelectColor.
Business / UI classification: UI Code
Component: wd290std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 11/25/2022

Send a report | Local help