summaryrefslogtreecommitdiff
path: root/src/gui/popup.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/popup.h')
-rw-r--r--src/gui/popup.h65
1 files changed, 28 insertions, 37 deletions
diff --git a/src/gui/popup.h b/src/gui/popup.h
index a0a64069..6fbe796c 100644
--- a/src/gui/popup.h
+++ b/src/gui/popup.h
@@ -25,38 +25,34 @@
#include <guichan/widgets/container.hpp>
-#include "../graphics.h"
#include "../guichanfwd.h"
-class ConfigListener;
class Skin;
class SkinLoader;
-class Window;
class WindowContainer;
/**
- * A rather reduced down version of the Window class that is particularly
- * suited for ...
+ * A rather reduced down version of the Window class that is particularly suited
+ * for popup type functionality that doesn't need to be resized or moved around
+ * by the mouse once created, but only needs to display some simple content,
+ * like a static message. Popups, in general, shouldn't also need to update
+ * their content once created, although this is not an explicit requirement to
+ * use the popup class.
*
* \ingroup GUI
*/
class Popup : public gcn::Container
{
public:
- friend class PopupConfigListener;
-
/**
* Constructor. Initializes the title to the given text and hooks
* itself into the popup container.
*
* @param name A human readable name for the popup. Only useful for
* debugging purposes.
- * @param parent The parent Window. This is the Window standing above
- * this one in the Window hiearchy. When reordering,
- * a Popup will never go below its parent Window.
* @param skin The location where the Popup's skin XML can be found.
*/
- Popup(const std::string &name = "", Window *parent = NULL,
+ Popup(const std::string &name = "",
const std::string &skin = "graphics/gui/gui.xml");
/**
@@ -70,6 +66,18 @@ class Popup : public gcn::Container
static void setWindowContainer(WindowContainer *windowContainer);
/**
+ * Changes the popup's skin to use the skin defined in the saved
+ * configuration file.
+ */
+ void loadPopupConfiguration();
+
+ /**
+ * Currently only saves the skin used by the popup so that when the
+ * client is reloaded, it can use the saved skin.
+ */
+ void savePopupConfiguration();
+
+ /**
* Draws the popup.
*/
void draw(gcn::Graphics *graphics);
@@ -124,13 +132,6 @@ class Popup : public gcn::Container
void setPadding(int padding) { mPadding = padding; }
/**
- * Returns the parent Window.
- *
- * @return The parent Window or <code>NULL</code> if there is none.
- */
- Window *getParentWindow() const { return mParent; }
-
- /**
* Sets the name of the popup. This is only useful for debug purposes.
*/
void setPopupName(const std::string &name)
@@ -150,25 +151,15 @@ class Popup : public gcn::Container
virtual gcn::Rectangle getChildrenArea();
private:
- void setGuiAlpha();
-
- Window *mParent; /**< The parent Window (if there is one) */
- std::string mPopupName; /**< Name of the Popup */
- static bool mAlphaChanged; /**< Whether the alpha percent was changed */
- int mMinWidth; /**< Minimum Popup width */
- int mMinHeight; /**< Minimum Popup height */
- int mMaxWidth; /**< Maximum Popup width */
- int mMaxHeight; /**< Maximum Popup height */
- int mPadding; /**< Holds the padding of the window. */
-
- /**
- * The config listener that listens to changes relevant to all Popups.
- */
- static ConfigListener *popupConfigListener;
-
- static int instances; /**< Number of Popup instances */
-
- Skin *mSkin; /**< Skin in use by this Popup */
+ std::string mPopupName; /**< Name of the popup */
+ std::string mDefaultSkinPath; /**< Default skin path for this popup */
+ int mMinWidth; /**< Minimum popup width */
+ int mMinHeight; /**< Minimum popup height */
+ int mMaxWidth; /**< Maximum popup width */
+ int mMaxHeight; /**< Maximum popup height */
+ int mPadding; /**< Holds the padding of the popup. */
+
+ Skin *mSkin; /**< Skin in use by this popup */
};
#endif