Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » TextBoxes
TextBoxes [message #279548] Wed, 19 January 2005 11:56 Go to next message
Eclipse UserFriend
I want to create a textbox in a group that spans 4 rows. I have tried many
things, but I can't get the text box to be more than one row high.

Here is how I'm creating the box:

group = new Group(composite, SWT.NONE);
group.setText(groupTitle);
layout = new GridLayout();
layout.horizontalSpacing = 15;
layout.numColumns = 1;
group.setLayout(layout);
gridData = new GridData(GridData.FILL_BOTH |
GridData.VERTICAL_ALIGN_CENTER);
gridData.verticalSpan = 4;
group.setLayoutData(gridData);

text = new Text(group, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
gridData = new GridData(GridData.FILL_BOTH);
gridData.verticalSpan = 4;
text.setLayoutData(gridData);

What am I doing wrong?
Re: TextBoxes [message #279565 is a reply to message #279548] Wed, 19 January 2005 17:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Chris_Laffra.ca.ibm.com

If your layout has one column, how can you tell you are not occupying 4
rows?

--
Chris Laffra, http://eclipsefaq.org


"Shawn L. Pecze" <pecze@us.ibm.com> wrote in message
news:csm3g7$lmj$1@www.eclipse.org...
> I want to create a textbox in a group that spans 4 rows. I have tried
many
> things, but I can't get the text box to be more than one row high.
>
> Here is how I'm creating the box:
>
> group = new Group(composite, SWT.NONE);
> group.setText(groupTitle);
> layout = new GridLayout();
> layout.horizontalSpacing = 15;
> layout.numColumns = 1;
> group.setLayout(layout);
> gridData = new GridData(GridData.FILL_BOTH |
> GridData.VERTICAL_ALIGN_CENTER);
> gridData.verticalSpan = 4;
> group.setLayoutData(gridData);
>
> text = new Text(group, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
> gridData = new GridData(GridData.FILL_BOTH);
> gridData.verticalSpan = 4;
> text.setLayoutData(gridData);
>
> What am I doing wrong?
>
>
Re: TextBoxes [message #279623 is a reply to message #279565] Thu, 20 January 2005 15:01 Go to previous messageGo to next message
Eclipse UserFriend
When the dialog is displayed, the text box only has enough room to display
one line of text. I would like to be able to display 4 lines of text before
the user would have to start scrolling.

"Chris Laffra" <Chris_Laffra@ca.ibm.com> wrote in message
news:csmoe2$8u7$1@www.eclipse.org...
> If your layout has one column, how can you tell you are not occupying 4
> rows?
>
> --
> Chris Laffra, http://eclipsefaq.org
>
>
> "Shawn L. Pecze" <pecze@us.ibm.com> wrote in message
> news:csm3g7$lmj$1@www.eclipse.org...
> > I want to create a textbox in a group that spans 4 rows. I have tried
> many
> > things, but I can't get the text box to be more than one row high.
> >
> > Here is how I'm creating the box:
> >
> > group = new Group(composite, SWT.NONE);
> > group.setText(groupTitle);
> > layout = new GridLayout();
> > layout.horizontalSpacing = 15;
> > layout.numColumns = 1;
> > group.setLayout(layout);
> > gridData = new GridData(GridData.FILL_BOTH |
> > GridData.VERTICAL_ALIGN_CENTER);
> > gridData.verticalSpan = 4;
> > group.setLayoutData(gridData);
> >
> > text = new Text(group, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
> > gridData = new GridData(GridData.FILL_BOTH);
> > gridData.verticalSpan = 4;
> > text.setLayoutData(gridData);
> >
> > What am I doing wrong?
> >
> >
>
>
Re: TextBoxes [message #279641 is a reply to message #279623] Thu, 20 January 2005 20:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Chris_Laffra.ca.ibm.com

Ahh. You have to tell your text to occupy 4 lines, not the enclosing layout.

--
Chris Laffra, http://eclipsefaq.org


"Shawn L. Pecze" <pecze@us.ibm.com> wrote in message
news:csp2mq$mb5$1@www.eclipse.org...
> When the dialog is displayed, the text box only has enough room to display
> one line of text. I would like to be able to display 4 lines of text
before
> the user would have to start scrolling.
>
> "Chris Laffra" <Chris_Laffra@ca.ibm.com> wrote in message
> news:csmoe2$8u7$1@www.eclipse.org...
> > If your layout has one column, how can you tell you are not occupying 4
> > rows?
> >
> > --
> > Chris Laffra, http://eclipsefaq.org
> >
> >
> > "Shawn L. Pecze" <pecze@us.ibm.com> wrote in message
> > news:csm3g7$lmj$1@www.eclipse.org...
> > > I want to create a textbox in a group that spans 4 rows. I have tried
> > many
> > > things, but I can't get the text box to be more than one row high.
> > >
> > > Here is how I'm creating the box:
> > >
> > > group = new Group(composite, SWT.NONE);
> > > group.setText(groupTitle);
> > > layout = new GridLayout();
> > > layout.horizontalSpacing = 15;
> > > layout.numColumns = 1;
> > > group.setLayout(layout);
> > > gridData = new GridData(GridData.FILL_BOTH |
> > > GridData.VERTICAL_ALIGN_CENTER);
> > > gridData.verticalSpan = 4;
> > > group.setLayoutData(gridData);
> > >
> > > text = new Text(group, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
> > > gridData = new GridData(GridData.FILL_BOTH);
> > > gridData.verticalSpan = 4;
> > > text.setLayoutData(gridData);
> > >
> > > What am I doing wrong?
> > >
> > >
> >
> >
>
>
Re: TextBoxes [message #279696 is a reply to message #279641] Fri, 21 January 2005 12:39 Go to previous messageGo to next message
Eclipse UserFriend
How do I tell the text to occumpy 4 lines? I thought I was doing that by
creating a GridData object and setting the vertical span to 4 and then
setting the layout data of the text box to this GridData object.

"Chris Laffra" <Chris_Laffra@ca.ibm.com> wrote in message
news:cspl1d$tqv$1@www.eclipse.org...
> Ahh. You have to tell your text to occupy 4 lines, not the enclosing
layout.
>
> --
> Chris Laffra, http://eclipsefaq.org
>
>
> "Shawn L. Pecze" <pecze@us.ibm.com> wrote in message
> news:csp2mq$mb5$1@www.eclipse.org...
> > When the dialog is displayed, the text box only has enough room to
display
> > one line of text. I would like to be able to display 4 lines of text
> before
> > the user would have to start scrolling.
> >
> > "Chris Laffra" <Chris_Laffra@ca.ibm.com> wrote in message
> > news:csmoe2$8u7$1@www.eclipse.org...
> > > If your layout has one column, how can you tell you are not occupying
4
> > > rows?
> > >
> > > --
> > > Chris Laffra, http://eclipsefaq.org
> > >
> > >
> > > "Shawn L. Pecze" <pecze@us.ibm.com> wrote in message
> > > news:csm3g7$lmj$1@www.eclipse.org...
> > > > I want to create a textbox in a group that spans 4 rows. I have
tried
> > > many
> > > > things, but I can't get the text box to be more than one row high.
> > > >
> > > > Here is how I'm creating the box:
> > > >
> > > > group = new Group(composite, SWT.NONE);
> > > > group.setText(groupTitle);
> > > > layout = new GridLayout();
> > > > layout.horizontalSpacing = 15;
> > > > layout.numColumns = 1;
> > > > group.setLayout(layout);
> > > > gridData = new GridData(GridData.FILL_BOTH |
> > > > GridData.VERTICAL_ALIGN_CENTER);
> > > > gridData.verticalSpan = 4;
> > > > group.setLayoutData(gridData);
> > > >
> > > > text = new Text(group, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
> > > > gridData = new GridData(GridData.FILL_BOTH);
> > > > gridData.verticalSpan = 4;
> > > > text.setLayoutData(gridData);
> > > >
> > > > What am I doing wrong?
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: TextBoxes [message #279707 is a reply to message #279696] Fri, 21 January 2005 16:33 Go to previous message
Eclipse UserFriend
Originally posted by: Chris_Laffra.ca.ibm.com

Something like this should work:

int lineHeight = text.getLineHeight();
gridData.heightHint = 4*lineHeight;
text.setLayoutData(gridData);

--
Chris Laffra, http://eclipsefaq.org


"Shawn L. Pecze" <pecze@us.ibm.com> wrote in message
news:csreo5$81f$1@www.eclipse.org...
> How do I tell the text to occumpy 4 lines? I thought I was doing that by
> creating a GridData object and setting the vertical span to 4 and then
> setting the layout data of the text box to this GridData object.
>
> "Chris Laffra" <Chris_Laffra@ca.ibm.com> wrote in message
> news:cspl1d$tqv$1@www.eclipse.org...
> > Ahh. You have to tell your text to occupy 4 lines, not the enclosing
> layout.
> >
> > --
> > Chris Laffra, http://eclipsefaq.org
> >
> >
> > "Shawn L. Pecze" <pecze@us.ibm.com> wrote in message
> > news:csp2mq$mb5$1@www.eclipse.org...
> > > When the dialog is displayed, the text box only has enough room to
> display
> > > one line of text. I would like to be able to display 4 lines of text
> > before
> > > the user would have to start scrolling.
> > >
> > > "Chris Laffra" <Chris_Laffra@ca.ibm.com> wrote in message
> > > news:csmoe2$8u7$1@www.eclipse.org...
> > > > If your layout has one column, how can you tell you are not
occupying
> 4
> > > > rows?
> > > >
> > > > --
> > > > Chris Laffra, http://eclipsefaq.org
> > > >
> > > >
> > > > "Shawn L. Pecze" <pecze@us.ibm.com> wrote in message
> > > > news:csm3g7$lmj$1@www.eclipse.org...
> > > > > I want to create a textbox in a group that spans 4 rows. I have
> tried
> > > > many
> > > > > things, but I can't get the text box to be more than one row high.
> > > > >
> > > > > Here is how I'm creating the box:
> > > > >
> > > > > group = new Group(composite, SWT.NONE);
> > > > > group.setText(groupTitle);
> > > > > layout = new GridLayout();
> > > > > layout.horizontalSpacing = 15;
> > > > > layout.numColumns = 1;
> > > > > group.setLayout(layout);
> > > > > gridData = new GridData(GridData.FILL_BOTH |
> > > > > GridData.VERTICAL_ALIGN_CENTER);
> > > > > gridData.verticalSpan = 4;
> > > > > group.setLayoutData(gridData);
> > > > >
> > > > > text = new Text(group, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
> > > > > gridData = new GridData(GridData.FILL_BOTH);
> > > > > gridData.verticalSpan = 4;
> > > > > text.setLayoutData(gridData);
> > > > >
> > > > > What am I doing wrong?
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Previous Topic:CVS: bad auth protocol end
Next Topic:How to launch the Eclipse Help browser
Goto Forum:
  


Current Time: Sun Nov 09 13:54:21 EST 2025

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

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

Back to the top