CShape



Implements Shape control.

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

// Not all combinations of layout properties works. For example, border mask is not used togather with circle, ellipse, and rounded square and rectangle. 
class CShape :public virtual IShape, public CControl
{
public:
    enum class ShapeType // Shape types 
    {
        Circle, // Circle(doesn't have border mask) 
        Ellipse, // Ellipse(doesn't have border) 
        Rectangle, // Rectangle 
        Square, // Square 
        RoundRectangle, // Rectangle with round corners(doesn't have border mask) 
        RoundSquare, // Square with round corners(doesn't have border mask) 
        Triangle // Triangle(border width with only 0 and 1 values are accepted) 
    };
public:
    // IControl setters 
    bool setDPI(const Point &value) override;

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

    CShape(); // Create 
    CShape(IForm *parent); // Create and place on a form 
    CShape(IControl *parent); // Create and place on another control 

    // Getters 
    ShapeType getShapeType() const; // Return shape type 
    float getBorderWidth() const; // Return border width 
    float getBorderRadius() const; // Return corner radius. Used in rounded rectangle and square 
    Color getBorderColor() const; // Return border color 
    Color getBackgroundColor() const; // Return background color 
    unsigned int getBorderMask() const; // Return border mask 

    // Setters 
    bool setShapeType(const ShapeType value); // Set shape type 
    bool setBorderWidth(const float value); // Set border width 
    bool setBorderRadius(const float value); // Set corner radius. Used in rounded rectangle and square 
    bool setBorderColor(const Color &value); // Set border color 
    bool setBackgroundColor(const Color &value); // Set background color 
    bool setBorderMask(const unsigned int value); // Set border mask 
};
Namespace: nitisa::standard
Include: Standard/Controls/Shape/Shape.h