summaryrefslogtreecommitdiff
path: root/src/gui/window.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-13 10:20:19 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-13 10:20:19 +0000
commitd3385829ca6f7d52e21706b25b14fe1083cfe984 (patch)
treeaea368b2434a49864b33183f95b6aae36abef3b7 /src/gui/window.cpp
parent7d287027babe615e01ddcf20edc1057f7d778c58 (diff)
downloadmana-client-d3385829ca6f7d52e21706b25b14fe1083cfe984.tar.gz
mana-client-d3385829ca6f7d52e21706b25b14fe1083cfe984.tar.bz2
mana-client-d3385829ca6f7d52e21706b25b14fe1083cfe984.tar.xz
mana-client-d3385829ca6f7d52e21706b25b14fe1083cfe984.zip
Merged Guichan 0.5.0 support from guichan-0.5.0 branch, plus several updates
from the 0.1.0 branch.
Diffstat (limited to 'src/gui/window.cpp')
-rw-r--r--src/gui/window.cpp32
1 files changed, 11 insertions, 21 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 974a1d73..9edecfca 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -105,7 +105,7 @@ Window::Window(const std::string& caption, bool modal, Window *parent):
// Add chrome
mChrome = new GCContainer();
mChrome->setOpaque(false);
- setContent(mChrome);
+ gcn::Window::add(mChrome);
// Add this window to the window container
windowContainer->add(this);
@@ -180,7 +180,7 @@ void Window::draw(gcn::Graphics* graphics)
graphics->drawText(getCaption(), 7, 5, gcn::Graphics::LEFT);
}
- drawContent(graphics);
+ drawChildren(graphics);
}
void Window::setContentWidth(int width)
@@ -267,7 +267,7 @@ void Window::mousePress(int x, int y, int button)
// border, and is a candidate for a resize.
if (isResizable() && button == 1 &&
getGripDimension().isPointInRect(x, y) &&
- !getContentDimension().isPointInRect(x, y) &&
+ !getChildrenArea().isPointInRect(x, y) &&
hasMouse() &&
!(mMouseDrag && y > (int)getPadding()))
{
@@ -374,11 +374,8 @@ void Window::mouseMotion(int x, int y)
// Set the new window and content dimensions
setDimension(newDim);
-
- if (mContent != NULL && mMouseResize)
- {
- mContent->setDimension(getContentDimension());
- }
+ const gcn::Rectangle area = getChildrenArea();
+ mChrome->setSize(area.width, area.height);
}
}
@@ -406,18 +403,16 @@ Window::loadWindowState()
{
const std::string &name = mWindowName;
- setPosition((int)config.getValue(name + "WinX", getX()),
- (int)config.getValue(name + "WinY", getY()));
+ setPosition((int) config.getValue(name + "WinX", getX()),
+ (int) config.getValue(name + "WinY", getY()));
if (mResizable)
{
- setWidth((int)config.getValue(name + "WinWidth", getWidth()));
- setHeight((int)config.getValue(name + "WinHeight", getHeight()));
+ setSize((int) config.getValue(name + "WinWidth", getWidth()),
+ (int) config.getValue(name + "WinHeight", getHeight()));
- if (mContent != NULL)
- {
- mContent->setDimension(getContentDimension());
- }
+ const gcn::Rectangle area = getChildrenArea();
+ mChrome->setSize(area.width, area.height);
}
}
@@ -437,9 +432,4 @@ void Window::resetToDefaultSize()
{
setPosition(mDefaultX, mDefaultY);
setContentSize(mDefaultWidth, mDefaultHeight);
-
- if (mContent != NULL)
- {
- mContent->setDimension(getContentDimension());
- }
}