01: package com.xoetrope.carousel.testpilot;
02:
03: import net.xoetrope.swing.XButton;
04: import net.xoetrope.swing.XDialog;
05: import net.xoetrope.swing.XEdit;
06:
07: /**
08: * Support for ???
09: * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
10: * the GNU Public License (GPL), please see license.txt for more details. If
11: * you make commercial use of this software you must purchase a commercial
12: * license from Xoetrope.</p>
13: * <p> $Revision: 1.2 $</p>
14: */
15: public class Pause extends XDialog {
16: XButton btnOK, btnCancel;
17: XEdit txtTime;
18:
19: public Pause(boolean enabled) {
20: super (enabled, 2);
21: setSize(200, 150);
22: setLocation(10, 50);
23:
24: pageHelper.componentFactory
25: .addComponent(LABEL, 5, 5, 190, 60,
26: "Please enter the number of milliseconds you wish to pause for!");
27: txtTime = (XEdit) pageHelper.componentFactory.addComponent(
28: EDIT, 80, 70, 40, 20, "200");
29: btnOK = (XButton) pageHelper.componentFactory.addComponent(
30: BUTTON, 40, 100, 50, 20, "OK");
31: btnCancel = (XButton) pageHelper.componentFactory.addComponent(
32: BUTTON, 110, 100, 50, 20, "Cancel");
33:
34: getEventHandler().addHandler(this , btnCancel, "ActionHandler",
35: "doCancel");
36: getEventHandler().addHandler(this , btnOK, "ActionHandler",
37: "doOK");
38: }
39:
40: public void doOK() {
41: if (wasMouseClicked()) {
42: returnValue = 1;
43: returnObject = txtTime.getText();
44: this .closeDlg();
45: }
46: }
47:
48: public void doCancel() {
49: if (wasMouseClicked()) {
50: returnValue = 0;
51: this.closeDlg();
52: }
53: }
54:
55: }
|