Oh, and here is the code...
WGridLayout* lMainLayout = new WGridLayout(root());
WContainerWidget* lGreen = new WContainerWidget();
lGreen->addWidget(new WText("Green"));
lGreen->setMinimumSize(WLength::Auto, WLength(100));
lGreen->decorationStyle().setBackgroundColor(WColor("green"));
WContainerWidget* lBlue = new WContainerWidget();
lBlue->addWidget(new WText("Blue"));
lBlue->setMinimumSize(50, 50);
lBlue->decorationStyle().setBackgroundColor(WColor("blue"));
WContainerWidget* lYellow = new WContainerWidget();
lYellow->addWidget(new WText("Yellow"));
lYellow->decorationStyle().setBackgroundColor(WColor("yellow"));
WContainerWidget* lRed = new WContainerWidget();
lRed->setMinimumSize(250, 400);
lRed->addWidget(new WText("Red"));
lRed->decorationStyle().setBackgroundColor(WColor("red"));
WContainerWidget* lNavy = new WContainerWidget();
lNavy->addWidget(new WText("Navy"));
lNavy->decorationStyle().setBackgroundColor(WColor("navy"));
lMainLayout->addWidget(lGreen, 0, 0, 1, 2, 0);
lMainLayout->addWidget(lBlue, 1, 0, 1, 1, 0);
lMainLayout->addWidget(lYellow, 1, 1, 1, 1, 0);
lMainLayout->addWidget(lRed, 2, 0, 1, 1, 0);
lMainLayout->addWidget(lNavy, 2, 1, 1, 1, 0);
lMainLayout->setColumnStretch(0, 0);
lMainLayout->setColumnStretch(1, 1);
lMainLayout->setRowStretch(0, 0);
lMainLayout->setRowStretch(1, 0);
lMainLayout->setRowStretch(2, 1);
________________________________
From: Rogier Schouten
Sent: vrijdag 15 mei 2009 10:07
To: '[email protected]'
Subject: Layout blues
Hi,
I've tried WBoxLayouts, WBorderLayouts and WGridLayouts, read the manual
ten times, played with Alignment flags, resize() and setMinimumSize(),
and there is still something I'm not getting about layouts.
The code below produces the attached pictures in Firefox and IE. I have
several questions:
1) How can I make the YELLOW container stretch to fill its grid
cell? According to the manual it should already, since I specified
alignment=0 for GridLayout::addWidget(). However, it only stretches
horizontally, not vertically.
2) How can I make IE take the minimum size of the
WContainerWidgets into account? Currently it fits grid cells tightly
arount the WTexts even though I specified a larget size for the
container.
3) Is there a way to specify grid row / column widths as a
percentage of the browser window? Setting percentages in
setMinimumSize() does not appear to have any effect.
Rogier
<<attachment: Firefox.gif>>
<<attachment: IE.gif>>
------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects
_______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
