Fade for SplitLayoutPanel doesn't work

13 views
Skip to first unread message

Ahmed Ashour

unread,
Aug 4, 2010, 6:48:03 AM8/4/10
to GWT-FX
Hi all,

It seems that Fade doesn't work for SplitLayoutPanel.

Any idea why?


public void onModuleLoad() {
final SplitLayoutPanel panel = new SplitLayoutPanel();

Button fadeButton = new Button("Fade Me");
panel.add(fadeButton);
RootLayoutPanel.get().add(panel);

final Fade theFade = new Fade(panel.getElement());
fadeButton.addClickHandler(new ClickHandler() {

public void onClick(ClickEvent event) {
theFade.play();
}
});
}

Vova

unread,
Aug 4, 2010, 12:40:37 PM8/4/10
to GWT-FX
public void onModuleLoad()
{
final SplitLayoutPanel panel = new SplitLayoutPanel();

Button fadeButton = new Button("Fade Me");
panel.add(fadeButton);
RootLayoutPanel.get().add(panel);


final Fade theFade = new Fade(panel.getElement());

/*********!!!!!!!!!!!!!!!!!!!!!!!!!**************/
theFade.play();
/*********!!!!!!!!!!!!!!!!!!!!!!!!!**************/

fadeButton.addClickHandler(new ClickHandler() {

public void onClick(ClickEvent event) {
Window.alert("I am not work in click
handler!! All effects not work in handler's! "
+
"See my post on
http://groups.google.com/group/gwt-fx/browse_thread/thread/7bc7b4ed66b8cc5
!");
}
});

Adam T

unread,
Aug 4, 2010, 1:51:19 PM8/4/10
to GWT-FX
Hi Ahmed,

Do you have some details of what your using, GWT version, OS, gwt-fx
version etc.

Your above code works fine for me on Mac with Safari, Chrome, Firefox
etc based on GWT 2.1 M2 using gwt-fx from the trunk. Is it just a
problem with SplitPanel, or do you see it on any widget you use?

If it is IE8 then maybe adding the following to your
application's .gwt.xml file might help (if so, please let me know and
I can update the trunk with this and stick the code in gwt-
fx's .gwt.xml file (essentially, SplitPanel means you have to use
standard's mode, and that is stricter on how to write filters in IE8;
EffectImplementationIE8.java contains this, but I see I missed the
part below that tells the compiler to use this if it is IE8)):

<replace-with
class="org.adamtacy.client.ui.effects.impl.browsers.EffectImplementationIE8">
<when-type-is
class="org.adamtacy.client.ui.effects.impl.browsers.EffectImplementationStandard"/
>
<any>
<when-property-is name="user.agent" value="ie8"/>
</any>
</replace-with>

//A

Ahmed Ashour

unread,
Aug 4, 2010, 2:10:47 PM8/4/10
to gwt...@googlegroups.com
Hi Adam,

I am using GWT 2.1.0 M2, GWT FX v0.5.0 MS 1.jar, Windows XP and IE8

Putting the suggested <replace-with'> as a child of <module> doesn't have an effect.

It seems to not work also in other Panels, e.g.:

    public void onModuleLoad() {
        TabLayoutPanel panel = new TabLayoutPanel(1.5, Unit.EM);


        Button fadeButton = new Button("Fade Me");
        panel.add(fadeButton, "That!");

        RootLayoutPanel.get().add(panel);

        final Fade theFade = new Fade(panel.getElement());
        fadeButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                theFade.play();
            }
        });
    }

Yours,
Ahmed
----
Blog: http://asashour.blogspot.com

From: Adam T <adam...@gmail.com>
To: GWT-FX <gwt...@googlegroups.com>
Sent: Wed, August 4, 2010 8:51:19 PM
Subject: Re: Fade for SplitLayoutPanel doesn't work

Adam T

unread,
Aug 4, 2010, 3:03:49 PM8/4/10
to GWT-FX
ok, thanks. I don't have IE so am a bit blind now. Maybe you
wouldn't mind trying the following instead and let me know if you get
50% opacity on the button?


import com.google.gwt.dom.client.Style;

pubic class WhateverYou'veCalledYourClass implements EntryPoint{

static public class StyleGWTFX extends Style{

static boolean filterAdded = false;

protected StyleGWTFX(){};

public void setAlpha(int val){
if(filterAdded)changeAlphaImpl(val);
else{
setAlphaImpl(val);
filterAdded = true;
}
}

final public native void setAlphaImpl(int val)/*-{
this.filter += "DXImageTransform.Microsoft.Alpha(opacity = "+val
+")";
}-*/;

final public native void changeAlphaImpl(int val)/*-{
this.filters.item("DXImageTransform.Microsoft.Alpha").opacity =
val;
}-*/;
}

public void onModuleLoad() {
Button fadeButton = new Button("Fade Me");
RootLayoutPanel.get().add(fadeButton);

((StyleGWTFX)fadeButton.getElement().getStyle()).setAlpha(50);
}
}

Seems you can't set IE8 filter in GWT as it starts with a '-' and GWT
will kick that out; the above is aimed at getting around that.........

Thanks,

Adam


On 4 Aug, 20:10, Ahmed Ashour <asash...@yahoo.com> wrote:
> Hi Adam,
>
> I am using GWT 2.1.0 M2, GWT FX v0.5.0 MS 1.jar, Windows XP and IE8
>
> Putting the suggested <replace-with'> as a child of <module> doesn't have an
> effect.
>
> It seems to not work also in other Panels, e.g.:
>
>     public void onModuleLoad() {
>         TabLayoutPanel panel = new TabLayoutPanel(1.5, Unit.EM);
>
>         Button fadeButton = new Button("Fade Me");
>         panel.add(fadeButton, "That!");
>         RootLayoutPanel.get().add(panel);
>
>         final Fade theFade = new Fade(panel.getElement());
>         fadeButton.addClickHandler(new ClickHandler() {
>
>             public void onClick(ClickEvent event) {
>                 theFade.play();
>             }
>         });
>     }
>
> Yours,
> Ahmed
> ----
> Blog:http://asashour.blogspot.com
>
> ________________________________
> From: Adam T <adam.t...@gmail.com>
> To: GWT-FX <gwt...@googlegroups.com>
> Sent: Wed, August 4, 2010 8:51:19 PM
> Subject: Re: Fade for SplitLayoutPanel doesn't work
>
> Hi Ahmed,
>
> Do you have some details of what your using, GWT version, OS, gwt-fx
> version etc.
>
> Your above code works fine for me on Mac with Safari, Chrome, Firefox
> etc based on GWT 2.1 M2 using gwt-fx from the trunk.  Is it just a
> problem with SplitPanel, or do you see it on any widget you use?
>
> If it is IE8 then maybe adding the following to your
> application's .gwt.xml file might help (if so, please let me know and
> I can update the trunk with this and stick the code in gwt-
> fx's .gwt.xml file (essentially, SplitPanel means you have to use
> standard's mode, and that is stricter on how to write filters in IE8;
> EffectImplementationIE8.java contains this, but I see I missed the
> part below that tells the compiler to use this if it is IE8)):
>
>     <replace-with
> class="org.adamtacy.client.ui.effects.impl.browsers.EffectImplementationIE8 ">
>         <when-type-is
> class="org.adamtacy.client.ui.effects.impl.browsers.EffectImplementationSta ndard"/
Reply all
Reply to author
Forward
0 new messages