~ubuntu-branches/debian/sid/stella/sid

« back to all changes in this revision

Viewing changes to src/gui/PopUpWidget.hxx

  • Committer: Package Import Robot
  • Author(s): Stephen Kitt
  • Date: 2013-06-28 09:53:13 UTC
  • mfrom: (1.3.6)
  • Revision ID: package-import@ubuntu.com-20130628095313-j8jkkgxpvx1t18ym
Tags: 3.9-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.
16
16
//
17
 
// $Id: PopUpWidget.hxx 2579 2013-01-04 19:49:01Z stephena $
 
17
// $Id: PopUpWidget.hxx 2732 2013-05-09 14:22:34Z stephena $
18
18
//
19
19
//   Based on code from ScummVM - Scumm Interpreter
20
20
//   Copyright (C) 2002-2004 The ScummVM project
45
45
{
46
46
  public:
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);
50
50
    ~PopUpWidget();
51
51
 
53
53
 
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();      }
62
63
 
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();  }
66
67
 
67
68
    bool wantsFocus()  { return true; }
68
69
 
69
70
  protected:
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);