From 58ffdbff028f763451f471639c6aecc530ca4d94 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Mon, 21 Mar 2005 21:27:59 +0000 Subject: Some cleanups and button, radiobutton and checkbox now take into account disabled status. --- src/gui/button.cpp | 2 +- src/gui/checkbox.cpp | 12 ++++++------ src/gui/radiobutton.cpp | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/gui') diff --git a/src/gui/button.cpp b/src/gui/button.cpp index c508afe2..fb1a01ec 100644 --- a/src/gui/button.cpp +++ b/src/gui/button.cpp @@ -57,7 +57,7 @@ Button::Button(const std::string& caption): void Button::draw(gcn::Graphics* graphics) { int mode; - if (false /*disabled*/) { + if (!isEnabled()) { mode = 3; } else if (isPressed()) { diff --git a/src/gui/checkbox.cpp b/src/gui/checkbox.cpp index 88b3f975..b231ec64 100644 --- a/src/gui/checkbox.cpp +++ b/src/gui/checkbox.cpp @@ -43,15 +43,15 @@ void CheckBox::drawBox(gcn::Graphics* graphics) { getAbsolutePosition(x, y); if (mMarked) { - if (false /*disabled*/) { - box = checkBoxDisabledChecked; - } else { + if (isEnabled()) { box = checkBoxChecked; + } else { + box = checkBoxDisabledChecked; } - } else if (false /*disabled*/) { - box = checkBoxDisabled; - } else { + } else if (isEnabled()) { box = checkBoxNormal; + } else { + box = checkBoxDisabled; } x += 2; diff --git a/src/gui/radiobutton.cpp b/src/gui/radiobutton.cpp index de2d4f68..a7115752 100644 --- a/src/gui/radiobutton.cpp +++ b/src/gui/radiobutton.cpp @@ -43,15 +43,15 @@ void RadioButton::drawBox(gcn::Graphics* graphics) getAbsolutePosition(x, y); if (mMarked) { - if (false /*disabled*/) { - box = radioDisabledChecked; - } else { + if (isEnabled()) { box = radioChecked; + } else { + box = radioDisabledChecked; } - } else if (false /*disabled*/) { - box = radioDisabled; - } else { + } else if (isEnabled()) { box = radioNormal; + } else { + box = radioDisabled; } x += 2; -- cgit v1.2.3-70-g09d2