CMultiButton


Implements MultiButton control.

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

class CMultiButton :public virtual IMultiButton, public CControl
{
public:
    enum class State // Describes possible states 
    {
        Normal, // Normal 
        Hovered, // Mouse pointer is over 
        Focused, // Focused 
        FocusedHovered, // Focused and mouse pointer is over 
        Down, // Left mouse button or Return key is down and not yet released 
        DownHovered, // Down + mouse pointer is over 
        DownFocused, // Down and focused 
        DownFocusedHovered, // Down, focused and mouse pointer is over 
        Active, // Button is active 
        ActiveHovered, // Button is active and mouse pointer is over it 
        Inactive, // Button is inactive 
        InactiveHovered, // Button is inactive and mouse pointer is over it 
        Disabled // Disabled 
    };

    enum class OpenDirection // Open directions 
    {
        Left, // To the left of the widget 
        Top, // To the top of the widget 
        Right, // To the right of the widget 
        Bottom // To the bottom of the widget 
    };

    enum class ImageSize // Image sizes 
    {
        Original, // Original size. Image is in the center of client area 
        Cover, // Image size is changed with saving proportions so it covers a button. Image is in the center of client area 
        Contain, // Image size is changed with saving proportions so it completely fit int a button. Image is in the center of client area 
        Stretch // Image is stretched without saving proportions and it wills entire client area of a button 
    };
protected:
    void SortItems() override; // No sorting 
public:
    // IControl getters 
    IControl *getControl(const int index) override;
    IControl *getControl(const String &name) override;
    IControl *getControl(const PointF &position) override;
    RectF getRenderRect() override;
    bool hasExtra() override;

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

    // IComponentItemList getters 
    int getItemCount() override;
    IListItem *getItem(const int index) override;
    int getItemIndex(IListItem *item) override;
    bool isAcceptItem(IListItem *item) override;

    // IComponentItemList items 
    bool AddItem(IListItem *item) override;
    bool InsertItem(IListItem *item, const int before) override;
    bool DeleteItem(const int index) override;
    bool DeleteItem(IListItem *item) override;
    bool DeleteItems() override;

    // IComponentItemList methods 
    IListItemOwner *QueryListItemOwner() override;

    // IButtonList getters 
    float getDelay() override;
    int getButtonCount() override;
    IListItemMultiButton *getButton(const int index) override;
    int getButtonIndex(IListItemMultiButton *item) override;
    int getActiveButtonIndex() override;
    IListItemMultiButton *getActiveButton() override;

    // IButtonList setters 
    bool setDelay(const float value, const float tolerance = ntl::Tolerance<float>) override;
    bool setActiveButtonIndex(const int value) override;
    bool setActiveButton(IListItemMultiButton *value) override;

    // IButtonList buttons 
    bool AddButton(IListItemMultiButton *item) override;
    IListItemMultiButton *AddButton(const String &caption) override;
    bool InsertButton(IListItemMultiButton *item, const int before) override;
    IListItemMultiButton *InsertButton(const String &caption, const int before) override;
    bool DeleteButton(const int index) override;
    bool DeleteButton(IListItemMultiButton *item) override;
    bool DeleteButtons() override;

    CMultiButton();
    CMultiButton(IControl *parent);
    CMultiButton(IForm *parent);

    // Getters 
    IImageList *getImageList();
    OpenDirection getOpenDirection() const;
    unsigned int getOutlineMask(const State state) const;
    Color getOutlineColor(const State state) const;
    float getOpenerSize(const State state) const;
    Color getOpenerColor(const State state) const;
    RectF getBorderRadius(const State state) const;
    RectF getOuterBorderWidth(const State state) const;
    BorderColor getOuterBorderColor(const State state) const;
    RectF getInnerBorderWidth(const State state) const;
    BorderColor getInnerBorderColor(const State state) const;
    Color getBackgroundColor(const State state) const;
    Gradient *getBackgroundGradient(const State state);
    RectF getPadding(const State state) const;
    ImageSize getImageSize(const State state) const;
    TextAlign getCaptionHorizontalAlign(const State state) const;
    VerticalAlign getCaptionVerticalAlign(const State state) const;
    Color getCaptionColor(const State state) const;
    int getShadowRadius(const State state) const;
    PointF getShadowShift(const State state) const;
    Color getShadowColor(const State state) const;

    // Setters 
    bool setImageList(IImageList *value);
    bool setOpenDirection(const OpenDirection value);
    bool setOutlineMask(const State state, const unsigned int value);
    bool setOutlineColor(const State state, const Color &value);
    bool setOpenerSize(const State state, const float value, const float tolerance = ntl::Tolerance<float>);
    bool setOpenerColor(const State state, const Color &value);
    bool setBorderRadius(const State state, const RectF &value, const float tolerance = ntl::Tolerance<float>);
    bool setOuterBorderWidth(const State state, const RectF &value, const float tolerance = ntl::Tolerance<float>);
    bool setOuterBorderColor(const State state, const BorderColor &value);
    bool setInnerBorderWidth(const State state, const RectF &value, const float tolerance = ntl::Tolerance<float>);
    bool setInnerBorderColor(const State state, const BorderColor &value);
    bool setBackgroundColor(const State state, const Color &value);
    bool setPadding(const State state, const RectF &value, const float tolerance = ntl::Tolerance<float>);
    bool setImageSize(const State state, const ImageSize value);
    bool setCaptionHorizontalAlign(const State state, const TextAlign value);
    bool setCaptionVerticalAlign(const State state, const VerticalAlign value);
    bool setCaptionColor(const State state, const Color &value);
    bool setShadowRadius(const State state, const int value);
    bool setShadowShift(const State state, const PointF &value, const float tolerance = ntl::Tolerance<float>);
    bool setShadowColor(const State state, const Color &value);
    // Layout setters applying to all states at once 
    bool setOutlineMask(const unsigned int value);
    bool setOutlineColor(const Color &value);
    bool setOpenerSize(const float value, const float tolerance = ntl::Tolerance<float>);
    bool setOpenerColor(const Color &value);
    bool setBorderRadius(const RectF &value, const float tolerance = ntl::Tolerance<float>);
    bool setOuterBorderWidth(const RectF &value, const float tolerance = ntl::Tolerance<float>);
    bool setOuterBorderColor(const BorderColor &value);
    bool setInnerBorderWidth(const RectF &value, const float tolerance = ntl::Tolerance<float>);
    bool setInnerBorderColor(const BorderColor &value);
    bool setBackgroundColor(const Color &value);
    bool setPadding(const RectF &value, const float tolerance = ntl::Tolerance<float>);
    bool setImageSize(const ImageSize value);
    bool setCaptionHorizontalAlign(const TextAlign value);
    bool setCaptionVerticalAlign(const VerticalAlign value);
    bool setCaptionColor(const Color &value);
    bool setShadowRadius(const int value);
    bool setShadowShift(const PointF &value, const float tolerance = ntl::Tolerance<float>);
    bool setShadowColor(const Color &value);
};
Namespace: nitisa::standard
Include: Standard/Controls/MultiButton/MultiButton.h