CIconButton



Implements IconButton control.

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

class CIconButton :public virtual IIconButton, public CControl
{
public:
    enum class State // Possible states 
    {
        Normal, // Normal 
        Hovered, // Hovered 
        Focused, // Focused 
        FocusedHovered, // Focused and hovered 
        Active, // Active(mouse was down but not released) 
        ActiveHovered, // Active and hovered 
        Disabled // Disabled 
    };

    enum class IconSize // How icon should be displayed 
    {
        Original, // Show original size image 
        Contain, // Show full image scaled without distortions 
        Cover, // Show image scaled without distortions to fill entire client area of button 
        Stretch // Show stretched image filling entire client area 
    };
public:
    void(*OnClick)(IControl *sender); // Event called when click on the button(or Enter) 

    // IControl getters 
    RectF getClientRect() override;
    RectF getRenderRect() override;

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

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

    // IIconButton methods 
    void Click() override;

    CIconButton();
    CIconButton(IControl *parent);
    CIconButton(IForm *parent);

    State getState(); // Return state 
    // Return layout properties depending on state 
    RectF getOuterBorderWidth(const State state) const;
    RectF getInnerBorderWidth(const State state) const;
    RectF getBorderRadius(const State state) const;
    BorderColor getOuterBorderColor(const State state) const;
    BorderColor getInnerBorderColor(const State state) const;
    Color getBackgroundColor(const State state) const;
    Gradient *getBackgroundGradient(const State state);
    Color getShadowColor(const State state) const;
    PointF getShadowShift(const State state) const;
    int getShadowRadius(const State state) const;
    RectF getPadding(const State state) const;
    IImageList *getImageList(const State state) const; // Return associated image list 
    int getIconIndex(const State state) const; // Return icon index from image list to be displayed or -1 
    unsigned int getOutlineMask(const State state) const; // Return outline mask depending on state 
    Color getOutlineColor(const State state) const; // Return outline color depending on state 
    IconSize getIconSize() const;
    bool isOutlineInEditor() const; // Return whether the widget should be outlined in the Form Builder 

    // Set layout properties depending on state 
    bool setOuterBorderWidth(const State state, const RectF &value);
    bool setInnerBorderWidth(const State state, const RectF &value);
    bool setBorderRadius(const State state, const RectF &value);
    bool setOuterBorderColor(const State state, const BorderColor &value);
    bool setInnerBorderColor(const State state, const BorderColor &value);
    bool setBackgroundColor(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);
    bool setPadding(const State state, const RectF &value);
    bool setImageList(const State state, IImageList *value);
    bool setIconIndex(const State state, const int value);
    bool setOutlineMask(const State state, const unsigned int value); // Set outline mask 
    bool setOutlineColor(const State state, const Color &value); // Set outline color 
    bool setIconSize(const IconSize value);
    bool setOutlineInEditor(const bool value); // Set whether the widget should be outlined in the Form Builder 
    // Set layout properties same for all states 
    bool setOuterBorderWidth(const RectF &value);
    bool setInnerBorderWidth(const RectF &value);
    bool setBorderRadius(const RectF &value);
    bool setOuterBorderColor(const BorderColor &value);
    bool setInnerBorderColor(const BorderColor &value);
    bool setBackgroundColor(const Color &value);
    bool setShadowColor(const Color &value);
    bool setShadowShift(const PointF &value);
    bool setShadowRadius(const int value);
    bool setPadding(const RectF &value);
    bool setImageList(IImageList *value);
    bool setIconIndex(const int value);
};
Namespace: nitisa::standard
Include: Standard/Controls/IconButton/IconButton.h