22 #ifndef GUI_WIDGETS_GRID_H 23 #define GUI_WIDGETS_GRID_H 25 #include "gui/dialog.h" 26 #include "gui/widgets/scrollbar.h" 27 #include "common/str.h" 30 #include "image/png.h" 31 #include "graphics/svg.h" 35 class ScrollBarWidget;
40 kPlayButtonCmd =
'PLAY',
41 kEditButtonCmd =
'EDIT',
42 kLoadButtonCmd =
'LOAD',
43 kOpenTrayCmd =
'OPTR',
44 kItemClicked =
'LBX1',
45 kItemDoubleClickedCmd =
'LBX2',
51 bool isHeader, validEntry;
68 : entryID(
id), gameid(gid), engineid(eid), title(t), description(d), extra(e), language(l), platform(p), validEntry(v), isHeader(
false) {
73 isHeader(
true), validEntry(
true), entryID(groupID), language(Common::UNK_LANG), platform(Common::kPlatformUnknown) {
89 void reflowLayout()
override;
91 void handleCommand(
CommandSender *sender, uint32 cmd, uint32 data)
override;
92 void handleMouseDown(
int x,
int y,
int button,
int clickCount)
override;
93 void handleMouseUp(
int x,
int y,
int button,
int clickCount)
override;
94 void handleMouseWheel(
int x,
int y,
int direction)
override;
95 void handleMouseMoved(
int x,
int y,
int button)
override;
131 int _scrollWindowHeight;
132 int _scrollWindowWidth;
137 int _thumbnailHeight;
141 int _platformIconHeight;
142 int _platformIconWidth;
143 int _extraIconHeight;
145 int _minGridXSpacing;
146 int _minGridYSpacing;
149 int _firstVisibleItem;
150 int _lastVisibleItem;
153 int _scrollWindowPaddingX;
154 int _scrollWindowPaddingY;
155 int _gridHeaderHeight;
156 int _gridHeaderWidth;
164 int _thumbnailMargin;
166 bool _isTitlesVisible;
185 bool calcVisibleEntries();
189 void setTitlesVisible(
bool vis);
190 void markGridAsInvalid() { _isGridInvalid =
true; }
195 bool groupExpanded(
int groupID) {
return _groupExpanded[groupID]; }
196 void toggleGroup(
int groupID);
200 void reloadThumbnails();
201 void loadFlagIcons();
202 void loadPlatformIcons();
203 void loadExtraIcons();
206 void calcInnerHeight();
207 void calcEntrySizes();
209 void move(
int x,
int y);
210 void scrollToEntry(
int id,
bool forceToTop);
211 void assignEntriesToItems();
213 int getNextPos(
int oldSel);
214 int getNewSel(
int index);
215 int getScrollPos()
const {
return _scrollPos; }
216 int getSelected()
const {
return ((_selectedEntry ==
nullptr) ? -1 : _selectedEntry->entryID); }
217 int getThumbnailHeight()
const {
return _thumbnailHeight; }
218 int getThumbnailWidth()
const {
return _thumbnailWidth; }
220 void handleMouseWheel(
int x,
int y,
int direction)
override;
221 void handleCommand(
CommandSender *sender, uint32 cmd, uint32 data)
override;
222 void reflowLayout()
override;
224 bool wantsFocus()
override {
return true; }
226 void openTray(
int x,
int y,
int entryID);
227 void openTrayAtSelected();
228 void scrollBarRecalc();
230 void setSelected(
int id);
238 Graphics::AlphaType _thumbAlpha;
247 void move(
int x,
int y);
252 void drawWidget()
override;
254 void handleMouseWheel(
int x,
int y,
int direction)
override;
255 void handleMouseEntered(
int button)
override;
256 void handleMouseLeft(
int button)
override;
257 void handleMouseDown(
int x,
int y,
int button,
int clickCount)
override;
258 void handleMouseMoved(
int x,
int y,
int button)
override;
Definition: managed_surface.h:51
static String format(MSVC_PRINTF const char *fmt,...) GCC_PRINTF(1
Out move(In first, In last, Out dst)
Definition: algorithm.h:109
Language
Definition: language.h:45