Checkbox wrapping in forms [message #445736] |
Wed, 10 November 2004 07:53 |
choi Messages: 1 Registered: July 2009 |
Junior Member |
|
|
Hi,
does a Button with SWT.CHECK support text wrapping? I'm using it
in a TableWrapLayout, please see the code snippet below. While
the labels in the layout wrap just fine, the label of the checkbox
does not wrap.
Could i probably emulate wrapping behavior for the checkbox by
combining a checkbox with no text and a label besides it?
thanks,
choi
-- code snippet --
private void createAntSection() {
// Create Ant section
Section antSection =
createSection(form.getBody(),
"Ant Build File",
"Location and settings for the generated Ant file");
Composite antSectionClient = toolkit.createComposite(antSection);
TableWrapLayout antLayout = new TableWrapLayout();
antLayout.numColumns = 3;
antSectionClient.setLayout(antLayout);
// Ant checkbox
Button genAntCheckbox =
toolkit.createButton(antSectionClient,
EpaxPlugin.getResourceString(ID + ".antgen"),
SWT.CHECK | SWT.WRAP);
TableWrapData genTwd = new TableWrapData(TableWrapData.FILL);
genTwd.colspan = antLayout.numColumns;
genAntCheckbox.setLayoutData(genTwd);
// Wrap test label
Label testLabel =
toolkit.createLabel(antSectionClient,
"asdfasd fsadfsadfsadf jdslfjksadjkfsadjfkasdkfsad asfd s
fdsda fs daf sadf sadf sad fsad fsadfasdf asdf sad fsad fs adf sadf sdf
sad",
SWT.WRAP);
TableWrapData testTwd = new TableWrapData();
testTwd.colspan = antLayout.numColumns;
testLabel.setLayoutData(testTwd);
// Build file location
Label antLabel =
toolkit.createLabel(antSectionClient,
EpaxPlugin.getResourceString(ID + ".buildfile"));
Text text = toolkit.createText(antSectionClient, "build.xml");
antSection.setClient(antSectionClient);
}
|
|
|
Re: Checkbox wrapping in forms [message #445749 is a reply to message #445736] |
Wed, 10 November 2004 14:54 |
Steve Northover Messages: 1636 Registered: July 2009 |
Senior Member |
|
|
https://bugs.eclipse.org/bugs/show_bug.cgi?id=13802
"choi" <choi@netlabs.org> wrote in message news:cmshb9$ts0$1@eclipse.org...
> Hi,
>
> does a Button with SWT.CHECK support text wrapping? I'm using it
> in a TableWrapLayout, please see the code snippet below. While
> the labels in the layout wrap just fine, the label of the checkbox
> does not wrap.
>
> Could i probably emulate wrapping behavior for the checkbox by
> combining a checkbox with no text and a label besides it?
>
> thanks,
> choi
>
> -- code snippet --
>
> private void createAntSection() {
> // Create Ant section
> Section antSection =
> createSection(form.getBody(),
> "Ant Build File",
> "Location and settings for the generated Ant file");
> Composite antSectionClient = toolkit.createComposite(antSection);
>
> TableWrapLayout antLayout = new TableWrapLayout();
> antLayout.numColumns = 3;
> antSectionClient.setLayout(antLayout);
>
> // Ant checkbox
> Button genAntCheckbox =
> toolkit.createButton(antSectionClient,
> EpaxPlugin.getResourceString(ID + ".antgen"),
> SWT.CHECK | SWT.WRAP);
> TableWrapData genTwd = new TableWrapData(TableWrapData.FILL);
> genTwd.colspan = antLayout.numColumns;
> genAntCheckbox.setLayoutData(genTwd);
>
> // Wrap test label
> Label testLabel =
> toolkit.createLabel(antSectionClient,
> "asdfasd fsadfsadfsadf jdslfjksadjkfsadjfkasdkfsad asfd s
> fdsda fs daf sadf sadf sad fsad fsadfasdf asdf sad fsad fs adf sadf sdf
> sad",
> SWT.WRAP);
> TableWrapData testTwd = new TableWrapData();
> testTwd.colspan = antLayout.numColumns;
> testLabel.setLayoutData(testTwd);
>
> // Build file location
> Label antLabel =
> toolkit.createLabel(antSectionClient,
> EpaxPlugin.getResourceString(ID + ".buildfile"));
> Text text = toolkit.createText(antSectionClient, "build.xml");
>
> antSection.setClient(antSectionClient);
> }
|
|
|
Powered by
FUDForum. Page generated in 0.26132 seconds