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;
36 kListNumberingOff = -1,
37 kListNumberingZero = 0,
43 kListItemSingleClickedCmd =
'LIsc',
44 kListItemDoubleClickedCmd =
'LIdc',
45 kListItemActivatedCmd =
'LIac',
46 kListItemRemovalRequestCmd =
'LIrm',
47 kListItemEditModeStartedCmd =
'LIes',
48 kListSelectionChangedCmd =
'Lsch' 69 ListDataArray _dataList;
73 NumberingMode _numberingMode;
90 uint32 _quickSelectTime;
103 bool _dictionarySelect;
111 FilterMatcher _filterMatcher;
112 void *_filterMatcherArg;
114 static const int kDragThreshold = 5;
121 bool containsWidget(
Widget *)
const override;
122 Widget *findWidget(
int x,
int y)
override;
129 void setSelected(
int item);
130 int getSelected()
const {
return (_filter.empty() || _selectedItem == -1) ? _selectedItem : _listIndex[_selectedItem]; }
132 const Common::U32String getSelectedString()
const {
return stripGUIformatting(_list[_selectedItem]); }
139 bool isItemSelected(
int item)
const;
140 void markSelectedItem(
int item,
bool state);
141 void clearSelection();
142 void selectItemRange(
int from,
int to);
143 int _lastSelectionStartItem;
146 void scrollTo(
int item);
148 int getCurrentScrollPos()
const {
return _currentPos; }
149 bool isItemVisible(
int item)
const {
return _currentPos <= item && item < _currentPos + _entriesPerPage; }
151 void enableQuickSelect(
bool enable) { _quickSelect = enable; }
152 Common::String getQuickSelectString()
const {
return _quickSelectStr; }
154 void enableDictionarySelect(
bool enable) { _dictionarySelect = enable; }
156 bool isEditable()
const {
return _editable; }
157 void setEditable(
bool editable) { _editable = editable; }
159 void setFilterMatcher(FilterMatcher matcher,
void *arg) { _filterMatcher = matcher; _filterMatcherArg = arg; }
162 void setMultiSelectEnabled(
bool enabled) { _multiSelectEnabled = enabled; }
166 void startEditMode()
override;
167 void endEditMode()
override;
171 void handleTickle()
override;
172 void applyScrollPos();
173 void handleMouseDown(
int x,
int y,
int button,
int clickCount)
override;
174 void handleMouseUp(
int x,
int y,
int button,
int clickCount)
override;
175 void handleMouseWheel(
int x,
int y,
int direction)
override;
176 void handleMouseMoved(
int x,
int y,
int button)
override;
177 void handleMouseLeft(
int button)
override;
180 void handleCommand(
CommandSender *sender, uint32 cmd, uint32 data)
override;
182 void reflowLayout()
override;
184 bool wantsFocus()
override {
return true; }
193 void drawWidget()
override;
197 void scrollBarRecalc();
199 void abortEditMode()
override;
202 int getCaretOffset()
const override;
206 void receivedFocusWidget()
override;
207 void lostFocusWidget()
override;
209 void scrollToCurrent();
219 int findSelectableItem(
int item,
int direction)
const;
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
Definition: printman.h:30
TextInversionState
Text inversion state of the text to be draw.
Definition: ThemeEngine.h:259
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