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 STATE // Possible states 
    {
        stNormal, // Normal 
        stHovered, // Hovered 
        stFocused, // Focused 
        stFocusedHovered, // Focused and hovered 
        stActive, // Active(mouse was down but not released) 
        stActiveHovered, // Active and hovered 
        stDisabled // Disabled 
    };

    enum ICON_SIZE // How icon should be displayed 
    {
        isOriginal, // Show original size image 
        isContain, // Show full image scaled without distortions 
        isCover, // Show image scaled without distortions to fill entire client area of button 
        isStretch // 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;
    RectC getOuterBorderColor(const STATE state) const;
    RectC 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 
    ICON_SIZE 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 RectC &value);
    bool setInnerBorderColor(const STATE state, const RectC &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 ICON_SIZE 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 RectC &value);
    bool setInnerBorderColor(const RectC &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