Box

 

class Box : public StaticRect

 

Box is a widget that contains a matrix of child widgets arranged horizontally and vertically in a grid that is dynamically adjusted proportionally or following the output of Function.depending on box dimensions.

 

 

Constructor Detail

 

No constructor included.

 

Public Member List


 

Box& Add(Ctrl& ctrl, int row, int col)

Adds a new ctrl , located at row and col  .The control dimensions are re-scaled automatically.

 


 

void Clear()

Clear all data and sets the size to zero.

 


 

int GetRows()

Returns the number of rows.

 


 

int GetCols()

Returns the number of columns.

 


 

Box& SetWidths(const Vector<int>& t)

Sets the width of each column. The size of t is the number of columns.

By default, the width is 1000.

 


 

Box& SetWidth(int id, int width)

Sets the width of column id.

 


 

Box& SetHeights(const Vector<int>& t)

Sets the height of each row. The size of t is the number of rows.

By default, the height is 1000.

 


 

Box& SetHeight(int id, int height)

Sets the height of row id.

 


 

Function<void (int, int, Vector<int>&)> WhenWidths

This function is called when the ctrl is redimensioned.

The arguments are the real width and height of the ctrl, and a Vector with the width of each column, in the same scale that the width and height of the ctrl.

 


 

Function<void (int, int, Vector<int>&)> WhenHeights

This function is called when the ctrl is redimensioned.

The arguments are the real width and height of the ctrl, and a Vector with the height of each row, in the same scale that the width and height of the ctrl.