How to use DeckLayoutPanel?

2012-08-22 Thread AgitoM
Been trying to implement a iPhone like transition between widgets for a 
mobile project I'm working on
Basically I need transition from left to right, and from right to left.
Read online that this can be accomplished using a DeckLayoutPanel.

Been trying to get an example to work, but not matter what I try, I I can't 
get any of the DeckLayoutPanel contents to display.
Of the many things I have tried, this is a example:

public class AnimationMainView extends Composite {
private DeckLayoutPanel aPanel = new DeckLayoutPanel();
 public AnimationMainView() {
initWidget(this.aPanel);
this.setSize(100%, 100%);
 this.aPanel.setAnimationDuration(5000);
this.aPanel.setAnimationVertical(false);
 Widget1 w1 = new Widget1(this);
this.aPanel.add(w1);
 Widget2 w2 = new Widget2(this);
this.aPanel.add(w2);
 this.openWidget1();
}
 public void openWidget1() {
this.aPanel.showWidget(0);
}
 public void openWidget2() {
this.aPanel.showWidget(1);
}
}

Does anyone have a working example of a DeckLayoutPanel being used, or can 
someone explain what I am doing wrong?

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/4LWbIAtG_x0J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: How to use DeckLayoutPanel?

2012-08-22 Thread Jens
DeckLayoutPanel implements RequiresResize so you should use ResizeComposite 
to wrap the DeckLayoutPanel. If possible put your custom widget inside 
another layout panel (parent widget). If thats not possible you have to set 
the height of your widget to 100%. If you do so, you have to make sure that 
the parent widget/parent DOM element also has a height defined otherwise a 
height of 100% won't work for your widget.

Maybe you want to take a look at MGWT and GWT-PhoneGap if you are building 
a mobile app.

-- J.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/TufMU1HlpHAJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.