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 SHAPE_TYPE // Shape types
{
shCircle, // Circle(doesn't have border mask)
shEllipse, // Ellipse(doesn't have border)
shRectangle, // Rectangle
shSquare, // Square
shRoundRectangle, // Rectangle with round corners(doesn't have border mask)
shRoundSquare, // Square with round corners(doesn't have border mask)
shTriangle // 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
SHAPE_TYPE 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 SHAPE_TYPE 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 |