14
14
// See the file "License.txt" for information on usage and redistribution of
15
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
17
// $Id: PopUpWidget.hxx 2579 2013-01-04 19:49:01Z stephena $
17
// $Id: PopUpWidget.hxx 2732 2013-05-09 14:22:34Z stephena $
19
19
// Based on code from ScummVM - Scumm Interpreter
20
20
// Copyright (C) 2002-2004 The ScummVM project
47
47
PopUpWidget(GuiObject* boss, const GUI::Font& font,
48
int x, int y, int w, int h, const StringMap& items,
48
int x, int y, int w, int h, const VariantList& items,
49
49
const string& label, int labelWidth = 0, int cmd = 0);
54
54
/** Various selection methods passed directly to the underlying menu
55
55
See ContextMenu.hxx for more information. */
56
void addItems(const StringMap& items) { myMenu->addItems(items); }
57
void setSelected(int item) { myMenu->setSelected(item); }
58
void setSelected(const string& tag,
59
const string& def) { myMenu->setSelected(tag, def); }
56
void addItems(const VariantList& items) { myMenu->addItems(items); }
57
void setSelected(int item) { myMenu->setSelected(item); }
58
void setSelected(const Variant& tag,
59
const Variant& def = EmptyVariant)
60
{ myMenu->setSelected(tag, def); }
60
61
void setSelectedMax() { myMenu->setSelectedMax(); }
61
62
void clearSelection() { myMenu->clearSelection(); }
63
64
int getSelected() const { return myMenu->getSelected(); }
64
65
const string& getSelectedName() const { return myMenu->getSelectedName(); }
65
const string& getSelectedTag() const { return myMenu->getSelectedTag(); }
66
const Variant& getSelectedTag() const { return myMenu->getSelectedTag(); }
67
68
bool wantsFocus() { return true; }
70
71
void handleMouseDown(int x, int y, int button, int clickCount);
72
void handleMouseWheel(int x, int y, int direction);
71
73
bool handleEvent(Event::Type e);
72
74
void handleCommand(CommandSender* sender, int cmd, int data, int id);
73
75
void drawWidget(bool hilite);