This class implements pop-up window for color-selection.
ColorPopUp calls WhenAction Ctrl callback and sets modify flag whenever selected color changes (that is during selection).
Derived from Ctrl
Opens ColorPopUp as pop-up window.
|
owner |
Owner Ctrl. ColorPopUp appears bellow or above this Ctrl. |
|
c |
Initial color for wheel and ramp selectors. |
|
Return value |
Returns current color selected. |
Setups whether Null (that is transparent) color choice is enabled. Constructor setting is NotNull(false).
|
b |
true disables Null color choice. |
Setups whether choice of system colors is allowed. Constructor setting is SColors(false).
|
b |
true enables choice of system colors. |
Setups text for Null color choice. Constructor setting for en-us is "(transparent)".
|
s |
New text for Null color choice. |
Enables special VoidColor() (labeled "(None)", unless the name is changed by VoidText).
Changes the label of VoidColor().
This callback is invoked when ColorPopUp is canceled (e.g. by clicking outside).
This callback is invoked when color is chosen. Resulting color can be obtained by Get().
class ColorPusher : public Ctrl
This class represents Ctrl with Color value. It uses ColorPopUp to edit this value.
As is U++ standard, Color value is set and get using SetData and GetData virtual method.
WhenAction callback and modify set behaviour depends on track mode. When track mode is enabled (Track(true)), WhenAction is called and modify set upon any change of color (including moving mouse through ColorPopUp). When track mode is off, it is called and set only after new Color is selected.
Derived from Ctrl
ColorPusher& NullText(const char *s)
Sets a text to be displayed if Color value is Null. Constructor setting for en-us is "(transparent)".
ColorPusher& NotNull(bool b = true)
Setups whether Null (that is transparent) color choice is enabled. Constructor setting is NotNull(false).
|
b |
true disables Null color choice. |
ColorPusher& WithVoid(bool b = true)
Enables special VoidColor() (labeled "(None)", unless the name is changed by VoidText).
ColorPusher& VoidText(const char *s)
Changes the label of VoidColor().
ColorPusher& SColors(bool b = true)
Setups whether choice of system colors is allowed. Constructor setting is SColors(false).
|
b |
true enables choice of system colors. |
ColorPusher& WithText(bool b = true)
ColorPusher will display text representation of color (either known name, or numbers).
ColorPusher& WithHex(bool b = true)
ColorPusher will hexadecimal representation of color.
ColorPusher& Track(bool b = true)
Setups track mode. Constructor setting is Track(false).
|
b |
true enables track mode. |
ColorPusher& NoTrack()
Same as Track(false).
class ColorButton : public ColorPusher
This class is similar to ColorPusher, but intended to be used in ToolBar. It supports displaying color using Image too.
Derived from ColorPusher
ColorButton& ColorImage(const Image& img)
Sets image to display color. This image is drawn (in the center of ColorButton) with selected color.
ColorButton& NullImage(const Image& img)
Sets image to display null color.
ColorButton& StaticImage(const Image& img)
Sets static image that is always displayed with ColorImage and NullImage.
|