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 df756be3..9f5969f0 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 ContainerPlacer;
class Image;
@@ -45,7 +44,7 @@ class WindowContainer;
*
* \ingroup GUI
*/
-class Window : public gcn::Window
+class Window : public gcn::Window, gcn::WidgetListener
{
public:
friend class WindowConfigListener;
@@ -79,56 +78,11 @@ class Window : public gcn::Window
void draw(gcn::Graphics *graphics);
/**
- * 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);
@@ -139,6 +93,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);
@@ -256,20 +215,6 @@ class Window : public gcn::Window
*/
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,
@@ -349,14 +294,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