IUP::ColorDlg - [pre-defined dialog] selecting color
Creates the Color Dialog element. It is a predefined dialog for selecting a color.
There are 3 versions of the dialog. One for Windows only, one for GTK only and one for all systems, but it is based on the IUP::ColorBrowser.
IMPORTANT: In perl IUP bindings only IUP::ColorBrowser based dialog is available (because perl bindings automatically initializes the Controls Library after that the Windows and GTK dialogs are not available anymore).
CREATION - new() method
$colordlg = IUP::ColorDlg->new( VALUE=>"100 100 0" );
Returns: the identifier of the created element, or
undef if an error occurs.
NOTE: You can pass to
CALLBACKNAME=>\&func pairs relevant to this element - see IUP::Manual::02_Elements.
For more info about concept of attributes (setting/getting values etc.) see IUP::Manual::03_Attributes. Attributes specific to this element:
[ColorBrowser and GTK only] if defined it will enable an alpha selection additional controls with its initial value. If the user pressed the Ok button contains the returned value. Default: no defined, or 255 if SHOWALPHA=YES.
list of colors separated by ";". In GTK and in the ColorBrowser based accepts 20 values and if not present the palette will not be visible. In Windows accepts 16 values and will be always visible, even if the colors are not defined (in this case are initialized with black). If a color is not specified then the default color is used. You can skip colors using ";;".
(creation only) Name of a dialog to be used as parent. This dialog will be always in front of the parent dialog.
[ColorBrowser and GTK only]
if enabled will display the alpha selection controls, regardless if ALPHA is defined for the initial value or not.
if enabled will display the color table, regardless if COLORTABLE is defined or not. The default colors in the color table are different in GTK and in the ColorBrowser based dialog. In Windows the default colors are all black.
[ColorBrowser only] if enabled will display the Hexadecimal notation of the color.
[ColorBrowser only] if enabled will display the Help button. In GTK and Windows, the Help button is shown only if the HELP_CB callback is defined.
(read-only) defined to "1" if the user pressed the Ok button,
undefif pressed the Cancel button.
The color value in RGB coordinates and optionally alpha. It is used as the initial value and contains the selected value if the user pressed the Ok button. Format: "R G B" or "R G B A". Each component range from 0 to 255.
The color value in HSI coordinates. It is used as the initial value and contains the selected value if the user pressed the Ok button. Format: "H S I". Each component range from 0-359, 0-100 and 0-100 respectively.
The color value in RGB Hexadecimal notation. It is used as the initial value and contains the selected value if the user pressed the Ok button. Format: "#RRGGBB". Each component range from 0-255, but in hexadecimal notation.
For more info about concept of callbacks (setting callback handlers etc.) see IUP::Manual::04_Callbacks. Callbacks specific to this element:
Action generated when the Help button is pressed.
The element IUP::ColorDlg is used in the following sample scripts:
0-basic/colordlg.pl - IUP::ColorDlg example (used for screenshot - IUP.pod)
0-basic/pre-dialogs.pl - IUP::Expander example
The original doc: iupcolordlg.html