CToggle


Implements Toggle button widget.

You can find more information in comments below. Overrided methods can be found in corresponding base classes and interfaces.

class CToggle :public virtual IToggle, public CControl
{
public:
    enum class State // Possible states 
    {
        On,
        Off,
        Disabled
    };
public:
    void(*OnToggle)(IControl *sender); // Event called when button is toggled via user input 

    // IControl getters 
    RectF getRenderRect() override;

    // IControl setters 
    bool setDPI(const Point &value) override;

    // IControl methods 
    void Refresh(const bool refresh_children) override;

    // IToggle getters 
    bool isOn() override;
        
    // IToggle setters 
    bool setOn(const bool value) override;

    // IToggle methods 
    void Toggle() override;

    CToggle();
    CToggle(IControl *parent);
    CToggle(IForm *parent);

    // Getters 
    float getBackgroundBorderWidth(const State state);
    Color getBackgroundBorderColor(const State state);
    Color getBackgroundColor(const State state);
    float getBorderWidth(const State state);
    Color getBorderColor(const State state);
    Color getColor(const State state);
    int getShadowRadius(const State state);
    Color getShadowColor(const State state);
    PointF getShadowShift(const State state);

    // Setters 
    bool setBackgroundBorderWidth(const State state, const float value);
    bool setBackgroundBorderColor(const State state, const Color &value);
    bool setBackgroundColor(const State state, const Color &value);
    bool setBorderWidth(const State state, const float value);
    bool setBorderColor(const State state, const Color &value);
    bool setColor(const State state, const Color &value);
    bool setShadowRadius(const State state, const int value);
    bool setShadowColor(const State state, const Color &value);
    bool setShadowShift(const State state, const PointF &value);
};
Namespace: nitisa::standard
Include: Standard/Controls/Toggle/Toggle.h