diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-27 13:25:04 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-27 13:25:24 +0100 |
commit | dd05447445dc1766e532130318af2cb6bb72a994 (patch) | |
tree | c8b2cbac64ccf9545a39c143088b57fe2cb8e678 /src/gui/popup.h | |
parent | 05e753294c1a603252d2eed4b1731c3f50543a7e (diff) | |
parent | 2aab736bc5d77ffda789d7de56cef100fac207e1 (diff) | |
download | mana-client-dd05447445dc1766e532130318af2cb6bb72a994.tar.gz mana-client-dd05447445dc1766e532130318af2cb6bb72a994.tar.bz2 mana-client-dd05447445dc1766e532130318af2cb6bb72a994.tar.xz mana-client-dd05447445dc1766e532130318af2cb6bb72a994.zip |
Merge branch 'aethyra/master'
Conflicts:
src/beingmanager.cpp
src/gui/confirm_dialog.cpp
src/gui/inventorywindow.cpp
src/gui/inventorywindow.h
src/gui/label.cpp
src/gui/label.h
src/gui/popup.cpp
src/gui/popup.h
src/gui/scrollarea.cpp
src/gui/skin.cpp
src/gui/skin.h
src/gui/speechbubble.cpp
src/gui/window.cpp
src/gui/window.h
src/localplayer.h
src/main.cpp
src/net/ea/playerhandler.cpp
src/resources/ambientoverlay.h
src/resources/dye.cpp
src/resources/imagewriter.cpp
src/resources/itemdb.cpp
src/shopitem.cpp
Diffstat (limited to 'src/gui/popup.h')
-rw-r--r-- | src/gui/popup.h | 65 |
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 |