summaryrefslogtreecommitdiff
path: root/src/guichan/widgets/button.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-14 17:39:14 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-14 20:37:31 +0300
commit9fc07b15f1b051eecd662802162772804dc77b8e (patch)
treed100d50693fc19edb32d01b9189603bdd3254bd2 /src/guichan/widgets/button.cpp
parent78ae06d2c7b565afe67c5032c872d68a74ea210a (diff)
downloadmv-9fc07b15f1b051eecd662802162772804dc77b8e.tar.gz
mv-9fc07b15f1b051eecd662802162772804dc77b8e.tar.bz2
mv-9fc07b15f1b051eecd662802162772804dc77b8e.tar.xz
mv-9fc07b15f1b051eecd662802162772804dc77b8e.zip
Rename class InventoryFilter to RadioGroup.
Add WidgetGroup and TabStrip classes for grouping controls.
Diffstat (limited to 'src/guichan/widgets/button.cpp')
-rw-r--r--src/guichan/widgets/button.cpp81
1 files changed, 0 insertions, 81 deletions
diff --git a/src/guichan/widgets/button.cpp b/src/guichan/widgets/button.cpp
index 42dc686f0..f30c890b4 100644
--- a/src/guichan/widgets/button.cpp
+++ b/src/guichan/widgets/button.cpp
@@ -122,83 +122,6 @@ namespace gcn
return mSpacing;
}
-/*
- void Button::draw(Graphics* graphics)
- {
- Color faceColor = getBaseColor();
- Color highlightColor, shadowColor;
- int alpha = getBaseColor().a;
-
- if (isPressed())
- {
- faceColor = faceColor - 0x303030;
- faceColor.a = alpha;
- highlightColor = faceColor - 0x303030;
- highlightColor.a = alpha;
- shadowColor = faceColor + 0x303030;
- shadowColor.a = alpha;
- }
- else
- {
- highlightColor = faceColor + 0x303030;
- highlightColor.a = alpha;
- shadowColor = faceColor - 0x303030;
- shadowColor.a = alpha;
- }
-
- graphics->setColor(faceColor);
- graphics->fillRectangle(Rectangle(1, 1,
- getDimension().width - 1, getHeight() - 1));
-
- graphics->setColor(highlightColor);
- graphics->drawLine(0, 0, getWidth() - 1, 0);
- graphics->drawLine(0, 1, 0, getHeight() - 1);
-
- graphics->setColor(shadowColor);
- graphics->drawLine(getWidth() - 1, 1, getWidth() - 1, getHeight() - 1);
- graphics->drawLine(1, getHeight() - 1,
- getWidth() - 1, getHeight() - 1);
-
- graphics->setColor(getForegroundColor());
-
- int textX;
- int textY = getHeight() / 2 - getFont()->getHeight() / 2;
-
- switch (getAlignment())
- {
- case Graphics::LEFT:
- textX = mSpacing;
- break;
- case Graphics::CENTER:
- textX = getWidth() / 2;
- break;
- case Graphics::RIGHT:
- textX = getWidth() - mSpacing;
- break;
- default:
- throw GCN_EXCEPTION("Unknown alignment.");
- }
-
- graphics->setFont(getFont());
-
- if (isPressed())
- {
- graphics->drawText(getCaption(), textX + 1, textY + 1,
- getAlignment());
- }
- else
- {
- graphics->drawText(getCaption(), textX, textY, getAlignment());
-
- if (isFocused())
- {
- graphics->drawRectangle(Rectangle(2, 2, getWidth() - 4,
- getHeight() - 4));
- }
- }
- }
-*/
-
void Button::adjustSize()
{
setWidth(getFont()->getWidth(mCaption) + 2*mSpacing);
@@ -208,13 +131,9 @@ namespace gcn
bool Button::isPressed() const
{
if (mMousePressed)
- {
return mHasMouse;
- }
else
- {
return mKeyPressed;
- }
}
void Button::mousePressed(MouseEvent& mouseEvent)