22 #ifndef GUI_WIDGETS_LIST_H 23 #define GUI_WIDGETS_LIST_H 25 #include "gui/widgets/editable.h" 26 #include "common/str.h" 28 #include "gui/ThemeEngine.h" 32 class ScrollBarWidget;
35 kListNumberingOff = -1,
36 kListNumberingZero = 0,
42 kListItemSingleClickedCmd =
'LIsc',
43 kListItemDoubleClickedCmd =
'LIdc',
44 kListItemActivatedCmd =
'LIac',
45 kListItemRemovalRequestCmd =
'LIrm',
46 kListItemEditModeStartedCmd =
'LIes',
47 kListSelectionChangedCmd =
'Lsch' 67 ListDataArray _dataList;
71 NumberingMode _numberingMode;
79 uint32 _quickSelectTime;
91 bool _dictionarySelect;
99 FilterMatcher _filterMatcher;
100 void *_filterMatcherArg;
106 bool containsWidget(
Widget *)
const override;
107 Widget *findWidget(
int x,
int y)
override;
114 void setSelected(
int item);
115 int getSelected()
const {
return (_filter.empty() || _selectedItem == -1) ? _selectedItem : _listIndex[_selectedItem]; }
117 const Common::U32String getSelectedString()
const {
return stripGUIformatting(_list[_selectedItem]); }
119 void setNumberingMode(NumberingMode numberingMode) { _numberingMode = numberingMode; }
121 void scrollTo(
int item);
123 int getCurrentScrollPos()
const {
return _currentPos; }
124 bool isItemVisible(
int item)
const {
return _currentPos <= item && item < _currentPos + _entriesPerPage; }
126 void enableQuickSelect(
bool enable) { _quickSelect = enable; }
127 Common::String getQuickSelectString()
const {
return _quickSelectStr; }
129 void enableDictionarySelect(
bool enable) { _dictionarySelect = enable; }
131 bool isEditable()
const {
return _editable; }
132 void setEditable(
bool editable) { _editable = editable; }
134 void setFilterMatcher(FilterMatcher matcher,
void *arg) { _filterMatcher = matcher; _filterMatcherArg = arg; }
137 void startEditMode()
override;
138 void endEditMode()
override;
142 void handleTickle()
override;
143 void handleMouseDown(
int x,
int y,
int button,
int clickCount)
override;
144 void handleMouseUp(
int x,
int y,
int button,
int clickCount)
override;
145 void handleMouseWheel(
int x,
int y,
int direction)
override;
146 void handleMouseMoved(
int x,
int y,
int button)
override;
147 void handleMouseLeft(
int button)
override;
150 void handleCommand(
CommandSender *sender, uint32 cmd, uint32 data)
override;
152 void reflowLayout()
override;
154 bool wantsFocus()
override {
return true; }
163 void drawWidget()
override;
167 void scrollBarRecalc();
169 void abortEditMode()
override;
172 int getCaretOffset()
const override;
176 void receivedFocusWidget()
override;
177 void lostFocusWidget()
override;
179 void scrollToCurrent();
Center the text.
Definition: font.h:52
Indicates that the text should not be drawn inverted.
Definition: ThemeEngine.h:260
FontColor
Font color selector.
Definition: ThemeEngine.h:288
TextAlign
Definition: font.h:48
Use color from formatting.
Definition: ThemeEngine.h:289
TextInversionState
Text inversion state of the text to be draw.
Definition: ThemeEngine.h:259
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Indicates that the widget is enabled.
Definition: ThemeEngine.h:251
State
State of the widget to be drawn.
Definition: ThemeEngine.h:249
Definition: keyboard.h:294