aboutsummaryrefslogtreecommitdiff
path: root/gui/widget.cpp
diff options
context:
space:
mode:
authorMax Horn2002-10-01 23:11:19 +0000
committerMax Horn2002-10-01 23:11:19 +0000
commit3d7552890a52067ed493c63522fb11bb13ed72bd (patch)
treeab6bb989f3a36b00cc8f6c15337aba640c1a1cd1 /gui/widget.cpp
parent1e626a712828e630d0a8583ab1a9a0b838d2d6cf (diff)
downloadscummvm-rg350-3d7552890a52067ed493c63522fb11bb13ed72bd.tar.gz
scummvm-rg350-3d7552890a52067ed493c63522fb11bb13ed72bd.tar.bz2
scummvm-rg350-3d7552890a52067ed493c63522fb11bb13ed72bd.zip
fixed ListWidget drawin/behaviour if there are less items than fit on one page; enhanced launcher dialog to disable start button if nothing is selected
svn-id: r5068
Diffstat (limited to 'gui/widget.cpp')
-rw-r--r--gui/widget.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 3788e4d237..39c2a6b69b 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -23,11 +23,16 @@
#include "dialog.h"
#include "newgui.h"
+
+
#ifdef _MSC_VER
+
# pragma warning( disable : 4068 ) // unknown pragma
+
#endif
+
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)
@@ -98,7 +103,9 @@ void StaticTextWidget::setValue(int value)
void StaticTextWidget::drawWidget(bool hilite)
{
NewGui *gui = _boss->getGui();
- gui->drawString(_label.c_str(), _x, _y, _w, hilite ? gui->_textcolorhi : gui->_textcolor, _align);
+ gui->drawString(_label.c_str(), _x, _y, _w,
+ !isEnabled() ? gui->_color :
+ hilite ? gui->_textcolorhi : gui->_textcolor, _align);
}
@@ -114,7 +121,7 @@ ButtonWidget::ButtonWidget(Dialog *boss, int x, int y, int w, int h, const Strin
void ButtonWidget::handleMouseUp(int x, int y, int button, int clickCount)
{
- if (_flags & WIDGET_ENABLED && x >= 0 && x < _w && y >= 0 && y < _h)
+ if (isEnabled() && x >= 0 && x < _w && y >= 0 && y < _h)
sendCommand(_cmd, 0);
}
@@ -142,7 +149,7 @@ CheckboxWidget::CheckboxWidget(Dialog *boss, int x, int y, int w, int h, const S
void CheckboxWidget::handleMouseDown(int x, int y, int button, int clickCount)
{
- if (_flags & WIDGET_ENABLED) {
+ if (isEnabled()) {
_state = !_state;
draw();
sendCommand(_cmd, 0);
@@ -177,7 +184,7 @@ SliderWidget::SliderWidget(Dialog *boss, int x, int y, int w, int h, const Strin
}
void SliderWidget::handleMouseMoved(int x, int y, int button) {
- if ((_flags & WIDGET_ENABLED) && _isDragging) {
+ if (isEnabled() && _isDragging) {
int newValue = posToValue(x);
if (newValue < _valueMin)
@@ -195,7 +202,7 @@ void SliderWidget::handleMouseMoved(int x, int y, int button) {
void SliderWidget::handleMouseDown(int x, int y, int button, int clickCount) {
- if (_flags & WIDGET_ENABLED) {
+ if (isEnabled()) {
int barx;
barx = valueToPos(_value);
@@ -208,7 +215,7 @@ void SliderWidget::handleMouseDown(int x, int y, int button, int clickCount) {
void SliderWidget::handleMouseUp(int x, int y, int button, int clickCount) {
- if ((_flags & WIDGET_ENABLED) && _isDragging) {
+ if (isEnabled() && _isDragging) {
sendCommand(_cmd, _value);
}