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  // Check if the widget or its children contain a visible scrollbar
166  virtual bool hasVisibleScrollBar() const;
167  void setFlags(int flags);
168  void clearFlags(int flags);
169  int getFlags() const { return _flags; }
170 
171  void setEnabled(bool e);
172  bool isEnabled() const;
173 
174  void setVisible(bool e);
175  bool isVisible() const override;
176 
177  bool useRTL() const;
178 
179  uint8 parseHotkey(const Common::U32String &label);
180  Common::U32String cleanupHotkey(const Common::U32String &label);
181 
182  bool hasTooltip() const { return !_tooltip.empty(); }
183  const Common::U32String &getTooltip() const { return _tooltip; }
184  void setTooltip(const Common::U32String &tooltip) { _tooltip = tooltip; }
185  void setTooltip(const Common::String &tooltip) { _tooltip = Common::U32String(tooltip); }
186 
187  virtual bool containsWidget(Widget *) const { return false; }
188 
189  void read(const Common::U32String &str);
190 
191 protected:
192  void updateState(int oldFlags, int newFlags);
193 
194  virtual void drawWidget() = 0;
195 
196  virtual void receivedFocusWidget() {}
197  virtual void lostFocusWidget() {}
198 
199  virtual Widget *findWidget(int x, int y) { return this; }
200 
201  void releaseFocus() override { assert(_boss); _boss->releaseFocus(); }
202 
203  // By default, delegate unhandled commands to the boss
204  void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override { assert(_boss); _boss->handleCommand(sender, cmd, data); }
205 };
206 
207 /* StaticTextWidget */
208 class StaticTextWidget : public Widget {
209 protected:
210  Common::U32String _label;
211  Graphics::TextAlign _align;
213  ThemeEngine::FontColor _fontColor;
214  bool _useEllipsis;
215 
216 public:
217  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);
218  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);
219  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);
220  void setValue(int value);
221  void setLabel(const Common::U32String &label);
222  void handleMouseEntered(int button) override { readLabel(); }
223  const Common::U32String &getLabel() const { return _label; }
224  void setAlign(Graphics::TextAlign align);
225  Graphics::TextAlign getAlign() const { return _align; }
226  void readLabel() { read(_label); }
227  void setFontColor(ThemeEngine::FontColor color);
228 
229 protected:
230  void reflowLayout() override;
231  void drawWidget() override;
232  void setFont(ThemeEngine::FontStyle font, Common::Language lang);
233 };
234 
235 /* ButtonWidget */
237  friend class Dialog; // Needed for the hotkey handling
238 protected:
239  uint32 _cmd;
240  uint8 _hotkey;
241  uint8 _highresHotkey;
242  uint8 _lowresHotkey;
243  Common::U32String _lowresLabel;
244 public:
245  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());
246  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());
247  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());
248 
249  void getMinSize(int &minWidth, int &minHeight) override;
250 
251  void setCmd(uint32 cmd) { _cmd = cmd; }
252  uint32 getCmd() const { return _cmd; }
253 
254  void setLabel(const Common::U32String &label);
255  void setLabel(const Common::String &label);
256  void setLowresLabel(const Common::U32String &label);
257  const Common::U32String &getLabel();
258 
259  void handleMouseUp(int x, int y, int button, int clickCount) override;
260  void handleMouseDown(int x, int y, int button, int clickCount) override;
261  void handleMouseEntered(int button) override { readLabel(); if (_duringPress) { setFlags(WIDGET_PRESSED); } else { setFlags(WIDGET_HILITED); } markAsDirty(); }
262  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED | WIDGET_PRESSED); markAsDirty(); }
263 
264  void setHighLighted(bool enable);
265  void setPressedState();
266  void setUnpressedState();
267 protected:
268  void drawWidget() override;
269  bool _duringPress;
270 };
271 
272 /* DropdownButtonWidget */
274 public:
275  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());
276  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());
277  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());
278 
279  void handleMouseMoved(int x, int y, int button) override;
280  void handleMouseUp(int x, int y, int button, int clickCount) override;
281  void reflowLayout() override;
282  void getMinSize(int &minWidth, int &minHeight) override;
283 
284 
285  void appendEntry(const Common::U32String &label, uint32 cmd);
286  void clearEntries();
287 
288 protected:
289  struct Entry {
290  Common::U32String label;
291  uint32 cmd;
292  };
294 
295  // Widget API
296  void drawWidget() override;
297 
298  void reset();
299  bool isInDropDown(int x, int y) const;
300 
301  EntryList _entries;
302 
303  uint32 _dropdownWidth;
304  bool _inDropdown;
305  bool _inButton;
306 };
307 
308 /* PicButtonWidget */
310 public:
311  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);
312  PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
313  PicButtonWidget(GuiObject *boss, const Common::String &name, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
314  ~PicButtonWidget() override;
315 
316  void setGfx(Common::SharedPtr<Graphics::ManagedSurface> &gfx, int statenum = kPicButtonStateEnabled);
317  void setGfx(const Graphics::Surface *gfx, int statenum = kPicButtonStateEnabled, bool scale = true);
318  void setGfxFromTheme(const char *name, int statenum = kPicButtonStateEnabled);
319  void setGfx(int w, int h, int r, int g, int b, int statenum = kPicButtonStateEnabled);
320  void clearGfx(int statenum = kPicButtonStateEnabled) { _gfx[statenum].reset(); }
321 
322  void setButtonDisplay(bool enable) {_showButton = enable; }
323 
324 protected:
325  void drawWidget() override;
326 
327  Common::SharedPtr<Graphics::ManagedSurface> _gfx[kPicButtonStateMax + 1];
328  Graphics::AlphaType _alphaType[kPicButtonStateMax + 1];
329  bool _showButton;
330 };
331 
332 /* CheckboxWidget */
333 class CheckboxWidget : public ButtonWidget {
334 protected:
335  bool _state;
336  bool _overrideText;
337  int _spacing;
338 public:
339  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);
340  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);
341  CheckboxWidget(GuiObject *boss, const Common::String &name, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
342 
343  void handleMouseUp(int x, int y, int button, int clickCount) override;
344  void handleMouseEntered(int button) override { readLabel(); setFlags(WIDGET_HILITED); markAsDirty(); }
345  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
346 
347  void setState(bool state);
348  void toggleState() { setState(!_state); }
349  bool getState() const { return _state; }
350 
351  void setOverride(bool enable);
352 
353 protected:
354  void drawWidget() override;
355 };
356 
357 class RadiobuttonWidget;
358 
360 public:
361  RadiobuttonGroup(GuiObject *boss, uint32 cmd = 0);
362  ~RadiobuttonGroup() override {}
363 
364  void addButton(RadiobuttonWidget *button) { _buttons.push_back(button); }
365  Common::Array<RadiobuttonWidget *> getButtonList() const { return _buttons; }
366 
367  void setValue(int state);
368  int getValue() const { return _value; }
369 
370  void setEnabled(bool ena);
371 
372  void setCmd(uint32 cmd) { _cmd = cmd; }
373  uint32 getCmd() const { return _cmd; }
374 
375 protected:
377  int _value;
378  uint32 _cmd;
379 };
380 
381 /* RadiobuttonWidget */
383 protected:
384  bool _state;
385  int _spacing;
386  int _value;
387 
388 public:
389  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);
390  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);
391  RadiobuttonWidget(GuiObject *boss, const Common::String &name, RadiobuttonGroup *group, int value, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint8 hotkey = 0);
392 
393  void handleMouseUp(int x, int y, int button, int clickCount) override;
394  void handleMouseEntered(int button) override { readLabel(); setFlags(WIDGET_HILITED); markAsDirty(); }
395  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
396 
397  void setState(bool state, bool setGroup = true);
398  void toggleState() { setState(!_state); }
399  bool getState() const { return _state; }
400  int getValue() const { return _value; }
401 
402 protected:
403  void drawWidget() override;
404 
405  RadiobuttonGroup *_group;
406 };
407 
408 /* SliderWidget */
409 class SliderWidget : public Widget, public CommandSender {
410 protected:
411  uint32 _cmd;
412  int _value, _oldValue;
413  int _valueMin, _valueMax;
414  bool _isDragging;
415  uint _labelWidth;
416 public:
417  SliderWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0);
418  SliderWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0);
419  SliderWidget(GuiObject *boss, const Common::String &name, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0);
420 
421  void setCmd(uint32 cmd) { _cmd = cmd; }
422  uint32 getCmd() const { return _cmd; }
423 
424  void setValue(int value) { _value = value; }
425  int getValue() const { return _value; }
426 
427  void setMinValue(int value) { _valueMin = value; }
428  int getMinValue() const { return _valueMin; }
429  void setMaxValue(int value) { _valueMax = value; }
430  int getMaxValue() const { return _valueMax; }
431 
432  void handleMouseMoved(int x, int y, int button) override;
433  void handleMouseDown(int x, int y, int button, int clickCount) override;
434  void handleMouseUp(int x, int y, int button, int clickCount) override;
435  void handleMouseEntered(int button) override { setFlags(WIDGET_HILITED); markAsDirty(); }
436  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
437  void handleMouseWheel(int x, int y, int direction) override;
438 
439 protected:
440  void drawWidget() override;
441 
442  int valueToPos(int value);
443  int posToValue(int pos);
444  int valueToBarWidth(int value);
445 };
446 
447 /* GraphicsWidget */
448 class GraphicsWidget : public Widget {
449 public:
450  GraphicsWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip = Common::U32String());
451  GraphicsWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip = Common::U32String());
452  GraphicsWidget(GuiObject *boss, const Common::String &name, const Common::U32String &tooltip = Common::U32String());
453  ~GraphicsWidget() override;
454 
456  void setGfx(const Graphics::Surface *gfx, bool scale = false);
457  void setGfx(int w, int h, int r, int g, int b);
458  void setGfxFromTheme(const char *name);
459  void clearGfx() { _gfx.reset(); }
460 
461 protected:
462  void drawWidget() override;
463 
465  Graphics::AlphaType _alphaType;
466 };
467 
468 class PathWidget : public StaticTextWidget {
469 public:
470  PathWidget(GuiObject *boss, int x, int y, int w, int h, bool scale,
471  const Common::Path &path, Graphics::TextAlign align,
472  const Common::U32String &placeholder = Common::U32String(),
473  const Common::U32String &tooltip = Common::U32String(),
475  bool useEllipsis = true) :
476  StaticTextWidget(boss, x, y, w, h, scale,
477  path.empty() ? placeholder : Common::U32String(path.toString(Common::Path::kNativeSeparator)),
478  align, tooltip, font, Common::UNK_LANG, useEllipsis),
479  _path(path),
480  _placeholder(placeholder) { }
481  PathWidget(GuiObject *boss, int x, int y, int w, int h,
482  const Common::Path &path, Graphics::TextAlign align,
483  const Common::U32String &placeholder = Common::U32String(),
484  const Common::U32String &tooltip = Common::U32String(),
486  bool useEllipsis = true) :
487  StaticTextWidget(boss, x, y, w, h,
488  path.empty() ? placeholder : Common::U32String(path.toString(Common::Path::kNativeSeparator)),
489  align, tooltip, font, Common::UNK_LANG, useEllipsis),
490  _path(path),
491  _placeholder(placeholder) {}
492  PathWidget(GuiObject *boss, const Common::String &name,
493  const Common::Path &path,
494  const Common::U32String &placeholder = Common::U32String(),
495  const Common::U32String &tooltip = Common::U32String(),
497  bool useEllipsis = true) :
498  StaticTextWidget(boss, name,
499  path.empty() ? placeholder : Common::U32String(path.toString(Common::Path::kNativeSeparator)),
500  tooltip, font, Common::UNK_LANG, useEllipsis),
501  _path(path),
502  _placeholder(placeholder) {}
503  void setLabel(const Common::Path &path) {
504  _path = path;
505  if (path.empty()) {
506  StaticTextWidget::setLabel(_placeholder);
507  } else {
508  StaticTextWidget::setLabel(path.toString(Common::Path::kNativeSeparator));
509  }
510  }
511  const Common::Path &getLabel() const { return _path; }
512  void setEmptyPlaceHolder(const Common::U32String &placeholder) { _placeholder = placeholder; }
513 protected:
514  Common::Path _path;
515  Common::U32String _placeholder;
516 };
517 
518 /* ContainerWidget */
519 class ContainerWidget : public Widget {
520 public:
521  ContainerWidget(GuiObject *boss, int x, int y, int w, int h, bool scale = false);
522  ContainerWidget(GuiObject *boss, const Common::String &name);
523  ~ContainerWidget() override;
524 
525  bool containsWidget(Widget *) const override;
526  Widget *findWidget(int x, int y) override;
527  void removeWidget(Widget *widget) override;
528 
529  void setBackgroundType(ThemeEngine::WidgetBackground backgroundType);
530 protected:
531  void drawWidget() override;
532 
533  ThemeEngine::WidgetBackground _backgroundType;
534 };
535 
536 /* OptionsContainerWidget */
538 public:
546  OptionsContainerWidget(GuiObject *boss, const Common::String &name, const Common::String &dialogLayout,
547  const Common::String &domain);
548  ~OptionsContainerWidget() override;
549 
551  virtual void load() = 0;
552 
558  virtual bool save() = 0;
559 
564  virtual bool hasKeys() { return true; }
565 
567  virtual void setEnabled(bool e) {}
568 
569  void setParentDialog(Dialog *parentDialog) { _parentDialog = parentDialog; }
570  void setDomain(const Common::String &domain) { _domain = domain; }
571 
572 protected:
573  // Widget API
574  void reflowLayout() override;
575  Common::Rect getClipRect() const override;
576  void drawWidget() override {}
577  bool containsWidget(Widget *widget) const override;
578  Widget *findWidget(int x, int y) override;
579  void removeWidget(Widget *widget) override;
580 
582  GuiObject *widgetsBoss() { return this; }
583 
589  virtual void defineLayout(ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const {}
590 
591  Common::String _domain;
592  const Common::String _dialogLayout;
593 
594  Dialog *_parentDialog;
595 };
596 
597 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);
598 
599 } // End of namespace GUI
600 
601 #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:359
Definition: widget.h:448
WidgetBackground
Widget background type.
Definition: ThemeEngine.h:226
Definition: widget.h:309
Definition: rect.h:524
Definition: path.h:52
virtual void draw()
Definition: widget.h:333
Definition: widget.h:208
virtual void defineLayout(ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const
Definition: widget.h:589
Definition: widget.h:409
Definition: widget.h:382
Definition: ThemeEval.h:37
Definition: printman.h:30
static const char kNativeSeparator
Definition: path.h:195
Definition: object.h:60
Definition: widget.h:537
Definition: widget.h:468
bool empty() const
Definition: path.h:353
Definition: ustr.h:57
virtual bool hasKeys()
Definition: widget.h:564
virtual Common::Rect getClipRect() const
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:582
Definition: dialog.h:49
A bold font. This is also the default font.
Definition: ThemeEngine.h:275
Definition: widget.h:273
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:567
Definition: widget.h:289
Definition: widget.h:519
Definition: widget.h:236
Definition: object.h:40
Language
Definition: language.h:45