diff options
Diffstat (limited to 'gui/ListWidget.h')
-rw-r--r-- | gui/ListWidget.h | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/gui/ListWidget.h b/gui/ListWidget.h index 203cd88fb6..23c12a38fc 100644 --- a/gui/ListWidget.h +++ b/gui/ListWidget.h @@ -28,6 +28,8 @@ #include "gui/editable.h" #include "common/str.h" +#include "gui/ThemeEngine.h" + namespace GUI { class ScrollBarWidget; @@ -51,9 +53,11 @@ class ListWidget : public EditableWidget { public: typedef Common::String String; typedef Common::StringList StringList; + typedef Common::Array<ThemeEngine::FontColor> ColorList; protected: StringList _list; StringList _dataList; + ColorList _listColors; Common::Array<int> _listIndex; bool _editable; bool _editMode; @@ -80,6 +84,8 @@ protected: uint32 _cmd; + ThemeEngine::FontColor _editColor; + public: ListWidget(GuiObject *boss, const String &name, uint32 cmd = 0); ListWidget(GuiObject *boss, int x, int y, int w, int h, uint32 cmd = 0); @@ -87,20 +93,33 @@ public: virtual Widget *findWidget(int x, int y); - void setList(const StringList &list); - void append(const String &s); + void setList(const StringList &list, const ColorList *colors = 0); const StringList &getList() const { return _dataList; } - int getSelected() const { return (_filter.empty() || _selectedItem == -1) ? _selectedItem : _listIndex[_selectedItem]; } + + void append(const String &s, ThemeEngine::FontColor color = ThemeEngine::kFontColorNormal); + void setSelected(int item); + int getSelected() const { return (_filter.empty() || _selectedItem == -1) ? _selectedItem : _listIndex[_selectedItem]; } + const String &getSelectedString() const { return _list[_selectedItem]; } + ThemeEngine::FontColor getSelectionColor() const; + void setNumberingMode(NumberingMode numberingMode) { _numberingMode = numberingMode; } - bool isEditable() const { return _editable; } - void setEditable(bool editable) { _editable = editable; } + void scrollTo(int item); void scrollToEnd(); + void enableQuickSelect(bool enable) { _quickSelect = enable; } String getQuickSelectString() const { return _quickSelectStr; } + bool isEditable() const { return _editable; } + void setEditable(bool editable) { _editable = editable; } + void setEditColor(ThemeEngine::FontColor color) { _editColor = color; } + + // Made startEditMode/endEditMode for SaveLoadChooser + void startEditMode(); + void endEditMode(); + void setFilter(const String &filter, bool redraw = true); virtual void handleTickle(); @@ -115,10 +134,6 @@ public: virtual bool wantsFocus() { return true; } - // Made startEditMode for SCUMM's SaveLoadChooser - void startEditMode(); - void endEditMode(); - protected: void drawWidget(); |