Resizable2D class reference


A class that is a kind of set of tools for automatically changing the size and position of the widget.

Functions documentation

Resizable2D(Window* window, const Widget2DProps& props);

Default constructor.


Resizable2D(const Resizable2D& copy);

Copy constructor.


virtual ~Resizable2D() noexcept;

Virtual destructor.


const ResizableProps& GetResizableProps() const;

A function that allows to read data which determines the operation of the automatic resizing and positioning mechanism of the widget.


virtual void SetResizeProportions(int x, int y, int w, int h);

Sets the aspect ratio that changes the position and size of the widget in relation to the size and position change of the parent.


virtual void SetMinMaxDimensions(int iMinWidth, int iMinHeight, int iMaxWidth, int iMaxHeight);

Sets the maximum and minimum dimensions of the widget. Pass "A_DONT_CARE" if you do not want to set one of the values.


virtual void CalcResizeData(Dimension<size_t>& fromResizeEvent, Dimension<size_t>& newDim, Point<int>& newPos);

Calculates the widget position and dimension change.


Variables documentation

ResizableProps m_ResizableProps;

It stores all the data needed to automatically change the position and size of the widget.