Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT: RTL capability for dialogs(How to mirror a dialog for right-to-left oriented ui?)
SWT: RTL capability for dialogs [message #632754] Thu, 14 October 2010 07:31 Go to next message
McKaot is currently offline McKaotFriend
Messages: 12
Registered: July 2009
Junior Member
I lack a way to flip (mirror) dialogs managed by org.eclipse.swt.widgets.Layout derivates depending on RTL settings (e.g. the SWT.RIGHT_TO_LEFT flag of the managed composite).
Is there a way to handle this?

Regards
Andrew
Re: SWT: RTL capability for dialogs [message #633562 is a reply to message #632754] Mon, 18 October 2010 12:24 Go to previous messageGo to next message
Lakshmi ShanmugamFriend
Messages: 275
Registered: July 2009
Location: India
Senior Member
Hi,
It is not clear to me what you are trying to do. Can you please explain (may be with an example)?


Lakshmi P Shanmugam
Re: SWT: RTL capability for dialogs [message #633632 is a reply to message #633562] Mon, 18 October 2010 14:59 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
Support for mirroring varies by platform, where do you see this? This
should work on Windows >= 2000 and newer GTK+ (actually cairo) versions (I'm
not sure how new they need to be). I think that this partially works on
Cocoa but not fully (re-formatting of text works but co-ordinate
transformations do not).

To determine if mirroring is supported at runtime, create your Control with
SWT.RIGHT_TO_LEFT, then do "control.getStyle() & SWT.MIRRORER". If the
platform support is there then the MIRRORED bit is automatically OR'd into
the Control's style, otherwise it isn't.

I'm not sure if this actually answers your question, if not then please
follow up.

Grant
Re: SWT: RTL capability for dialogs [message #633767 is a reply to message #632754] Tue, 19 October 2010 10:53 Go to previous messageGo to next message
McKaot is currently offline McKaotFriend
Messages: 12
Registered: July 2009
Junior Member
I did not mean the native dialogs - they are handled by the underlying system.
I also did not mean the contents of a single widget, e.g. a Label or StyledText but the content and layout of a dialog.

My idea was that if one already has user interfaces built with SWT, it would(should) be possible to make them fit for languages with right-to-left orientation "just" by mirroring them via the layout class these UIs were tied with.. without to re-implement them!

I could even imagine that instead of doing it within the layouts, this can be handled easier by a static class/method that adapts the layout data, since in most cases it only concerns the widget's coordinates and not the tab order.

Kinda naive?
Andrew
Re: SWT: RTL capability for dialogs [message #634968 is a reply to message #633632] Mon, 25 October 2010 09:41 Go to previous messageGo to next message
McKaot is currently offline McKaotFriend
Messages: 12
Registered: July 2009
Junior Member
I did not mean the native dialogs - they are handled by the underlying system.
I also did not mean the contents of a single widget, e.g. a Label or StyledText but the content and layout of a dialog.

My idea was that if one already has user interfaces built with SWT, it would(should) be possible to make them fit for languages with right-to-left orientation "just" by mirroring them via the layout class these UIs were tied with.. without to re-implement them!

I could even imagine that instead of doing it within the layouts, this can be handled easier by a static class/method that adapts the layout data, since in most cases it only concerns the widget's coordinates and not the tab order.

Kinda naive?
Andrew
Re: SWT: RTL capability for dialogs [message #635070 is a reply to message #634968] Mon, 25 October 2010 14:50 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
The layouts take their orientation from the control they're set on. For
example, starting with
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet172 .java
and changing its Shell creation style to SWT.RIGHT_TO_LEFT | SWT.SHELL_TRIM
gives a right-to-left Shell (trim decorations are switched) with its content
laid out right-to-left by GridLayout. Are you asking whether orientation
can be set on a Layout object independent of the style of the Control it's
set on? If so then no this isn't supported.

If these cases are still not what you had in mind then please follow up.

Grant


"McKaot" <mckaot@freemail.ru> wrote in message
news:ia3j66$h6g$1@news.eclipse.org...
>I did not mean the native dialogs - they are handled by the underlying
>system.
> I also did not mean the contents of a single widget, e.g. a Label or
> StyledText but the content and layout of a dialog.
>
> My idea was that if one already has user interfaces built with SWT, it
> would(should) be possible to make them fit for languages with
> right-to-left orientation "just" by mirroring them via the layout class
> these UIs were tied with.. without to re-implement them!
>
> I could even imagine that instead of doing it within the layouts, this can
> be handled easier by a static class/method that adapts the layout data,
> since in most cases it only concerns the widget's coordinates and not the
> tab order.
>
> Kinda naive?
> Andrew
>
Previous Topic:set proxy for swt browser need user and pass?
Next Topic:any widget for file viewing?
Goto Forum:
  


Current Time: Fri Dec 15 04:46:43 GMT 2017

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

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