Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Checkbox wrapping in forms
Checkbox wrapping in forms [message #445736] Wed, 10 November 2004 07:53 Go to next message
choi is currently offline choiFriend
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 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
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);
> }
Previous Topic:Set Keyboard cursor position in Combo
Next Topic:AWT events -> SWT refresh
Goto Forum:
  


Current Time: Sun Nov 29 00:11:36 GMT 2020

Powered by FUDForum. Page generated in 0.01745 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top