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











SourceForge.net Logo

SourceForge.net Logo

GitHub Logo

Discord Logo

ButtonOption

 

class ButtonOption : public Ctrl

 

 

Simple 2-state Ctrl - similar to Option, but with visual appearance of Button. Pushed state is persistent (until next click) and represents true. Value of ButtonOption is either 1 or 0.

 

Derived from Ctrl

 

 

Public Method List

 

ButtonOption& SetImage(const Image& img)

Sets the image img to be displayed in ButtonOption. Returns *this.

 


 

ButtonOption& SetImage(const Image& m, const Image& m1)

Sets the image m to be displayed for the "false" state and m1 to be displayed for the "true" state.

 


 

void operator=(const Image& img)

Equivalent to SetImage(img).

 


 

void Set(bool b)

Sets the ButtonOption to b.

 


 

bool Get() const

Returns the state of ButtonOption.

 


 

void operator=(bool b)

Equivalent to Set(b).

 


 

operator bool() const

Equivalent to Get().

 


 

ButtonOption& SetLabel(const String& text)

Sets the label of the button to text.

 


 

String GetLabel() const

Returns the label of the button.

 


 

static const Style& StyleDefault()

Returns the default style used to draw a "normal" ButtonOption.

 


 

static const Style& StyleFlat()

Returns the default style used to draw a "flat" ButtonOption.

 


 

ButtonOption& SetStyle(const Style& s)

Sets the style of the button to s. Returns *this for chaining.

 


 

ButtonOption& AutoStyle()

Clears all style information, reverting to the default look. Returns *this for chaining.

 

 

 

 

ButtonOption::Style

 

struct Style : public ChStyle<Style> 

This structure defines the look of a ButtonOption.

 

 

Do you want to contribute?