|
|
Re: Vertical alignment in label; Preferred size of label [message #458273 is a reply to message #458268] |
Tue, 12 July 2005 15:01 |
Eclipse User |
|
|
|
Originally posted by: jacob.arun.gmail.com
Hi
By vertical alignment, I meant th alignment of text inside the label,
instead of alignment of the label within its parent.
As attched in this (label_buttons.jpg), I have 4 labels, which I use as
buttons as SWT button foreground and background cannot be customised. The
problem is that the text in one 1 of the 4 labels wraps. Due tp the layout
the height of all 4 lbels also double. But the text in the labels with
non-wrapping text does not align centrally vertically.
Thanks in advance
Arun
"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:db0j9g$d0d$1@news.eclipse.org...
> Believe it or not, aligning a label vertically is not supported on all
> operating systems. If you want to do this in SWT, align the label in it's
> parent using a layout or by calling setBounds() on the label when the
parent
> is resized.
>
> If you want to set the bounds of any control, including labels, use
> setBounds(). Note that when a control is a child of a composite that
> includes a layout, the layout will almost certainly override and
setBounds()
> call that you make as part of the layout algorithm.
>
> Hope this helps.
>
> "Arun" <jacob.arun@gmail.com> wrote in message
> news:2cf406068266d2b959efe1b46b0bf5df$1@www.eclipse.org...
> > Hi
> >
> > I am trying to get text aligned vertically on a label.
> > But not able to find any option for this.
> >
> > I also want to set an aolsute height for the label.
> > Currently the label height is the same as that of the text within it.
> > have tried invoking label.setpreferredHeight(), but does not seem to
work.
> >
> > Any pointers are appreciated.
> > Thanks in advance
> >
> > Arun
> >
>
>
|
|
|
Re: Vertical alignment in label; Preferred size of label [message #458520 is a reply to message #458273] |
Thu, 14 July 2005 13:41 |
Steve Northover Messages: 1636 Registered: July 2009 |
Senior Member |
|
|
You will need to provide code.
"Arun Jacob" <jacob.arun@gmail.com> wrote in message
news:db0m1e$h6b$1@news.eclipse.org...
> Hi
>
> By vertical alignment, I meant th alignment of text inside the label,
> instead of alignment of the label within its parent.
>
> As attched in this (label_buttons.jpg), I have 4 labels, which I use as
> buttons as SWT button foreground and background cannot be customised. The
> problem is that the text in one 1 of the 4 labels wraps. Due tp the layout
> the height of all 4 lbels also double. But the text in the labels with
> non-wrapping text does not align centrally vertically.
>
>
> Thanks in advance
> Arun
>
>
> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> news:db0j9g$d0d$1@news.eclipse.org...
> > Believe it or not, aligning a label vertically is not supported on all
> > operating systems. If you want to do this in SWT, align the label in
it's
> > parent using a layout or by calling setBounds() on the label when the
> parent
> > is resized.
> >
> > If you want to set the bounds of any control, including labels, use
> > setBounds(). Note that when a control is a child of a composite that
> > includes a layout, the layout will almost certainly override and
> setBounds()
> > call that you make as part of the layout algorithm.
> >
> > Hope this helps.
> >
> > "Arun" <jacob.arun@gmail.com> wrote in message
> > news:2cf406068266d2b959efe1b46b0bf5df$1@www.eclipse.org...
> > > Hi
> > >
> > > I am trying to get text aligned vertically on a label.
> > > But not able to find any option for this.
> > >
> > > I also want to set an aolsute height for the label.
> > > Currently the label height is the same as that of the text within it.
> > > have tried invoking label.setpreferredHeight(), but does not seem to
> work.
> > >
> > > Any pointers are appreciated.
> > > Thanks in advance
> > >
> > > Arun
> > >
> >
> >
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05749 seconds