aboutsummaryrefslogtreecommitdiff
path: root/gui/widget.cpp
diff options
context:
space:
mode:
authorMax Horn2003-11-02 02:18:16 +0000
committerMax Horn2003-11-02 02:18:16 +0000
commitb27a871f870df854a6db0f4530d4596483927bb1 (patch)
treef6c75300cd5dcd22b67044256e36a01f985a054d /gui/widget.cpp
parentf2c4bbbdbfb06b5296eb3fcdcb7235292e6ac039 (diff)
downloadscummvm-rg350-b27a871f870df854a6db0f4530d4596483927bb1.tar.gz
scummvm-rg350-b27a871f870df854a6db0f4530d4596483927bb1.tar.bz2
scummvm-rg350-b27a871f870df854a6db0f4530d4596483927bb1.zip
turned NewGui into a singleton, and made OSystem a pseudo-singleton; added Widget::findWidget (preparing to add support for nested widgets, for the tab widget)
svn-id: r11045
Diffstat (limited to 'gui/widget.cpp')
-rw-r--r--gui/widget.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp
index ea032b1bc5..f20dbf4624 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -23,7 +23,7 @@
#include "dialog.h"
#include "newgui.h"
-Widget::Widget (Dialog *boss, int x, int y, int w, int h)
+Widget::Widget(Dialog *boss, int x, int y, int w, int h)
: _type(0), _boss(boss), _x(x), _y(y), _w(w), _h(h),
_id(0), _flags(0), _hasFocus(false) {
// Insert into the widget list of the boss
@@ -32,7 +32,7 @@ Widget::Widget (Dialog *boss, int x, int y, int w, int h)
}
void Widget::draw() {
- NewGui *gui = _boss->getGui();
+ NewGui *gui = &g_gui;
if (!isVisible() || !_boss->isVisible())
return;
@@ -75,7 +75,7 @@ void Widget::draw() {
#pragma mark -
StaticTextWidget::StaticTextWidget(Dialog *boss, int x, int y, int w, int h, const String &text, int align)
- : Widget (boss, x, y, w, h), _align(align) {
+ : Widget(boss, x, y, w, h), _align(align) {
_type = kStaticTextWidget;
setLabel(text);
}
@@ -87,7 +87,7 @@ void StaticTextWidget::setValue(int value) {
}
void StaticTextWidget::drawWidget(bool hilite) {
- NewGui *gui = _boss->getGui();
+ NewGui *gui = &g_gui;
gui->drawString(_label, _x, _y, _w, gui->_textcolor, _align);
}
@@ -106,7 +106,7 @@ void ButtonWidget::handleMouseUp(int x, int y, int button, int clickCount) {
}
void ButtonWidget::drawWidget(bool hilite) {
- NewGui *gui = _boss->getGui();
+ NewGui *gui = &g_gui;
gui->drawString(_label, _x, _y, _w,
!isEnabled() ? gui->_color :
hilite ? gui->_textcolorhi : gui->_textcolor, _align);
@@ -156,7 +156,7 @@ void CheckboxWidget::handleMouseUp(int x, int y, int button, int clickCount) {
}
void CheckboxWidget::drawWidget(bool hilite) {
- NewGui *gui = _boss->getGui();
+ NewGui *gui = &g_gui;
// Draw the box
gui->box(_x, _y, 14, 14);
@@ -213,7 +213,7 @@ void SliderWidget::handleMouseUp(int x, int y, int button, int clickCount) {
}
void SliderWidget::drawWidget(bool hilite) {
- NewGui *gui = _boss->getGui();
+ NewGui *gui = &g_gui;
// Draw the box
gui->box(_x, _y, _w, _h);