summaryrefslogtreecommitdiff
path: root/src/gui/window.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/window.h')
-rw-r--r--src/gui/window.h77
1 files changed, 7 insertions, 70 deletions
diff --git a/src/gui/window.h b/src/gui/window.h
index 18f97cec..9ca435a9 100644
--- a/src/gui/window.h
+++ b/src/gui/window.h
@@ -25,11 +25,10 @@
#define _TMW_WINDOW_H__
#include <guichan/widgets/window.hpp>
+#include <guichan/widgetlistener.hpp>
#include "../guichanfwd.h"
-#include "windowlistener.h"
-
class ConfigListener;
class GCContainer;
class ImageRect;
@@ -43,7 +42,7 @@ class Image;
*
* \ingroup GUI
*/
-class Window : public gcn::Window
+class Window : public gcn::Window, gcn::WidgetListener
{
public:
friend class WindowConfigListener;
@@ -87,56 +86,11 @@ class Window : public gcn::Window
void add(gcn::Widget *w, int x, int y, bool delChild = true);
/**
- * Sets the width of the window contents.
- */
- void setContentWidth(int width);
-
- /**
- * Sets the height of the window contents.
- */
- void setContentHeight(int height);
-
- /**
* Sets the size of this window.
*/
void setContentSize(int width, int height);
/**
- * Sets the size of this window.
- */
- void setSize(int width, int height);
-
- /**
- * Sets the width of this window.
- */
- void setWidth(int width);
-
- /**
- * Sets the height of this window.
- */
- void setHeight(int height);
-
- /**
- * Sets the position and size of this window.
- */
- void setDimension(const gcn::Rectangle &dimension);
-
- /**
- * Sets the position of this window.
- */
- void setPosition(int x, int y);
-
- /**
- * Sets the window x coordinate.
- */
- void setX(int x);
-
- /**
- * Sets the window y coordinate.
- */
- void setY(int y);
-
- /**
* Sets the location relative to the given widget.
*/
void setLocationRelativeTo(gcn::Widget *widget);
@@ -147,6 +101,11 @@ class Window : public gcn::Window
void setResizable(bool resize);
/**
+ * Called whenever the widget changes size.
+ */
+ void widgetResized(const gcn::Event &event);
+
+ /**
* Sets whether or not the window has a close button.
*/
void setCloseButton(bool flag);
@@ -276,20 +235,6 @@ class Window : public gcn::Window
*/
virtual void resetToDefaultSize();
- /**
- * Adds a listener to the list that's notified when the window is
- * moved or resized.
- */
- void addWindowListener(WindowListener *listener)
- { mListeners.push_back(listener); }
-
- /**
- * Removes a listener from the list that's notified when the window is
- * moved or resized.
- */
- void removeWindowListener(WindowListener *listener)
- { mListeners.remove(listener); }
-
enum ResizeHandles
{
TOP = 0x01,
@@ -344,14 +289,6 @@ class Window : public gcn::Window
* where two borders are moved at the same time.
*/
static const int resizeBorderWidth = 10;
-
- private:
- /**
- * Sends out a window event to the list of selection listeners.
- */
- void fireWindowEvent(const WindowEvent &event);
-
- WindowListeners mListeners;
};
#endif