summaryrefslogtreecommitdiff
path: root/src/guichan/widgets/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/guichan/widgets/window.cpp')
-rw-r--r--src/guichan/widgets/window.cpp91
1 files changed, 0 insertions, 91 deletions
diff --git a/src/guichan/widgets/window.cpp b/src/guichan/widgets/window.cpp
index d0ba32f47..550b23749 100644
--- a/src/guichan/widgets/window.cpp
+++ b/src/guichan/widgets/window.cpp
@@ -125,97 +125,6 @@ namespace gcn
return mAlignment;
}
- void Window::draw(Graphics* graphics)
- {
- const Color &faceColor = getBaseColor();
- Color highlightColor, shadowColor;
- const int alpha = getBaseColor().a;
- highlightColor = faceColor + 0x303030;
- highlightColor.a = alpha;
- shadowColor = faceColor - 0x303030;
- shadowColor.a = alpha;
-
- Rectangle d = getChildrenArea();
-
- // Fill the background around the content
- graphics->setColor(faceColor);
- // Fill top
- graphics->fillRectangle(Rectangle(0, 0, getWidth(), d.y - 1));
- // Fill left
- graphics->fillRectangle(Rectangle(0, d.y - 1, d.x - 1,
- getHeight() - d.y + 1));
- // Fill right
- graphics->fillRectangle(Rectangle(d.x + d.width + 1, d.y - 1,
- getWidth() - d.x - d.width - 1, getHeight() - d.y + 1));
- // Fill bottom
- graphics->fillRectangle(Rectangle(d.x - 1, d.y + d.height + 1,
- d.width + 2, getHeight() - d.height - d.y - 1));
-
- if (isOpaque())
- graphics->fillRectangle(d);
-
- // Construct a rectangle one pixel bigger than the content
- d.x -= 1;
- d.y -= 1;
- d.width += 2;
- d.height += 2;
-
- // Draw a border around the content
- graphics->setColor(shadowColor);
- // Top line
- graphics->drawLine(d.x,
- d.y,
- d.x + d.width - 2,
- d.y);
-
- // Left line
- graphics->drawLine(d.x,
- d.y + 1,
- d.x,
- d.y + d.height - 1);
-
- graphics->setColor(highlightColor);
- // Right line
- graphics->drawLine(d.x + d.width - 1,
- d.y,
- d.x + d.width - 1,
- d.y + d.height - 2);
- // Bottom line
- graphics->drawLine(d.x + 1,
- d.y + d.height - 1,
- d.x + d.width - 1,
- d.y + d.height - 1);
-
- drawChildren(graphics);
-
- int textX;
- int textY;
-
- textY = ((int)getTitleBarHeight() - getFont()->getHeight()) / 2;
-
- switch (getAlignment())
- {
- case Graphics::LEFT:
- textX = 4;
- break;
- case Graphics::CENTER:
- textX = getWidth() / 2;
- break;
- case Graphics::RIGHT:
- textX = getWidth() - 4;
- break;
- default:
- throw GCN_EXCEPTION("Unknown alignment.");
- }
-
- graphics->setColor(getForegroundColor());
- graphics->setFont(getFont());
- graphics->pushClipArea(Rectangle(0, 0, getWidth(),
- getTitleBarHeight() - 1));
- graphics->drawText(getCaption(), textX, textY, getAlignment());
- graphics->popClipArea();
- }
-
void Window::mousePressed(MouseEvent& mouseEvent)
{
if (mouseEvent.getSource() != this)