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;
81 uint32 _quickSelectTime;
94 bool _dictionarySelect;
102 FilterMatcher _filterMatcher;
103 void *_filterMatcherArg;
109 bool containsWidget(
Widget *)
const override;
110 Widget *findWidget(
int x,
int y)
override;
117 void setSelected(
int item);
118 int getSelected()
const {
return (_filter.empty() || _selectedItem == -1) ? _selectedItem : _listIndex[_selectedItem]; }
120 const Common::U32String getSelectedString()
const {
return stripGUIformatting(_list[_selectedItem]); }
127 bool isItemSelected(
int item)
const;
128 void markSelectedItem(
int item,
bool state);
129 void clearSelection();
130 void selectItemRange(
int from,
int to);
131 int _lastSelectionStartItem;
134 void scrollTo(
int item);
136 int getCurrentScrollPos()
const {
return _currentPos; }
137 bool isItemVisible(
int item)
const {
return _currentPos <= item && item < _currentPos + _entriesPerPage; }
139 void enableQuickSelect(
bool enable) { _quickSelect = enable; }
140 Common::String getQuickSelectString()
const {
return _quickSelectStr; }
142 void enableDictionarySelect(
bool enable) { _dictionarySelect = enable; }
144 bool isEditable()
const {
return _editable; }
145 void setEditable(
bool editable) { _editable = editable; }
147 void setFilterMatcher(FilterMatcher matcher,
void *arg) { _filterMatcher = matcher; _filterMatcherArg = arg; }
150 void setMultiSelectEnabled(
bool enabled) { _multiSelectEnabled = enabled; }
154 void startEditMode()
override;
155 void endEditMode()
override;
159 void handleTickle()
override;
160 void handleMouseDown(
int x,
int y,
int button,
int clickCount)
override;
161 void handleMouseUp(
int x,
int y,
int button,
int clickCount)
override;
162 void handleMouseWheel(
int x,
int y,
int direction)
override;
163 void handleMouseMoved(
int x,
int y,
int button)
override;
164 void handleMouseLeft(
int button)
override;
167 void handleCommand(
CommandSender *sender, uint32 cmd, uint32 data)
override;
169 void reflowLayout()
override;
171 bool wantsFocus()
override {
return true; }
180 void drawWidget()
override;
184 void scrollBarRecalc();
186 void abortEditMode()
override;
189 int getCaretOffset()
const override;
193 void receivedFocusWidget()
override;
194 void lostFocusWidget()
override;
196 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
Definition: printman.h:30
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