diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-15 04:22:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-15 04:22:11 +0300 |
commit | c91bc5201596eda73f9df2222d76d9f413426a85 (patch) | |
tree | cbdcf7fb76eee35baf7265e5c04da2f13633ab5d /src/guichan/widgets/checkbox.cpp | |
parent | 255b1c29f47ef3b1e7a9b058c56ef72bfa10c5e3 (diff) | |
download | plus-c91bc5201596eda73f9df2222d76d9f413426a85.tar.gz plus-c91bc5201596eda73f9df2222d76d9f413426a85.tar.bz2 plus-c91bc5201596eda73f9df2222d76d9f413426a85.tar.xz plus-c91bc5201596eda73f9df2222d76d9f413426a85.zip |
Remove some diplicated code from embeded guichan.
Diffstat (limited to 'src/guichan/widgets/checkbox.cpp')
-rw-r--r-- | src/guichan/widgets/checkbox.cpp | 51 |
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; |