CCheckBox



Implements CheckBox control.

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

class CCheckBox :public virtual ICheckBox, public CControl
{
public:
    enum class State // Possible states 
    {
        Normal,
        Hovered,
        Focused,
        FocusedHovered,
        Active, // Mouse was down but not released yet 
        ActiveHovered,
        Disabled
    };
public:
    void(*OnChange)(IControl *sender); // Event called when checked state changed 

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

    RectF getRenderRect() override;
    
    bool setAlign(const Align value) override;
    bool setConstraints(const RectF &value) override;
    bool setSize(const PointF &value) override;
    bool setDPI(const Point &value) override;

    String getCaption() override;
    CheckedState getChecked() override;

    bool setCaption(const String &value) override;
    bool setChecked(const CheckedState value) override;

    CCheckBox();
    CCheckBox(IControl *parent);
    CCheckBox(IForm *parent);

    State getState(); // Return current state 
    // Return layout properties 
    TextAlign getContentHorizontalAlign() const;
    VerticalAlign getContentVerticalAlign() const;
    bool isIconOnRight() const;
    bool isAutoSize() const;
    float getIconPadding() const;
    Color getColor(const State state) const;
    Color getShadowColor(const State state) const;
    PointF getShadowShift(const State state) const;
    int getShadowRadius(const State state) const;

    // Set layout properties 
    bool setContentHorizontalAlign(const TextAlign value);
    bool setContentVerticalAlign(const VerticalAlign value);
    bool setIconOnRight(const bool value);
    bool setAutoSize(const bool value);
    bool setIconPadding(const float value);
    bool setColor(const State state, const Color &value);
    bool setShadowColor(const State state, const Color &value);
    bool setShadowShift(const State state, const PointF &value);
    bool setShadowRadius(const State state, const int value);
};
Namespace: nitisa::standard
Include: Standard/Controls/CheckBox/CheckBox.h