Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Browser issue with Composites
Browser issue with Composites [message #507681] Thu, 14 January 2010 06:22 Go to next message
Niels Lippke is currently offline Niels LippkeFriend
Messages: 71
Registered: December 2009
Member
Hi,

in the following snippet I use 2 composites (A+B) which overlay each other.
A has a text field and a label. B is just an empty composite for event
receiving. If you click on the composites, the drawing order is reversed (so
one time A is above B and the other time B above A). Both composites do not
use a background.

While the snippet works as expected on Firefox (3.5) (namely, you cannot
edit the text field while B is above A), is does not on IE (8), where you
can always edit the text field.

Which behaviour is correct? Or what can I do so that this works on all
browsers?
---
final Composite h = new Composite(parent, SWT.NONE);
h.setBackgroundMode(SWT.INHERIT_DEFAULT);

final Composite a = new Composite(h, SWT.NONE);
a.setLayout(new GridLayout(1,false));
final Composite b = new Composite(h, SWT.NONE);
b.setLayout(new GridLayout(1,false));

a.setBackground(null);
a.setBackgroundImage(null);
b.setBackground(null);
b.setBackgroundImage(null);

final Label l = new Label(a, SWT.NONE);
l.setText("Composite A is active");

Text t = new Text(a, SWT.NONE);
t.setText("I'm on composite A. Try to edit me.");

a.moveAbove(b);

h.addControlListener(new ControlAdapter() {
public void controlResized(ControlEvent e) {
a.setBounds(h.getBounds());
b.setBounds(h.getBounds());
}});

a.addMouseListener(new MouseAdapter() {
public void mouseUp(MouseEvent e) {
System.out.println("a clicked");
a.moveBelow(b);
l.setText("Composite B is active");
}});

b.addMouseListener(new MouseAdapter() {
public void mouseUp(MouseEvent e) {
System.out.println("b clicked");
a.moveAbove(b);
l.setText("Composite A is active");
}});



Regards,

Niels
Re: Browser issue with Composites [message #507716 is a reply to message #507681] Thu, 14 January 2010 13:03 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
to find out which behavior is correct, run the snippet in SWT. Apart
from that it looks like a bug. Could you file a bugzilla?

Cheers,
Rüdiger

On 14.01.2010 12:20, Niels Lippke wrote:
> Hi,
>
> in the following snippet I use 2 composites (A+B) which overlay each
> other. A has a text field and a label. B is just an empty composite for
> event receiving. If you click on the composites, the drawing order is
> reversed (so one time A is above B and the other time B above A). Both
> composites do not use a background.
>
> While the snippet works as expected on Firefox (3.5) (namely, you cannot
> edit the text field while B is above A), is does not on IE (8), where
> you can always edit the text field.
>
> Which behaviour is correct? Or what can I do so that this works on all
> browsers?
> ---
> final Composite h = new Composite(parent, SWT.NONE);
> h.setBackgroundMode(SWT.INHERIT_DEFAULT);
>
> final Composite a = new Composite(h, SWT.NONE);
> a.setLayout(new GridLayout(1,false));
> final Composite b = new Composite(h, SWT.NONE);
> b.setLayout(new GridLayout(1,false));
>
> a.setBackground(null);
> a.setBackgroundImage(null);
> b.setBackground(null);
> b.setBackgroundImage(null);
>
> final Label l = new Label(a, SWT.NONE);
> l.setText("Composite A is active");
>
> Text t = new Text(a, SWT.NONE);
> t.setText("I'm on composite A. Try to edit me.");
>
> a.moveAbove(b);
>
> h.addControlListener(new ControlAdapter() {
> public void controlResized(ControlEvent e) {
> a.setBounds(h.getBounds());
> b.setBounds(h.getBounds());
> }});
>
> a.addMouseListener(new MouseAdapter() {
> public void mouseUp(MouseEvent e) {
> System.out.println("a clicked");
> a.moveBelow(b);
> l.setText("Composite B is active");
> }});
>
> b.addMouseListener(new MouseAdapter() {
> public void mouseUp(MouseEvent e) {
> System.out.println("b clicked");
> a.moveAbove(b);
> l.setText("Composite A is active");
> }});
>
>
>
> Regards,
>
> Niels
>
>
Re: Browser issue with Composites [message #507729 is a reply to message #507716] Thu, 14 January 2010 13:45 Go to previous message
Niels Lippke is currently offline Niels LippkeFriend
Messages: 71
Registered: December 2009
Member
in SWT B allways "overdraws" A. At least you cannot edit the text field, if
A is below B...

Neverthless, Bug 299629

Thanks,

Niels

"Rüdiger Herrmann" <rherrmann@eclipsesource.com> schrieb im Newsbeitrag
news:hin4o0$889$1@build.eclipse.org...
> to find out which behavior is correct, run the snippet in SWT. Apart from
> that it looks like a bug. Could you file a bugzilla?
>
> Cheers,
> Rüdiger
>
> On 14.01.2010 12:20, Niels Lippke wrote:
>> Hi,
>>
>> in the following snippet I use 2 composites (A+B) which overlay each
>> other. A has a text field and a label. B is just an empty composite for
>> event receiving. If you click on the composites, the drawing order is
>> reversed (so one time A is above B and the other time B above A). Both
>> composites do not use a background.
>>
>> While the snippet works as expected on Firefox (3.5) (namely, you cannot
>> edit the text field while B is above A), is does not on IE (8), where
>> you can always edit the text field.
>>
>> Which behaviour is correct? Or what can I do so that this works on all
>> browsers?
>> ---
>> final Composite h = new Composite(parent, SWT.NONE);
>> h.setBackgroundMode(SWT.INHERIT_DEFAULT);
>>
>> final Composite a = new Composite(h, SWT.NONE);
>> a.setLayout(new GridLayout(1,false));
>> final Composite b = new Composite(h, SWT.NONE);
>> b.setLayout(new GridLayout(1,false));
>>
>> a.setBackground(null);
>> a.setBackgroundImage(null);
>> b.setBackground(null);
>> b.setBackgroundImage(null);
>>
>> final Label l = new Label(a, SWT.NONE);
>> l.setText("Composite A is active");
>>
>> Text t = new Text(a, SWT.NONE);
>> t.setText("I'm on composite A. Try to edit me.");
>>
>> a.moveAbove(b);
>>
>> h.addControlListener(new ControlAdapter() {
>> public void controlResized(ControlEvent e) {
>> a.setBounds(h.getBounds());
>> b.setBounds(h.getBounds());
>> }});
>>
>> a.addMouseListener(new MouseAdapter() {
>> public void mouseUp(MouseEvent e) {
>> System.out.println("a clicked");
>> a.moveBelow(b);
>> l.setText("Composite B is active");
>> }});
>>
>> b.addMouseListener(new MouseAdapter() {
>> public void mouseUp(MouseEvent e) {
>> System.out.println("b clicked");
>> a.moveAbove(b);
>> l.setText("Composite A is active");
>> }});
>>
>>
>>
>> Regards,
>>
>> Niels
>>
>>
Previous Topic:Eclipse e4 and RAP.
Next Topic:DnD question
Goto Forum:
  


Current Time: Thu Apr 25 12:57:24 GMT 2024

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

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

Back to the top