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;
92 bool _dictionarySelect;
100 FilterMatcher _filterMatcher;
101 void *_filterMatcherArg;
107 bool containsWidget(
Widget *)
const override;
108 Widget *findWidget(
int x,
int y)
override;
115 void setSelected(
int item);
116 int getSelected()
const {
return (_filter.empty() || _selectedItem == -1) ? _selectedItem : _listIndex[_selectedItem]; }
118 const Common::U32String getSelectedString()
const {
return stripGUIformatting(_list[_selectedItem]); }
120 void setNumberingMode(NumberingMode numberingMode) { _numberingMode = numberingMode; }
122 void scrollTo(
int item);
124 int getCurrentScrollPos()
const {
return _currentPos; }
125 bool isItemVisible(
int item)
const {
return _currentPos <= item && item < _currentPos + _entriesPerPage; }
127 void enableQuickSelect(
bool enable) { _quickSelect = enable; }
128 Common::String getQuickSelectString()
const {
return _quickSelectStr; }
130 void enableDictionarySelect(
bool enable) { _dictionarySelect = enable; }
132 bool isEditable()
const {
return _editable; }
133 void setEditable(
bool editable) { _editable = editable; }
135 void setFilterMatcher(FilterMatcher matcher,
void *arg) { _filterMatcher = matcher; _filterMatcherArg = arg; }
138 void startEditMode()
override;
139 void endEditMode()
override;
143 void handleTickle()
override;
144 void handleMouseDown(
int x,
int y,
int button,
int clickCount)
override;
145 void handleMouseUp(
int x,
int y,
int button,
int clickCount)
override;
146 void handleMouseWheel(
int x,
int y,
int direction)
override;
147 void handleMouseMoved(
int x,
int y,
int button)
override;
148 void handleMouseLeft(
int button)
override;
151 void handleCommand(
CommandSender *sender, uint32 cmd, uint32 data)
override;
153 void reflowLayout()
override;
155 bool wantsFocus()
override {
return true; }
164 void drawWidget()
override;
168 void scrollBarRecalc();
170 void abortEditMode()
override;
173 int getCaretOffset()
const override;
177 void receivedFocusWidget()
override;
178 void lostFocusWidget()
override;
180 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