PrevNextUpHome SophiaFramework UNIVERSE 5.3

12.3. Size and Margin

Table 12.2. Size and Margin Classes

Class Name Shape Type Description
SFXSize Size Class which represents a size(height and width).
SFXMargin Margin Class which represents the top, bottom, left and right margins of a rectangle.

Example 12.12. Size: width and height of rectangle (SFXRectangle)

// rectangle
SFXRectangle rectangle(10, 20, 30, 40);

// size of 50 pixels width and 60 pixels height
SFXSize size(50, 60);

// set size of rectangle to 50 pixels width and 60 pixels height
rectangle.SetSize(size);

// extend size of rectangle by 15 pixels width and 25 pixels height
rectangle.AddSize(SFXSize(15, 25));

Example 12.13. Margin: margin of the frame(SFZTitleBevelFrame)

SFZTitleBevelFrameSmp _frame;

SFXMargin margin;

// get the margin of the frame
margin.Set(_frame->GetSuitableMargin());

SInt32 top = margin.GetTop();       // top size of frame region
SInt32 bottom = margin.GetBottom(); // bottom size of frame region
SInt32 left = margin.GetLeft();     // left size of frame region
SInt32 right = margin.GetRight();   // right size of frame region

Reference: Frame