ScummVM API documentation
widget.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef GUI_WIDGET_H
23 #define GUI_WIDGET_H
24 
25 #include "common/scummsys.h"
26 #include "common/array.h"
27 #include "common/str.h"
28 #include "common/keyboard.h"
29 #include "graphics/font.h"
30 #include "graphics/managed_surface.h"
31 #include "gui/object.h"
32 #include "gui/ThemeEngine.h"
33 #include "common/text-to-speech.h"
34 #include "common/system.h"
35 #include "common/config-manager.h"
36 #include "common/events.h"
37 
38 namespace GUI {
39 
40 class ScrollContainerWidget;
41 
42 enum {
43  WIDGET_ENABLED = 1 << 0,
44  WIDGET_INVISIBLE = 1 << 1,
45  WIDGET_HILITED = 1 << 2,
46  WIDGET_BORDER = 1 << 3,
47  WIDGET_PRESSED = 1 << 4,
48  //WIDGET_INV_BORDER = 1 << 4,
49  WIDGET_CLEARBG = 1 << 5,
50  WIDGET_WANT_TICKLE = 1 << 7,
51  WIDGET_TRACK_MOUSE = 1 << 8,
52  // Retain focus on mouse up. By default widgets lose focus on mouseup,
53  // but some widgets might want to retain it - widgets where you enter
54  // text, for instance
55  WIDGET_RETAIN_FOCUS = 1 << 9,
56  // Usually widgets would lock mouse input when the user pressed the
57  // left mouse button till the user releases it.
58  // The PopUpWidget for example does not want this behavior, since the
59  // mouse down will open up a new dialog which silently eats the mouse
60  // up event for its own purposes.
61  WIDGET_IGNORE_DRAG = 1 << 10,
62  WIDGET_DYN_TOOLTIP = 1 << 11, // Widgets updates tooltip by coordinates
63 };
64 
65 enum {
66  kStaticTextWidget = 'TEXT',
67  kEditTextWidget = 'EDIT',
68  kButtonWidget = 'BTTN',
69  kCheckboxWidget = 'CHKB',
70  kRadiobuttonWidget = 'RDBT',
71  kSliderWidget = 'SLDE',
72  kListWidget = 'LIST',
73  kScrollBarWidget = 'SCRB',
74  kPopUpWidget = 'POPU',
75  kTabWidget = 'TABW',
76  kGraphicsWidget = 'GFXW',
77  kContainerWidget = 'CTNR',
78  kScrollContainerWidget = 'SCTR',
79  kRichTextWidget = 'RTXT',
80  kEEWidget = 'EEGG',
81 };
82 
83 enum {
84  kCaretBlinkTime = 300
85 };
86 
87 enum {
88  kPressedButtonTime = 200
89 };
90 
91 enum {
92  kPicButtonStateEnabled = 0,
93  kPicButtonHighlight = 1,
94  kPicButtonStateDisabled = 2,
95  kPicButtonStatePressed = 3,
96 
97  kPicButtonStateMax = 3
98 };
99 
100 /* Widget */
101 class Widget : public GuiObject {
102  friend class Dialog;
103 protected:
104  uint32 _type;
105  GuiObject *_boss;
106  Widget *_next;
107  bool _hasFocus;
109  Common::U32String _tooltip;
110 
111 private:
112  uint16 _flags;
113  bool _needsRedraw;
114 
115 public:
116  static Widget *findWidgetInChain(Widget *start, int x, int y);
117  static Widget *findWidgetInChain(Widget *start, const char *name);
118  static Widget *findWidgetInChain(Widget *w, uint32 type);
119  static bool containsWidgetInChain(Widget *start, Widget *search);
120 
121 public:
122  Widget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip = Common::U32String());
123  Widget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip = Common::U32String());
124  Widget(GuiObject *boss, const Common::String &name, const Common::U32String &tooltip = Common::U32String());
125  ~Widget() override;
126 
127  void init();
128 
129  void setNext(Widget *w) { _next = w; }
130  void setBoss(GuiObject *newBoss) { _boss = newBoss; }
131  Widget *next() { return _next; }
132 
133  int16 getAbsX() const override { return _x + _boss->getChildX(); }
134  int16 getAbsY() const override { return _y + _boss->getChildY(); }
135 
136  virtual void setPos(int x, int y) { _x = x; _y = y; }
137  virtual void setSize(int w, int h) { _w = w; _h = h; }
138 
140  virtual void getMinSize(int &minWidth, int &minHeight) { minHeight = -1; minWidth = -1; }
141 
142  virtual void handleMouseDown(int x, int y, int button, int clickCount) {}
143  virtual void handleMouseUp(int x, int y, int button, int clickCount) {}
144  virtual void handleMouseEntered(int button) {}
145  virtual void handleMouseLeft(int button) {}
146  virtual void handleMouseMoved(int x, int y, int button) {}
147  void handleMouseWheel(int x, int y, int direction) override { assert(_boss); _boss->handleMouseWheel(x, y, direction); }
148  virtual bool handleKeyDown(Common::KeyState state) { return false; } // Return true if the event was handled
149  virtual bool handleKeyUp(Common::KeyState state) { return false; } // Return true if the event was handled
150  virtual void handleOtherEvent(const Common::Event &evt) {}
151  virtual void handleTickle() {}
152 
154  virtual void markAsDirty();
155 
157  virtual void draw();
158 
159  void receivedFocus() { _hasFocus = true; receivedFocusWidget(); }
160  void lostFocus() { _hasFocus = false; lostFocusWidget(); }
161  virtual bool wantsFocus() { return false; }
162 
163  uint32 getType() const { return _type; }
164 
165  void setFlags(int flags);
166  void clearFlags(int flags);
167  int getFlags() const { return _flags; }
168 
169  void setEnabled(bool e);
170  bool isEnabled() const;
171 
172  void setVisible(bool e);
173  bool isVisible() const override;
174 
175  bool useRTL() const;
176 
177  uint8 parseHotkey(const Common::U32String &label);
178  Common::U32String cleanupHotkey(const Common::U32String &label);
179 
180  bool hasTooltip() const { return !_tooltip.empty(); }
181  const Common::U32String &getTooltip() const { return _tooltip; }
182  void setTooltip(const Common::U32String &tooltip) { _tooltip = tooltip; }
183  void setTooltip(const Common::String &tooltip) { _tooltip = Common::U32String(tooltip); }
184 
185  virtual bool containsWidget(Widget *) const { return false; }
186 
187  void read(const Common::U32String &str);
188 
189 protected:
190  void updateState(int oldFlags, int newFlags);
191 
192  virtual void drawWidget() = 0;
193 
194  virtual void receivedFocusWidget() {}
195  virtual void lostFocusWidget() {}
196 
197  virtual Widget *findWidget(int x, int y) { return this; }
198 
199  void releaseFocus() override { assert(_boss); _boss->releaseFocus(); }
200 
201  // By default, delegate unhandled commands to the boss
202  void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override { assert(_boss); _boss->handleCommand(sender, cmd, data); }
203 };
204 
205 /* StaticTextWidget */
206 class StaticTextWidget : public Widget {
207 protected:
208  Common::U32String _label;
209  Graphics::TextAlign _align;
211  ThemeEngine::FontColor _fontColor;
212  bool _useEllipsis;
213 
214 public:
215  StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &text, Graphics::TextAlign align, const Common::U32String &tooltip = Common::U32String(), ThemeEngine::FontStyle font = ThemeEngine::kFontStyleBold, Common::Language lang = Common::UNK_LANG, bool useEllipsis = true);
216  StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &text, Graphics::TextAlign align, const Common::U32String &tooltip = Common::U32String(), ThemeEngine::FontStyle font = ThemeEngine::kFontStyleBold, Common::Language lang = Common::UNK_LANG, bool useEllipsis = true);
217  StaticTextWidget(GuiObject *boss, const Common::String &name, const Common::U32String &text, const Common::U32String &tooltip = Common::U32String(), ThemeEngine::FontStyle font = ThemeEngine::kFontStyleBold, Common::Language lang = Common::UNK_LANG, bool useEllipsis = true);
218  void setValue(int value);
219  void setLabel(const Common::U32String &label);
220  void handleMouseEntered(int button) override { readLabel(); }
221  const Common::U32String &getLabel() const { return _label; }
222  void setAlign(Graphics::TextAlign align);
223  Graphics::TextAlign getAlign() const { return _align; }
224  void readLabel() { read(_label); }
225  void setFontColor(ThemeEngine::FontColor color);
226 
227 protected:
228  void reflowLayout() override;
229  void drawWidget() override;
230  void setFont(ThemeEngine::FontStyle font, Common::Language lang);
231 };
232 
233 /* ButtonWidget */
235  friend class Dialog; // Needed for the hotkey handling
236 protected:
237  uint32 _cmd;
238  uint8 _hotkey;
239  uint8 _highresHotkey;
240  uint8 _lowresHotkey;
241  Common::U32String _lowresLabel;
242 public:
243  ButtonWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0, const Common::U32String &lowresLabel = Common::U32String());
244  ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0, const Common::U32String &lowresLabel = Common::U32String());
245  ButtonWidget(GuiObject *boss, const Common::String &name, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0, const Common::U32String &lowresLabel = Common::U32String());
246 
247  void getMinSize(int &minWidth, int &minHeight) override;
248 
249  void setCmd(uint32 cmd) { _cmd = cmd; }
250  uint32 getCmd() const { return _cmd; }
251 
252  void setLabel(const Common::U32String &label);
253  void setLabel(const Common::String &label);
254  void setLowresLabel(const Common::U32String &label);
255  const Common::U32String &getLabel();
256 
257  void handleMouseUp(int x, int y, int button, int clickCount) override;
258  void handleMouseDown(int x, int y, int button, int clickCount) override;
259  void handleMouseEntered(int button) override { readLabel(); if (_duringPress) { setFlags(WIDGET_PRESSED); } else { setFlags(WIDGET_HILITED); } markAsDirty(); }
260  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED | WIDGET_PRESSED); markAsDirty(); }
261 
262  void setHighLighted(bool enable);
263  void setPressedState();
264  void setUnpressedState();
265 protected:
266  void drawWidget() override;
267  bool _duringPress;
268 };
269 
270 /* DropdownButtonWidget */
272 public:
273  DropdownButtonWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0, const Common::U32String &lowresLabel = Common::U32String());
274  DropdownButtonWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0, const Common::U32String &lowresLabel = Common::U32String());
275  DropdownButtonWidget(GuiObject *boss, const Common::String &name, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0, const Common::U32String &lowresLabel = Common::U32String());
276 
277  void handleMouseMoved(int x, int y, int button) override;
278  void handleMouseUp(int x, int y, int button, int clickCount) override;
279  void reflowLayout() override;
280  void getMinSize(int &minWidth, int &minHeight) override;
281 
282 
283  void appendEntry(const Common::U32String &label, uint32 cmd);
284  void clearEntries();
285 
286 protected:
287  struct Entry {
288  Common::U32String label;
289  uint32 cmd;
290  };
292 
293  // Widget API
294  void drawWidget() override;
295 
296  void reset();
297  bool isInDropDown(int x, int y) const;
298 
299  EntryList _entries;
300 
301  uint32 _dropdownWidth;
302  bool _inDropdown;
303  bool _inButton;
304 };
305 
306 /* PicButtonWidget */
308 public:
309  PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
310  PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
311  PicButtonWidget(GuiObject *boss, const Common::String &name, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
312  ~PicButtonWidget() override;
313 
314  void setGfx(Common::SharedPtr<Graphics::ManagedSurface> &gfx, int statenum = kPicButtonStateEnabled);
315  void setGfx(const Graphics::Surface *gfx, int statenum = kPicButtonStateEnabled, bool scale = true);
316  void setGfxFromTheme(const char *name, int statenum = kPicButtonStateEnabled);
317  void setGfx(int w, int h, int r, int g, int b, int statenum = kPicButtonStateEnabled);
318  void clearGfx(int statenum = kPicButtonStateEnabled) { _gfx[statenum].reset(); }
319 
320  void setButtonDisplay(bool enable) {_showButton = enable; }
321 
322 protected:
323  void drawWidget() override;
324 
325  Common::SharedPtr<Graphics::ManagedSurface> _gfx[kPicButtonStateMax + 1];
326  Graphics::AlphaType _alphaType[kPicButtonStateMax + 1];
327  bool _showButton;
328 };
329 
330 /* CheckboxWidget */
331 class CheckboxWidget : public ButtonWidget {
332 protected:
333  bool _state;
334  bool _overrideText;
335  int _spacing;
336 public:
337  CheckboxWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
338  CheckboxWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
339  CheckboxWidget(GuiObject *boss, const Common::String &name, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
340 
341  void handleMouseUp(int x, int y, int button, int clickCount) override;
342  void handleMouseEntered(int button) override { readLabel(); setFlags(WIDGET_HILITED); markAsDirty(); }
343  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
344 
345  void setState(bool state);
346  void toggleState() { setState(!_state); }
347  bool getState() const { return _state; }
348 
349  void setOverride(bool enable);
350 
351 protected:
352  void drawWidget() override;
353 };
354 
355 class RadiobuttonWidget;
356 
358 public:
359  RadiobuttonGroup(GuiObject *boss, uint32 cmd = 0);
360  ~RadiobuttonGroup() override {}
361 
362  void addButton(RadiobuttonWidget *button) { _buttons.push_back(button); }
363  Common::Array<RadiobuttonWidget *> getButtonList() const { return _buttons; }
364 
365  void setValue(int state);
366  int getValue() const { return _value; }
367 
368  void setEnabled(bool ena);
369 
370  void setCmd(uint32 cmd) { _cmd = cmd; }
371  uint32 getCmd() const { return _cmd; }
372 
373 protected:
375  int _value;
376  uint32 _cmd;
377 };
378 
379 /* RadiobuttonWidget */
381 protected:
382  bool _state;
383  int _spacing;
384  int _value;
385 
386 public:
387  RadiobuttonWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, RadiobuttonGroup *group, int value, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint8 hotkey = 0);
388  RadiobuttonWidget(GuiObject *boss, int x, int y, int w, int h, RadiobuttonGroup *group, int value, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint8 hotkey = 0);
389  RadiobuttonWidget(GuiObject *boss, const Common::String &name, RadiobuttonGroup *group, int value, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint8 hotkey = 0);
390 
391  void handleMouseUp(int x, int y, int button, int clickCount) override;
392  void handleMouseEntered(int button) override { readLabel(); setFlags(WIDGET_HILITED); markAsDirty(); }
393  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
394 
395  void setState(bool state, bool setGroup = true);
396  void toggleState() { setState(!_state); }
397  bool getState() const { return _state; }
398  int getValue() const { return _value; }
399 
400 protected:
401  void drawWidget() override;
402 
403  RadiobuttonGroup *_group;
404 };
405 
406 /* SliderWidget */
407 class SliderWidget : public Widget, public CommandSender {
408 protected:
409  uint32 _cmd;
410  int _value, _oldValue;
411  int _valueMin, _valueMax;
412  bool _isDragging;
413  uint _labelWidth;
414 public:
415  SliderWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0);
416  SliderWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0);
417  SliderWidget(GuiObject *boss, const Common::String &name, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0);
418 
419  void setCmd(uint32 cmd) { _cmd = cmd; }
420  uint32 getCmd() const { return _cmd; }
421 
422  void setValue(int value) { _value = value; }
423  int getValue() const { return _value; }
424 
425  void setMinValue(int value) { _valueMin = value; }
426  int getMinValue() const { return _valueMin; }
427  void setMaxValue(int value) { _valueMax = value; }
428  int getMaxValue() const { return _valueMax; }
429 
430  void handleMouseMoved(int x, int y, int button) override;
431  void handleMouseDown(int x, int y, int button, int clickCount) override;
432  void handleMouseUp(int x, int y, int button, int clickCount) override;
433  void handleMouseEntered(int button) override { setFlags(WIDGET_HILITED); markAsDirty(); }
434  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
435  void handleMouseWheel(int x, int y, int direction) override;
436 
437 protected:
438  void drawWidget() override;
439 
440  int valueToPos(int value);
441  int posToValue(int pos);
442  int valueToBarWidth(int value);
443 };
444 
445 /* GraphicsWidget */
446 class GraphicsWidget : public Widget {
447 public:
448  GraphicsWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip = Common::U32String());
449  GraphicsWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip = Common::U32String());
450  GraphicsWidget(GuiObject *boss, const Common::String &name, const Common::U32String &tooltip = Common::U32String());
451  ~GraphicsWidget() override;
452 
454  void setGfx(const Graphics::Surface *gfx, bool scale = false);
455  void setGfx(int w, int h, int r, int g, int b);
456  void setGfxFromTheme(const char *name);
457  void clearGfx() { _gfx.reset(); }
458 
459 protected:
460  void drawWidget() override;
461 
463  Graphics::AlphaType _alphaType;
464 };
465 
466 class PathWidget : public StaticTextWidget {
467 public:
468  PathWidget(GuiObject *boss, int x, int y, int w, int h, bool scale,
469  const Common::Path &path, Graphics::TextAlign align,
470  const Common::U32String &placeholder = Common::U32String(),
471  const Common::U32String &tooltip = Common::U32String(),
473  bool useEllipsis = true) :
474  StaticTextWidget(boss, x, y, w, h, scale,
475  path.empty() ? placeholder : Common::U32String(path.toString(Common::Path::kNativeSeparator)),
476  align, tooltip, font, Common::UNK_LANG, useEllipsis),
477  _path(path),
478  _placeholder(placeholder) { }
479  PathWidget(GuiObject *boss, int x, int y, int w, int h,
480  const Common::Path &path, Graphics::TextAlign align,
481  const Common::U32String &placeholder = Common::U32String(),
482  const Common::U32String &tooltip = Common::U32String(),
484  bool useEllipsis = true) :
485  StaticTextWidget(boss, x, y, w, h,
486  path.empty() ? placeholder : Common::U32String(path.toString(Common::Path::kNativeSeparator)),
487  align, tooltip, font, Common::UNK_LANG, useEllipsis),
488  _path(path),
489  _placeholder(placeholder) {}
490  PathWidget(GuiObject *boss, const Common::String &name,
491  const Common::Path &path,
492  const Common::U32String &placeholder = Common::U32String(),
493  const Common::U32String &tooltip = Common::U32String(),
495  bool useEllipsis = true) :
496  StaticTextWidget(boss, name,
497  path.empty() ? placeholder : Common::U32String(path.toString(Common::Path::kNativeSeparator)),
498  tooltip, font, Common::UNK_LANG, useEllipsis),
499  _path(path),
500  _placeholder(placeholder) {}
501  void setLabel(const Common::Path &path) {
502  _path = path;
503  if (path.empty()) {
504  StaticTextWidget::setLabel(_placeholder);
505  } else {
506  StaticTextWidget::setLabel(path.toString(Common::Path::kNativeSeparator));
507  }
508  }
509  const Common::Path &getLabel() const { return _path; }
510  void setEmptyPlaceHolder(const Common::U32String &placeholder) { _placeholder = placeholder; }
511 protected:
512  Common::Path _path;
513  Common::U32String _placeholder;
514 };
515 
516 /* ContainerWidget */
517 class ContainerWidget : public Widget {
518 public:
519  ContainerWidget(GuiObject *boss, int x, int y, int w, int h, bool scale = false);
520  ContainerWidget(GuiObject *boss, const Common::String &name);
521  ~ContainerWidget() override;
522 
523  bool containsWidget(Widget *) const override;
524  Widget *findWidget(int x, int y) override;
525  void removeWidget(Widget *widget) override;
526 
527  void setBackgroundType(ThemeEngine::WidgetBackground backgroundType);
528 protected:
529  void drawWidget() override;
530 
531  ThemeEngine::WidgetBackground _backgroundType;
532 };
533 
534 /* OptionsContainerWidget */
536 public:
544  OptionsContainerWidget(GuiObject *boss, const Common::String &name, const Common::String &dialogLayout,
545  const Common::String &domain);
546  ~OptionsContainerWidget() override;
547 
549  virtual void load() = 0;
550 
556  virtual bool save() = 0;
557 
562  virtual bool hasKeys() { return true; }
563 
565  virtual void setEnabled(bool e) {}
566 
567  void setParentDialog(Dialog *parentDialog) { _parentDialog = parentDialog; }
568  void setDomain(const Common::String &domain) { _domain = domain; }
569 
570 protected:
571  // Widget API
572  void reflowLayout() override;
573  void drawWidget() override {}
574  bool containsWidget(Widget *widget) const override;
575  Widget *findWidget(int x, int y) override;
576  void removeWidget(Widget *widget) override;
577 
579  GuiObject *widgetsBoss() { return this; }
580 
586  virtual void defineLayout(ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const {}
587 
588  Common::String _domain;
589  const Common::String _dialogLayout;
590 
591  Dialog *_parentDialog;
592 };
593 
594 ButtonWidget *addClearButton(GuiObject *boss, const Common::String &name, uint32 cmd, int x=0, int y=0, int w=0, int h=0, bool scale = false);
595 
596 } // End of namespace GUI
597 
598 #endif
Definition: str.h:59
FontColor
Font color selector.
Definition: ThemeEngine.h:288
TextAlign
Definition: font.h:48
Definition: surface.h:67
Definition: widget.h:357
Definition: widget.h:446
WidgetBackground
Widget background type.
Definition: ThemeEngine.h:226
Definition: widget.h:307
Definition: path.h:52
virtual void draw()
Definition: widget.h:331
Definition: widget.h:206
virtual void defineLayout(ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const
Definition: widget.h:586
Definition: widget.h:407
Definition: widget.h:380
Definition: ThemeEval.h:37
Definition: printman.h:30
static const char kNativeSeparator
Definition: path.h:195
Definition: object.h:60
Definition: widget.h:535
Definition: widget.h:466
bool empty() const
Definition: path.h:353
Definition: ustr.h:57
virtual bool hasKeys()
Definition: widget.h:562
virtual void markAsDirty()
Definition: events.h:210
FontStyle
Font style selector.
Definition: ThemeEngine.h:274
virtual void getMinSize(int &minWidth, int &minHeight)
Definition: widget.h:140
String toString(char separator='/') const
GuiObject * widgetsBoss()
Definition: widget.h:579
Definition: dialog.h:49
A bold font. This is also the default font.
Definition: ThemeEngine.h:275
Definition: widget.h:271
State
State of the widget to be drawn.
Definition: ThemeEngine.h:249
Definition: widget.h:101
Definition: keyboard.h:294
virtual void setEnabled(bool e)
Definition: widget.h:565
Definition: widget.h:287
Definition: widget.h:517
Definition: widget.h:234
Definition: object.h:40
Language
Definition: language.h:45