A New Margin Property for Class Place

Coordinator
Apr 5, 2014 at 9:53 PM
Edited Apr 8, 2014 at 5:44 PM
The margin specifies the empty space at side of place field.
int main()
{
    using namespace nana::gui;

    form fm;
    button btn(fm);
    btn.caption(L"Button");

    place plc(fm);
    plc.div("<abc margin=20>");
    plc.field("abc")<<btn;
    plc.collocate();

    fm.show();
    exec();
}
Image

The margin specifies the width of left, right, top and bottom margins. Also, it can have from 1 to 4 values.

"<abc margin=[10, 20, 30, 40]>"
top margin = 10
right margin = 20
bottom margin = 30
left margin = 40
"<abc margin=[10, 20, 30]>"
top margin = 10
right margin = 20
bottom margin = 30
"<abc margin=[10, 20]>"
top margin = bottom margin = 10
left margin = right margin = 20
"<abc margin=[10]">
top margin = 10
The margin can specified in percent of the width of the field.
"<abc margin=[10%,20%]"> and "<abc margin=15%>"