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; }
125 void enableQuickSelect(
bool enable) { _quickSelect = enable; }
126 Common::String getQuickSelectString()
const {
return _quickSelectStr; }
128 void enableDictionarySelect(
bool enable) { _dictionarySelect = enable; }
130 bool isEditable()
const {
return _editable; }
131 void setEditable(
bool editable) { _editable = editable; }
133 void setFilterMatcher(FilterMatcher matcher,
void *arg) { _filterMatcher = matcher; _filterMatcherArg = arg; }
136 void startEditMode()
override;
137 void endEditMode()
override;
141 void handleTickle()
override;
142 void handleMouseDown(
int x,
int y,
int button,
int clickCount)
override;
143 void handleMouseUp(
int x,
int y,
int button,
int clickCount)
override;
144 void handleMouseWheel(
int x,
int y,
int direction)
override;
145 void handleMouseMoved(
int x,
int y,
int button)
override;
146 void handleMouseLeft(
int button)
override;
149 void handleCommand(
CommandSender *sender, uint32 cmd, uint32 data)
override;
151 void reflowLayout()
override;
153 bool wantsFocus()
override {
return true; }
162 void drawWidget()
override;
166 void scrollBarRecalc();
168 void abortEditMode()
override;
171 int getCaretOffset()
const override;
175 void receivedFocusWidget()
override;
176 void lostFocusWidget()
override;
178 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