Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to align verticaly text into a Label ?
How to align verticaly text into a Label ? [message #448096] Sat, 01 January 2005 12:59 Go to next message
jmi is currently offline jmiFriend
Messages: 84
Registered: July 2009
Member
Hi,

Is there a way to vertical align text into a Label widget like vertical
align of a Text widget ? In fact, i would like to develop a Composite with
a Text widget in edit mode and a Label widget for read only mode. I want
this for a disabled Text (and later Combo) which is not Gray on gray
(background and foreground) I've done it easily, the problem is that the
Label text is align upper left when i put a Border to the Label -> huggly.

A solution ?

Thanks

JMi
Re: How to align verticaly text into a Label ? [message #448097 is a reply to message #448096] Sat, 01 January 2005 13:01 Go to previous messageGo to next message
jmi is currently offline jmiFriend
Messages: 84
Registered: July 2009
Member
Of course, the text is shown horizontaly but there it is vertical centered
into the widget...


"JM Delsaux" <JMDelsaux@skynet.be> wrote in message
news:cr66sd$5ec$1@www.eclipse.org...
> Hi,
>
> Is there a way to vertical align text into a Label widget like vertical
> align of a Text widget ? In fact, i would like to develop a Composite
> with a Text widget in edit mode and a Label widget for read only mode. I
> want this for a disabled Text (and later Combo) which is not Gray on gray
> (background and foreground) I've done it easily, the problem is that the
> Label text is align upper left when i put a Border to the Label -> huggly.
>
> A solution ?
>
> Thanks
>
> JMi
>
Re: How to align verticaly text into a Label ? [message #448167 is a reply to message #448096] Tue, 04 January 2005 17:52 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Why not always use a Text control and use Text.setEditable()?

"JM Delsaux" <JMDelsaux@skynet.be> wrote in message
news:cr66sd$5ec$1@www.eclipse.org...
> Hi,
>
> Is there a way to vertical align text into a Label widget like vertical
> align of a Text widget ? In fact, i would like to develop a Composite
with
> a Text widget in edit mode and a Label widget for read only mode. I want
> this for a disabled Text (and later Combo) which is not Gray on gray
> (background and foreground) I've done it easily, the problem is that the
> Label text is align upper left when i put a Border to the Label -> huggly.
>
> A solution ?
>
> Thanks
>
> JMi
>
>
Re: How to align verticaly text into a Label ? [message #448173 is a reply to message #448167] Tue, 04 January 2005 19:50 Go to previous messageGo to next message
jmi is currently offline jmiFriend
Messages: 84
Registered: July 2009
Member
Because it can always have the focus when you use the TAB key. I would like
to have the possibility to disable some fields when i edit some other AND
they have to be readable... but when there are grayed, it is unreadable for
old people ;-))

I'vr tried the next code but it seems to loop:

m_textCtl.addFocusListener(new FocusAdapter() {
public void focusGained(final FocusEvent argE) {
if(!m_textCtl.getEditable()) {
m_textCtl.traverse(SWT.TRAVERSE_TAB_NEXT);
}
}

public void focusLost(final FocusEvent argE) {
}
});


Thanks


"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:crel5v$u9l$1@www.eclipse.org...
> Why not always use a Text control and use Text.setEditable()?
>
> "JM Delsaux" <JMDelsaux@skynet.be> wrote in message
> news:cr66sd$5ec$1@www.eclipse.org...
>> Hi,
>>
>> Is there a way to vertical align text into a Label widget like vertical
>> align of a Text widget ? In fact, i would like to develop a Composite
> with
>> a Text widget in edit mode and a Label widget for read only mode. I want
>> this for a disabled Text (and later Combo) which is not Gray on gray
>> (background and foreground) I've done it easily, the problem is that
>> the
>> Label text is align upper left when i put a Border to the Label ->
>> huggly.
>>
>> A solution ?
>>
>> Thanks
>>
>> JMi
>>
>>
>
>
Re: How to align verticaly text into a Label ? [message #448191 is a reply to message #448173] Wed, 05 January 2005 14:54 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Just let them tab into it. If not, you can vertically align the label
within a composite using code or a layout. Verital alignment of labels is
not supported natively on all platforms so we couldn't offer API to do it in
Label.

"JM Delsaux" <JMDelsaux@skynet.be> wrote in message
news:cres2e$m6a$1@www.eclipse.org...
> Because it can always have the focus when you use the TAB key. I would
like
> to have the possibility to disable some fields when i edit some other AND
> they have to be readable... but when there are grayed, it is unreadable
for
> old people ;-))
>
> I'vr tried the next code but it seems to loop:
>
> m_textCtl.addFocusListener(new FocusAdapter() {
> public void focusGained(final FocusEvent argE) {
> if(!m_textCtl.getEditable()) {
> m_textCtl.traverse(SWT.TRAVERSE_TAB_NEXT);
> }
> }
>
> public void focusLost(final FocusEvent argE) {
> }
> });
>
>
> Thanks
>
>
> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> news:crel5v$u9l$1@www.eclipse.org...
> > Why not always use a Text control and use Text.setEditable()?
> >
> > "JM Delsaux" <JMDelsaux@skynet.be> wrote in message
> > news:cr66sd$5ec$1@www.eclipse.org...
> >> Hi,
> >>
> >> Is there a way to vertical align text into a Label widget like vertical
> >> align of a Text widget ? In fact, i would like to develop a Composite
> > with
> >> a Text widget in edit mode and a Label widget for read only mode. I
want
> >> this for a disabled Text (and later Combo) which is not Gray on gray
> >> (background and foreground) I've done it easily, the problem is that
> >> the
> >> Label text is align upper left when i put a Border to the Label ->
> >> huggly.
> >>
> >> A solution ?
> >>
> >> Thanks
> >>
> >> JMi
> >>
> >>
> >
> >
>
>
Previous Topic:plugin hyrarchy
Next Topic:Multi-threaded and org.eclipse.widgets.Display
Goto Forum:
  


Current Time: Thu Apr 25 16:08:17 GMT 2024

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

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

Back to the top