kmx > IUP-0.202 > IUP::ColorDlg

Download:
IUP-0.202.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source   Latest Release: IUP-0.202_1

NAME ^

IUP::ColorDlg - [pre-defined dialog] selecting color

DESCRIPTION ^

Creates the Color Dialog element. It is a predefined dialog for selecting a color.

GTK
Windows
ColorBrowser
based

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.

The Windows and GTK dialogs can be shown only with the Popup function. The IUP::ColorBrowser based dialog is a IUP::Dialog that can be shown as any regular IUP::Dialog.

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).

USAGE ^

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 new() other ATTRIBUTE=>'value' or CALLBACKNAME=>\&func pairs relevant to this element - see IUP::Manual::02_Elements.

ATTRIBUTES

For more info about concept of attributes (setting/getting values etc.) see IUP::Manual::03_Attributes. Attributes specific to this element:

ALPHA

[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.

COLORTABLE

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 ";;".

PARENTDIALOG

(creation only) Name of a dialog to be used as parent. This dialog will be always in front of the parent dialog.

SHOWALPHA

[ColorBrowser and GTK only]

if enabled will display the alpha selection controls, regardless if ALPHA is defined for the initial value or not.

SHOWCOLORTABLE

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.

SHOWHEX

[ColorBrowser only] if enabled will display the Hexadecimal notation of the color.

SHOWHELP

[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.

STATUS

(read-only) defined to "1" if the user pressed the Ok button, undef if pressed the Cancel button.

TITLE

Dialog title.

VALUE

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.

VALUEHSI

[ColorBrowser only]

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.

VALUEHEX

[ColorBrowser only]

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.

CALLBACKS

For more info about concept of callbacks (setting callback handlers etc.) see IUP::Manual::04_Callbacks. Callbacks specific to this element:

HELP_CB

Action generated when the Help button is pressed.

NOTES ^

The GTK and Windows dialogs are native pre-defined dialogs that are not altered by SetLanguage. To show the dialog, use function Popup. The dialog is mapped only inside Popup, Map does nothing.

EXAMPLES ^

The element IUP::ColorDlg is used in the following sample scripts:

SEE ALSO ^

IUP::MessageDlg, IUP::FileDlg, Popup

The original doc: iupcolordlg.html

syntax highlighting: