Using Wt 3.1.1b, I'm building a dialog, using a WGridLayout. How do I get the checkbox for 'Indexed_Beams' to be displayed on the same line as its label? Changing the minimum size of the checkbox doesn't force the checkbox and the label to be on the same line.
Here's the code:
WDialog dialog;
dialog.setWindowTitle("Edit Processor Parameters");
WVBoxLayout *contentsLayout = new WVBoxLayout();
dialog.contents()->setLayout(contentsLayout);
WGridLayout *grid = new WGridLayout();
contentsLayout->addLayout(grid, 1, Wt::AlignTop);
int row = 0;
WText *label = new WText("Name");
grid->addWidget(label, row, 0);
WLineEdit *nameLE = new WLineEdit(name);
grid->addWidget(nameLE, row++, 2);
label = new WText("Gate_Spacing");
grid->addWidget(label, row, 0);
boost::format fmt("%.1f");
float gateSpacing = 150.0; // TODO - fetch this
fmt % gateSpacing;
WLineEdit *gateSpacingLE = new WLineEdit(fmt.str());
grid->addWidget(gateSpacingLE, row++, 2);
WCheckBox *indexedCB = new WCheckBox("Indexed_Beams");
indexedCB->setMinimumSize( WLength( 100, WLength::Pixel ), WLength( 10,
WLength::Pixel) );
label = new WText("Indexed_Beam_Spacing");
WLineEdit *ibeamSpacingLE = new WLineEdit("------");
grid->addWidget(indexedCB, row, 0);
grid->addWidget(label, row, 1);
grid->addWidget(ibeamSpacingLE, row++, 2);
// extra blank row before ok, cancel buttons
++row;
WPushButton *ok = new WPushButton("OK");
WPushButton *cancel = new WPushButton("Cancel");
grid->addWidget(ok, row, 0);
grid->addWidget(cancel, row, 1);
ok->clicked().connect(SLOT(&dialog, WDialog::accept));
cancel->clicked().connect(SLOT(&dialog, WDialog::reject));
if (dialog.exec() == WDialog::Accepted) {
AcceptChanges(name);
return true;
}
return false;
<<inline: EditProcParam.png>>
------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev
_______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
