summaryrefslogtreecommitdiff
path: root/src/guichan/widgets/checkbox.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/checkbox.cpp
parent255b1c29f47ef3b1e7a9b058c56ef72bfa10c5e3 (diff)
downloadmanaplus-c91bc5201596eda73f9df2222d76d9f413426a85.tar.gz
manaplus-c91bc5201596eda73f9df2222d76d9f413426a85.tar.bz2
manaplus-c91bc5201596eda73f9df2222d76d9f413426a85.tar.xz
manaplus-c91bc5201596eda73f9df2222d76d9f413426a85.zip
Remove some diplicated code from embeded guichan.
Diffstat (limited to 'src/guichan/widgets/checkbox.cpp')
-rw-r--r--src/guichan/widgets/checkbox.cpp51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/guichan/widgets/checkbox.cpp b/src/guichan/widgets/checkbox.cpp
index 04423a6e9..89fee153e 100644
--- a/src/guichan/widgets/checkbox.cpp
+++ b/src/guichan/widgets/checkbox.cpp
@@ -78,57 +78,6 @@ namespace gcn
adjustSize();
}
- void CheckBox::draw(Graphics* graphics)
- {
- drawBox(graphics);
-
- graphics->setFont(getFont());
- graphics->setColor(getForegroundColor());
-
- const int h = getHeight() + getHeight() / 2;
-
- graphics->drawText(getCaption(), h - 2, 0);
- }
-
- void CheckBox::drawBox(Graphics *graphics)
- {
- const int h = getHeight() - 2;
- const 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(shadowColor);
- graphics->drawLine(1, 1, h, 1);
- graphics->drawLine(1, 1, 1, h);
-
- graphics->setColor(highlightColor);
- graphics->drawLine(h, 1, h, h);
- graphics->drawLine(1, h, h - 1, h);
-
- graphics->setColor(getBackgroundColor());
- graphics->fillRectangle(Rectangle(2, 2, h - 2, h - 2));
-
- graphics->setColor(getForegroundColor());
-
- if (isFocused())
- {
- graphics->drawRectangle(Rectangle(0, 0, h + 2, h + 2));
- }
-
- if (mSelected)
- {
- graphics->drawLine(3, 5, 3, h - 2);
- graphics->drawLine(4, 5, 4, h - 2);
-
- graphics->drawLine(5, h - 3, h - 2, 4);
- graphics->drawLine(5, h - 4, h - 4, 5);
- }
- }
-
bool CheckBox::isSelected() const
{
return mSelected;