clickCount) override;
	void handleMouseWheel(int x, int y, int direction) override;

	void appendEntry(const U32String &entry, uint32 tag = (uint32)-1);
	void appendEntry(const String &entry, uint32 tag = (uint32)-1);
	void clearEntries();
	int numEntries() { return _entries.size(); }

	/** Select the entry at the given index. */
	void setSelected(int item);

	/** Select the first entry matching the given tag. */
	void setSelectedTag(uint32 tag);

	int getSelected() const						{ return _selectedItem; }
	uint32 getSelectedTag() const				{ return (_selectedItem >= 0) ? _entries[_selectedItem].tag : (uint32)-1; }
//	const String& getSelectedString() const		{ return (_selectedItem >= 0) ? _entries[_selectedItem].name : String::emptyString; }

	void handleMouseEntered(int button) override	{ if (_selectedItem != -1) read(_entries[_selectedItem].name); setFlags(WIDGET_HILITED); markAsDirty(); }
	void handleMouseLeft(int button) override	{ clearFlags(WIDGET_HILITED); markAsDirty(); }

	void reflowLayout() override;
protected:
	void drawWidget() override;
};

/**
 * A small dialog showing a list of items and allowing the user to chose one of them
 *
 * Used by PopUpWidget and DropdownButtonWidget.
 */
class PopUpDialog : public Dialog {
protected:
	Widget		*_boss;
	int			_clickX, _clickY;
	int			_selection;
	int			_initialSelection;
	uint32		_openTime;
	bool		_twoColumns;
	int			_entriesPerColumn;

	int			_leftPadding;
	int			_rightPadding;
	int			_lineHeight;

	int			_lastRead;

	typedef Common::Array<Common::U32String> EntryList;
	EntryList		_entries;

public:
	PopUpDialog(Widget *boss, const Common::String &name, int clickX, int clickY);

	void open() override;
	void reflowLayout() override;
	void drawDialog(DrawLayer layerToDraw) override;

	void handleMouseUp(int x, int y, int button, int clickCount) override;
	void handleMouseWheel(int x, int y, int direction) override;	// Scroll through entries with scroll wheel
	void handleMouseMoved(int x, int y, int button) override;	// Redraw selections depending on mouse posit