Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Vertical alignment of Text widgets in RAP vs SWT(How to set vertical Text alignment in RAP)
Vertical alignment of Text widgets in RAP vs SWT [message #997458] Mon, 07 January 2013 15:51 Go to next message
John Gymer is currently offline John GymerFriend
Messages: 279
Registered: November 2012
Location: UK
Senior Member
Hello,
Does anyone know how to set the vertical alignment of Text in RAP?
In SWT the default behaviour is to align the text entered with the TOP of the entry field, but in RAP the default behaviour is to vertically CENTRE it in the control. For example:

in SWT it is top-aligned:
index.php/fa/12893/0/

but in RAP it is vertically centered:
index.php/fa/12894/0/

Is it possible to change this alignment:
1) programatically?
2) with STYLE on creation of the Text object?
3) with CSS?

Thanks, John


---
Just because you can doesn't mean you should
Re: Vertical alignment of Text widgets in RAP vs SWT [message #997631 is a reply to message #997458] Tue, 08 January 2013 07:38 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi John,
this is a SINGLE Text widget with a custom height. Just checked with SWT
Controls Demo and you are absolutely right - in SWT it is top aligned,
in RAP - center. Please open a bugzilla about this difference.
Thanks,
Ivan

On 1/7/2013 5:51 PM, John Gymer wrote:
> Hello,
> Does anyone know how to set the vertical alignment of Text in RAP?
> In SWT the default behaviour is to align the text entered with the TOP of the entry field, but in RAP the default behaviour is to vertically CENTRE it in the control. For example:
>
> in SWT it is top-aligned:
>
>
> but in RAP it is vertically centered:
>
>
> Is it possible to change this alignment:
> 1) programatically?
> 2) with STYLE on creation of the Text object?
> 3) with CSS?
>
> Thanks, John
>

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Vertical alignment of Text widgets in RAP vs SWT [message #997632 is a reply to message #997631] Tue, 08 January 2013 09:34 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi,

This behavior is platform-dependent. In GTK it's vertically centered,
see attached screenshot. The cursor is stretched over the entire height
of the widget. I'd say that this is clearly not a useful application for
a single-line text field. Maybe you want to use a Text with SWT.MULTI?

Regards,
Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Vertical alignment of Text widgets in RAP vs SWT [message #1005038 is a reply to message #997632] Thu, 24 January 2013 11:11 Go to previous message
John Gymer is currently offline John GymerFriend
Messages: 279
Registered: November 2012
Location: UK
Senior Member
Have resolved this by placing the Text inside an intermediate Composite and using a GridLayout on the Composite to get the Text at the top of the Composite. Works a treat!


---
Just because you can doesn't mean you should
Previous Topic:RAP focus after shell setVisible
Next Topic:RAP Table adds height of horiz scroll bar
Goto Forum:
  


Current Time: Tue Apr 16 05:33:29 GMT 2024

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

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

Back to the top