diff options
Diffstat (limited to 'NET/worlds/scape/ItemNotAvailableDialog.java')
| -rw-r--r-- | NET/worlds/scape/ItemNotAvailableDialog.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/NET/worlds/scape/ItemNotAvailableDialog.java b/NET/worlds/scape/ItemNotAvailableDialog.java new file mode 100644 index 0000000..c70268f --- /dev/null +++ b/NET/worlds/scape/ItemNotAvailableDialog.java @@ -0,0 +1,42 @@ +package NET.worlds.scape; + +import NET.worlds.console.Console; +import NET.worlds.console.DialogReceiver; +import NET.worlds.console.ImageButtons; +import NET.worlds.console.ImageButtonsCallback; +import NET.worlds.console.PolledDialog; +import java.awt.Component; +import java.awt.Rectangle; +import java.awt.Window; + +public class ItemNotAvailableDialog extends PolledDialog implements ImageButtonsCallback { + private ImageButtons ib; + + public ItemNotAvailableDialog(Window parent, DialogReceiver receiver) { + super(parent, receiver, Console.message("Not-Available"), false); + this.setAlignment(1); + Rectangle[] rects = new Rectangle[]{new Rectangle(101, 22, 48, 19)}; + this.ib = new ImageButtons(Console.message("notavail.gif"), rects, this); + this.ready(); + } + + @Override + protected void build() { + this.add("Center", this.ib); + } + + @Override + public Object imageButtonsCallback(Component who, int which) { + this.done(false); + return null; + } + + @Override + public boolean keyDown(java.awt.Event event, int key) { + if (key == 27) { + return this.done(false); + } else { + return key == 10 ? this.done(false) : super.keyDown(event, key); + } + } +} |