summaryrefslogtreecommitdiff
path: root/src/guichan/widgets/radiobutton.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-15 04:22:11 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-15 04:22:11 +0300
commitc91bc5201596eda73f9df2222d76d9f413426a85 (patch)
treecbdcf7fb76eee35baf7265e5c04da2f13633ab5d /src/guichan/widgets/radiobutton.cpp
parent255b1c29f47ef3b1e7a9b058c56ef72bfa10c5e3 (diff)
downloadmv-c91bc5201596eda73f9df2222d76d9f413426a85.tar.gz
mv-c91bc5201596eda73f9df2222d76d9f413426a85.tar.bz2
mv-c91bc5201596eda73f9df2222d76d9f413426a85.tar.xz
mv-c91bc5201596eda73f9df2222d76d9f413426a85.zip
Remove some diplicated code from embeded guichan.
Diffstat (limited to 'src/guichan/widgets/radiobutton.cpp')
-rw-r--r--src/guichan/widgets/radiobutton.cpp81
1 files changed, 0 insertions, 81 deletions
diff --git a/src/guichan/widgets/radiobutton.cpp b/src/guichan/widgets/radiobutton.cpp
index 37fd4a0f0..48a690767 100644
--- a/src/guichan/widgets/radiobutton.cpp
+++ b/src/guichan/widgets/radiobutton.cpp
@@ -93,87 +93,6 @@ namespace gcn
setGroup("");
}
- void RadioButton::draw(Graphics* graphics)
- {
- graphics->pushClipArea(Rectangle(1, 1,
- getWidth() - 1, getHeight() - 1));
-
- drawBox(graphics);
- graphics->popClipArea();
-
- graphics->setFont(getFont());
- graphics->setColor(getForegroundColor());
-
- if (isFocused())
- {
- int fh;
-
- if (getHeight() % 2 == 0)
- fh = getHeight() - 4;
- else
- fh = getHeight() - 3;
-
- int hh = (fh + 1) / 2;
-
- graphics->drawLine(0, hh + 1, hh + 1, 0);
- graphics->drawLine(hh + 2, 1, fh + 2, hh + 1);
- graphics->drawLine(fh + 1, hh + 2, hh + 1, fh + 2);
- graphics->drawLine(hh + 1, fh + 2, 1, hh + 2);
- }
-
- int h = getHeight() + getHeight() / 2;
-
- graphics->drawText(getCaption(), h - 2, 0);
- }
-
- void RadioButton::drawBox(Graphics *graphics)
- {
- int h;
-
- if (getHeight() % 2 == 0)
- h = getHeight() - 4;
- else
- h = getHeight() - 3;
-
- int alpha = getBaseColor().a;
- Color faceColor = getBaseColor();
- faceColor.a = alpha;
- Color highlightColor = faceColor + 0x303030;
- highlightColor.a = alpha;
- Color shadowColor = faceColor - 0x303030;
- shadowColor.a = alpha;
-
- graphics->setColor(getBackgroundColor());
-
- int i;
- int hh = (h + 1) / 2;
-
- for (i = 1; i <= hh; ++i)
- graphics->drawLine(hh - i + 1, i, hh + i - 1, i);
-
- for (i = 1; i < hh; ++i)
- graphics->drawLine(hh - i + 1, h - i, hh + i - 1, h - i);
-
- graphics->setColor(shadowColor);
- graphics->drawLine(hh, 0, 0, hh);
- graphics->drawLine(hh + 1, 1, h - 1, hh - 1);
-
- graphics->setColor(highlightColor);
- graphics->drawLine(1, hh + 1, hh, h);
- graphics->drawLine(hh + 1, h - 1, h, hh);
-
- graphics->setColor(getForegroundColor());
-
- int hhh = hh - 3;
- if (mSelected)
- {
- for (i = 0; i < hhh; ++i)
- graphics->drawLine(hh - i, 4 + i, hh + i, 4 + i);
- for (i = 0; i < hhh; ++i)
- graphics->drawLine(hh - i, h - 4 - i, hh + i, h - 4 - i);
- }
- }
-
bool RadioButton::isSelected() const
{
return mSelected;