Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site













SourceForge.net Logo

ColorPopUp

 

class ColorPopUp : public Ctrl

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

 

 

Public Member List

 

void PopUp(Ctrl *owner, Color c = White)

Opens ColorPopUp as pop-up window.

owner

Owner Ctrl. ColorPopUp appears bellow or above this Ctrl.

c

Initial color for wheel and ramp selectors.

 


 

Color Get() const

Return value

Returns current color selected.

 


 

ColorPopUp& 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.

Return value

*this.

 


 

ColorPopUp& SColors(bool b = true)

Setups whether choice of system colors is allowed. Constructor setting is SColors(false).

b

true enables choice of system colors.

Return value

*this.

 


 

ColorPopUp& NullText(const char *s)

Setups text for Null color choice. Constructor setting for en-us is "(transparent)".

s

New text for Null color choice.

Return value

*this.

 


 

ColorPopUp& WithVoid(bool b = true)

Enables special VoidColor() (labeled "(None)", unless the name is changed by VoidText).

 


 

ColorPopUp& VoidText(const char *s)

Changes the label of VoidColor().

 


 

Callback WhenCancel

This callback is invoked when ColorPopUp is canceled (e.g. by clicking outside).

 


 

Callback WhenSelect

This callback is invoked when color is chosen. Resulting color can be obtained by Get().

 

 

ColorPusher

 

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

 

 

Public Member List

 

ColorPusher& NullText(const char *s)

Sets a text to be displayed if Color value is Null. Constructor setting for en-us is "(transparent)".

s

Text.

Return value

*this.

 


 

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.

Return value

*this.

 


 

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.

Return value

*this.

 


 

ColorPusher& WithText()

Setups displaying of text representation of color.

Return value

*this.

 


 

ColorPusher& WithHex()

Setups displaying of text representation of color in HTML hexadecimal format.

 


 

ColorPusher& Track(bool b = true)

Setups track mode. Constructor setting is Track(false).

b

true enables track mode.

Return value

*this

 


 

ColorPusher& NoTrack()

Same as Track(false).

Return value

*this.

 

 

 

 

ColorButton

 

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

 

 

Public Member List

 

ColorButton& ColorImage(const Image& img)

Sets image to display color. This image is drawn (in the center of ColorButton) with selected color.

img

Image.

Return value

*this.

 


 

ColorButton& NullImage(const Image& img)

Sets image to display null color.

img

Image.

Return value

*this.

 


 

ColorButton& StaticImage(const Image& img)

Sets static image that is always displayed with ColorImage and NullImage.

img

Image.

Return value

*this.

 

 

Last edit by cxl on 06/23/2017. Do you want to contribute?. T++