Community
Participate
Working Groups
When using the SWT.TRANSPARENT style on composites and controls, the right to left orientation has serious problems. Please run the snippet to see how incorrectly the text is mirrored. Also the buttons on the shell doesn't function properly -- they get painted correctly according to RTL, however they still function in a way they were laid out LTR. This issue had very severe repercussions on our product based on 3.4.2, please address this issue promptly. Izzet
Created attachment 152108 [details] The screenshot of the snippet.
Sorry -- I had a wrong statement above about the shell buttons. They are positioned wrongly according to RTL, however function correctly as the buttons were laid out according to RTL.
Where is the snippet ? Please check the java doc for SWT.TRANSPARENT, it says: WARNING: THIS API IS UNDER CONSTRUCTION AND SHOULD NOT BE USED
Created attachment 152215 [details] Snippet Interesting.. I thought I uploaded the snippet :)
I'm aware of the javadoc warning. However using this style was the only solution for our particular case. I'm setting the background of a composite using a paint listener and GC.drawImage (this is a requirement on our side), and not using setBackgroundImage. The only way to make the controls in this composite transparent is then use SWT.TRANSPARENT. I cannot use setBackgroundImage and the regular transparency via Composite.setBackgroundMode(SWT.INHERIT_FORCE). I cannot complain much because of the javadoc warning, but I also wanted to open this bug to ask you finalize the design of this useful SWT.TRANSPARENT, and help you see a bug when using in RTL orientation. I also want to note that, the problem expressed on the first comment doesn't happen in my Ubuntu setup. It only happens in Windows (tried XP.)
Closing as WONT FIX, I'll talk to SSQ to decide what to do about SWT.TRANSPARENT (as far as I know it should work for Shell only). We should fix (at least) the java doc. In your case, the only workaround I can suggest is to use setBackgroundImage() and setBackgroundMode(). To make sure the bottom-right corner of the image is always at the bottom-right corner of the composite you need: -handle SWT.Resize events for the composite --create a new image the size of the client area --draw the background image to the new image with right offset --set the new image in the composite (setBackgroundImage) --dispose the old image (if any)
I'm reopening this defect as an enhancement request to finish implementing the correct behaviour of SWT.TRANSPARENT. As this is a useful style bit, please complete its implementation.
I test in windows7, the TRANSPARENT cannot combine the SWT.Paint event listener. the painter will flicker. just modify the snippet, composite.setLayout(new GridLayout()); composite.addListener(SWT.Paint, new Listener() { @Override public void handleEvent(Event event) { event.gc.drawImage( new Image(...)); } }); the flicker will BOM! If remove the TRANSPARENT bit, the painter works fine.
Silenio, what should we do about SWT.TRANSPARENT ? Changed it work for Shell only ? Or remove/depreacte it ?
I am using Eclipse Indigo Release 2 version.I used SWT.TRANSPARENT for giving tranparent effect to Shell. But the output was different.It hides the Titlebar. Is there any development going on in this direction or should i assign it as a Bug???