From c778d82fb6f972f7bba4e1a1d6606b31574f765f Mon Sep 17 00:00:00 2001 From: Peter Date: Mon, 7 Jan 2013 22:09:53 +0800 Subject: [PATCH] repeat bug --- .../activities/button/ButtonViewGwtImpl.java | 100 ++++++++++-------- 1 file changed, 57 insertions(+), 43 deletions(-) diff --git a/src/main/java/com/googlecode/mgwt/examples/showcase/client/activities/button/ButtonViewGwtImpl.java b/src/main/java/com/googlecode/mgwt/examples/showcase/client/activities/button/ButtonViewGwtImpl.java index 46e5439..a14c36d 100644 --- a/src/main/java/com/googlecode/mgwt/examples/showcase/client/activities/button/ButtonViewGwtImpl.java +++ b/src/main/java/com/googlecode/mgwt/examples/showcase/client/activities/button/ButtonViewGwtImpl.java @@ -16,71 +16,85 @@ import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.HTML; +import com.googlecode.mgwt.dom.client.event.tap.TapEvent; +import com.googlecode.mgwt.dom.client.event.tap.TapHandler; import com.googlecode.mgwt.examples.showcase.client.DetailViewGwtImpl; import com.googlecode.mgwt.ui.client.widget.Button; +import com.googlecode.mgwt.ui.client.widget.MPhoneNumberTextBox; /** * @author Daniel Kurka - * + * */ public class ButtonViewGwtImpl extends DetailViewGwtImpl implements ButtonView { - public ButtonViewGwtImpl() { + final MPhoneNumberTextBox textbox = new MPhoneNumberTextBox(); + + public ButtonViewGwtImpl() { + + FlowPanel content = new FlowPanel(); + content.getElement().getStyle().setMargin(20, Unit.PX); - FlowPanel content = new FlowPanel(); - content.getElement().getStyle().setMargin(20, Unit.PX); + scrollPanel.setScrollingEnabledX(false); - scrollPanel.setScrollingEnabledX(false); + content.add(textbox); - Button normalButton = new Button("Normal"); - content.add(normalButton); + textbox.getElement().setAttribute("style", "height: 32px; width:100%; font-size:x-large;letter-spacing:2px;"); - Button roundButton = new Button("Round"); - roundButton.setRound(true); - content.add(roundButton); + Button normalButton = new Button("Normal"); + content.add(normalButton); + normalButton.addTapHandler(new TapHandler() { - Button smallButton = new Button("Small"); - smallButton.setSmall(true); - content.add(smallButton); + @Override + public void onTap(TapEvent event) { + textbox.setValue(textbox.getValue() + '1'); + } + }); + Button roundButton = new Button("Round"); + roundButton.setRound(true); + content.add(roundButton); - HTML spacer = new HTML(); - spacer.setHeight("100px"); - content.add(spacer); + Button smallButton = new Button("Small"); + smallButton.setSmall(true); + content.add(smallButton); - Button importantButton = new Button("Important"); - importantButton.setImportant(true); - content.add(importantButton); + HTML spacer = new HTML(); + spacer.setHeight("100px"); + content.add(spacer); - Button importantRoundButton = new Button("Round"); - importantRoundButton.setImportant(true); - importantRoundButton.setRound(true); - content.add(importantRoundButton); + Button importantButton = new Button("Important"); + importantButton.setImportant(true); + content.add(importantButton); - Button importantSmallButton = new Button("Small"); - importantSmallButton.setImportant(true); - importantSmallButton.setSmall(true); - content.add(importantSmallButton); + Button importantRoundButton = new Button("Round"); + importantRoundButton.setImportant(true); + importantRoundButton.setRound(true); + content.add(importantRoundButton); - spacer = new HTML(); - spacer.setHeight("100px"); - content.add(spacer); + Button importantSmallButton = new Button("Small"); + importantSmallButton.setImportant(true); + importantSmallButton.setSmall(true); + content.add(importantSmallButton); - Button conmfirmButton = new Button("Confirm"); - conmfirmButton.setConfirm(true); - content.add(conmfirmButton); + spacer = new HTML(); + spacer.setHeight("100px"); + content.add(spacer); - Button confirmRoundButton = new Button("Round"); - confirmRoundButton.setConfirm(true); - confirmRoundButton.setRound(true); - content.add(confirmRoundButton); + Button conmfirmButton = new Button("Confirm"); + conmfirmButton.setConfirm(true); + content.add(conmfirmButton); - Button confirmSmallButton = new Button("Small"); - confirmSmallButton.setConfirm(true); - confirmSmallButton.setSmall(true); - content.add(confirmSmallButton); + Button confirmRoundButton = new Button("Round"); + confirmRoundButton.setConfirm(true); + confirmRoundButton.setRound(true); + content.add(confirmRoundButton); - scrollPanel.setWidget(content); + Button confirmSmallButton = new Button("Small"); + confirmSmallButton.setConfirm(true); + confirmSmallButton.setSmall(true); + content.add(confirmSmallButton); - } + scrollPanel.setWidget(content); + } }