JM9 XRCU Board 0.1.3a
Libraries API Reference
Loading...
Searching...
No Matches
dsgc::Checkbox Class Reference
Inheritance diagram for dsgc::Checkbox:
dsgc::Component dsgc::Dimensions

Public Member Functions

 Checkbox (Adafruit_GFX &graphics, unsigned int x, unsigned int y)
 Creates a checkbox with default length.
 
 Checkbox (Adafruit_GFX &graphics, unsigned int x, unsigned int y, unsigned int length)
 Creates a checkbox.
 
virtual void paint () override
 Paints this component.
 
void setChecked (bool checked)
 Sets whether the checkbox is checked.
 
bool isChecked ()
 Gets whether the checkbox is checked.
 
Color getTickColor ()
 Gets the color of the tick stroke.
 
void setTickColor (Color color)
 Sets the color of the tick stroke.
 
- Public Member Functions inherited from dsgc::Component
virtual void setEnabled (bool enabled)
 Sets whether this component is enabled.
 
virtual bool isEnabled ()
 Checks whether this component is enabled.
 
virtual void setFocused (bool focused)
 
virtual bool isFocused ()
 Checks whether this component has focus.
 
virtual Color getBackgroundColor ()
 Gets the background color when enabled but not focused.
 
virtual Color getForegroundColor ()
 Gets the foreground color when enabled but not focused.
 
virtual Color getBorderColor ()
 Gets the border color when enabled but not focused.
 
virtual Color getDisabledBackgroundColor ()
 Gets the background color when disabled.
 
virtual Color getDisabledForegroundColor ()
 Gets the foreground color when disabled.
 
virtual Color getDisabledBorderColor ()
 Gets the border color when disabled.
 
virtual Color getFocusedBackgroundColor ()
 Gets the background color when enabled and focused.
 
virtual Color getFocusedForegroundColor ()
 Gets the foreground color when enabled and focused.
 
virtual Color getFocusedBorderColor ()
 Gets the border color when enabled and focused.
 
virtual void setBackgroundColor (Color color)
 
virtual void setForegroundColor (Color color)
 
virtual void setBorderColor (Color color)
 
virtual void setDisabledBackgroundColor (Color color)
 
virtual void setDisabledForegroundColor (Color color)
 
virtual void setDisabledBorderColor (Color color)
 
virtual void setFocusedBackgroundColor (Color color)
 
virtual void setFocusedForegroundColor (Color color)
 
virtual void setFocusedBorderColor (Color color)
 
virtual void repaint ()
 Repaints this component.
 
- Public Member Functions inherited from dsgc::Dimensions
unsigned int getX ()
 
unsigned int getY ()
 
unsigned int getWidth ()
 
unsigned int getHeight ()
 

Additional Inherited Members

- Protected Member Functions inherited from dsgc::Component
 Component (Adafruit_GFX &graphics, unsigned int x, unsigned int y, unsigned int width, unsigned int height)
 
virtual Adafruit_GFXgetGraphics ()
 
virtual Color getCurrentBackgroundColor ()
 
virtual Color getCurrentForegroundColor ()
 
virtual Color getCurrentBorderColor ()
 
- Protected Member Functions inherited from dsgc::Dimensions
 Dimensions (unsigned int x, unsigned int y, unsigned int width, unsigned int height)
 

Constructor & Destructor Documentation

◆ Checkbox() [1/2]

dsgc::Checkbox::Checkbox ( Adafruit_GFX & graphics,
unsigned int x,
unsigned int y )

Creates a checkbox with default length.

Parameters
graphicsThe graphics object.
xThe x-coordinate of the top-left corner of the checkbox.
yThe y-coordinate of the top-left corner of the checkbox.

◆ Checkbox() [2/2]

dsgc::Checkbox::Checkbox ( Adafruit_GFX & graphics,
unsigned int x,
unsigned int y,
unsigned int length )

Creates a checkbox.

Parameters
graphicsThe graphics object.
xThe x-coordinate of the top-left corner of the checkbox.
yThe y-coordinate of the top-left corner of the checkbox.
lengthThe side length of the checkbox square.

Member Function Documentation

◆ getTickColor()

dsgc::Color dsgc::Checkbox::getTickColor ( )

Gets the color of the tick stroke.

For simplicity's sake, tick color is not divided into disabled, focused and default colors. Maybe I'll do that later.

Returns
The color of the tick stroke.

◆ isChecked()

bool dsgc::Checkbox::isChecked ( )

Gets whether the checkbox is checked.

Returns
true if the checkbox is checked, false if unchecked.

◆ paint()

void dsgc::Checkbox::paint ( )
overridevirtual

Paints this component.

Override this function to implement the specifics of the actual component. In the overriding function, it is a must to call this parent function.

Reimplemented from dsgc::Component.

◆ setChecked()

void dsgc::Checkbox::setChecked ( bool checked)

Sets whether the checkbox is checked.

Checked gives a tick, unchecked leaves the box blank.

Parameters
checkedtrue to check the box, false to uncheck the box.

◆ setTickColor()

void dsgc::Checkbox::setTickColor ( dsgc::Color color)

Sets the color of the tick stroke.

Parameters
colorThe color of the tick stroke.

The documentation for this class was generated from the following files: