diff options
author | Eugene Sandulenko | 2011-02-28 02:30:41 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2011-03-17 17:31:05 +0200 |
commit | 901b5e209743dc5fdee136758956809e7eaf7eda (patch) | |
tree | b0754a1ea2b6b948a9539cf175d77f0822139571 /engines/hugo/dialogs.cpp | |
parent | c8133914550a7ac8bab3761406882bcdfc8347a5 (diff) | |
download | scummvm-rg350-901b5e209743dc5fdee136758956809e7eaf7eda.tar.gz scummvm-rg350-901b5e209743dc5fdee136758956809e7eaf7eda.tar.bz2 scummvm-rg350-901b5e209743dc5fdee136758956809e7eaf7eda.zip |
HUGO: Initial work on user input dialog
Diffstat (limited to 'engines/hugo/dialogs.cpp')
-rw-r--r-- | engines/hugo/dialogs.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/engines/hugo/dialogs.cpp b/engines/hugo/dialogs.cpp index 7bcdea5cb1..5907012fb6 100644 --- a/engines/hugo/dialogs.cpp +++ b/engines/hugo/dialogs.cpp @@ -230,4 +230,24 @@ void TopMenu::handleMouseUp(int x, int y, int button, int clickCount) { Dialog::handleMouseUp(x, y, button, clickCount); } +EntryDialog::EntryDialog(const Common::String &title, const Common::String &buttonLabel, const Common::String &defaultValue) : GUI::Dialog(20, 20, 100, 50) { + new GUI::StaticTextWidget(this, 0, 0, 10, 10, title, Graphics::kTextAlignCenter); + + _text = new GUI::EditTextWidget(this, 0, 0, 50, 10, ""); + _text->setEditString(defaultValue); + + new GUI::ButtonWidget(this, 20, 20, 30, 10, buttonLabel, 0, kCmdButton); +} + +void EntryDialog::handleCommand(GUI::CommandSender *sender, uint32 command, uint32 data) { + switch (command) { + case kCmdButton: + close(); + break; + default: + Dialog::handleCommand(sender, command, data); + } +} + + } // End of namespace Hugo |