diff options
Diffstat (limited to 'src/gui/window.cpp')
-rw-r--r-- | src/gui/window.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp index 476dcd7e..3bc03fb8 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -1,9 +1,8 @@ /* - * Aethyra + * The Mana World * Copyright (C) 2004 The Mana World Development Team * - * This file is part of Aethyra based on original code - * from The Mana World. + * This file is part of The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,7 +38,7 @@ int Window::instances = 0; int Window::mouseResize = 0; -Window::Window(const std::string& caption, bool modal, Window *parent, const std::string& skin): +Window::Window(const std::string &caption, bool modal, Window *parent, const std::string &skin): gcn::Window(caption), mGrip(0), mParent(parent), @@ -248,7 +247,7 @@ void Window::setResizable(bool r) if (r) { - mGrip = new ResizeGrip(); + mGrip = new ResizeGrip; mGrip->setX(getWidth() - mGrip->getWidth() - getChildrenArea().x); mGrip->setY(getHeight() - mGrip->getHeight() - getChildrenArea().y); add(mGrip); @@ -282,7 +281,7 @@ void Window::setCloseButton(bool flag) mCloseButton = flag; } -bool Window::isResizable() +bool Window::isResizable() const { return mGrip; } @@ -546,6 +545,14 @@ void Window::setDefaultSize(int defaultX, int defaultY, mDefaultHeight = defaultHeight; } +void Window::setDefaultSize() +{ + mDefaultX = getX(); + mDefaultY = getY(); + mDefaultWidth = getWidth(); + mDefaultHeight = getHeight(); +} + void Window::setDefaultSize(int defaultWidth, int defaultHeight, ImageRect::ImagePosition position, int offsetX, int offsetY) @@ -666,3 +673,7 @@ void Window::reflowLayout(int w, int h) setContentSize(w, h); } +void Window::center() +{ + setLocationRelativeTo(getParent()); +} |