Popup Class Reference
[Core GUI related classes (widgets)]

#include <popup.h>

Inheritance diagram for Popup:

Container ItemPopup MenuWindow MiniStatusWindow PopupMenu SpeechBubble

List of all members.


Detailed Description

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.

Definition at line 44 of file popup.h.


Public Member Functions

 Popup (const std::string &name="", const std::string &skin="graphics/gui/gui.xml")
 Constructor.
 ~Popup ()
 Destructor.
void loadPopupConfiguration ()
 Changes the popup's skin to use the skin defined in the saved configuration file.
void savePopupConfiguration ()
 Currently only saves the skin used by the popup so that when the client is reloaded, it can use the saved skin.
void draw (gcn::Graphics *graphics)
 Draws the popup.
void setContentSize (int width, int height)
 Sets the size of this popup.
void setLocationRelativeTo (gcn::Widget *widget)
 Sets the location relative to the given widget.
void setMinWidth (int width)
 Sets the minimum width of the popup.
int getMinWidth () const
void setMinHeight (int height)
 Sets the minimum height of the popup.
int getMinHeight () const
void setMaxWidth (int width)
 Sets the maximum width of the popup.
int getMaxWidth () const
void setMaxHeight (int height)
 Sets the minimum height of the popup.
int getMaxHeight () const
int getPadding () const
 Gets the padding of the popup.
void setPadding (int padding)
void setPopupName (const std::string &name)
 Sets the name of the popup.
const std::string & getPopupName () const
void scheduleDelete ()
 Schedule this popup for deletion.
virtual gcn::Rectangle getChildrenArea ()

Static Public Member Functions

static void setWindowContainer (WindowContainer *windowContainer)
 Sets the window container to be used by new popups.

Private Attributes

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.
SkinmSkin
 Skin in use by this popup.

Constructor & Destructor Documentation

Popup::Popup ( const std::string &  name = "",
const std::string &  skin = "graphics/gui/gui.xml" 
)

Constructor.

Initializes the title to the given text and hooks itself into the popup container.

Parameters:
name A human readable name for the popup. Only useful for debugging purposes.
skin The location where the Popup's skin XML can be found.

Definition at line 37 of file popup.cpp.

Popup::~Popup (  ) 

Destructor.

Deletes all the added widgets.

Definition at line 62 of file popup.cpp.


Member Function Documentation

void Popup::setWindowContainer ( WindowContainer windowContainer  )  [static]

Sets the window container to be used by new popups.

Definition at line 71 of file popup.cpp.

void Popup::loadPopupConfiguration (  ) 

Changes the popup's skin to use the skin defined in the saved configuration file.

Definition at line 76 of file popup.cpp.

void Popup::savePopupConfiguration (  ) 

Currently only saves the skin used by the popup so that when the client is reloaded, it can use the saved skin.

Definition at line 92 of file popup.cpp.

void Popup::draw ( gcn::Graphics *  graphics  ) 

Draws the popup.

Reimplemented in MenuWindow, and MiniStatusWindow.

Definition at line 104 of file popup.cpp.

void Popup::setContentSize ( int  width,
int  height 
)

Sets the size of this popup.

Definition at line 119 of file popup.cpp.

void Popup::setLocationRelativeTo ( gcn::Widget *  widget  ) 

Sets the location relative to the given widget.

Definition at line 136 of file popup.cpp.

void Popup::setMinWidth ( int  width  ) 

Sets the minimum width of the popup.

Definition at line 148 of file popup.cpp.

int Popup::getMinWidth (  )  const [inline]

Definition at line 100 of file popup.h.

void Popup::setMinHeight ( int  height  ) 

Sets the minimum height of the popup.

Definition at line 153 of file popup.cpp.

int Popup::getMinHeight (  )  const [inline]

Definition at line 107 of file popup.h.

void Popup::setMaxWidth ( int  width  ) 

Sets the maximum width of the popup.

Definition at line 158 of file popup.cpp.

int Popup::getMaxWidth (  )  const [inline]

Definition at line 114 of file popup.h.

void Popup::setMaxHeight ( int  height  ) 

Sets the minimum height of the popup.

Definition at line 163 of file popup.cpp.

int Popup::getMaxHeight (  )  const [inline]

Definition at line 121 of file popup.h.

int Popup::getPadding (  )  const [inline]

Gets the padding of the popup.

The padding is the distance between the popup border and the content.

Returns:
The padding of the popup.
See also:
setPadding

Definition at line 130 of file popup.h.

void Popup::setPadding ( int  padding  )  [inline]

Definition at line 132 of file popup.h.

void Popup::setPopupName ( const std::string &  name  )  [inline]

Sets the name of the popup.

This is only useful for debug purposes.

Definition at line 137 of file popup.h.

const std::string& Popup::getPopupName (  )  const [inline]

Definition at line 140 of file popup.h.

void Popup::scheduleDelete (  ) 

Schedule this popup for deletion.

It will be deleted at the start of the next logic update.

Definition at line 168 of file popup.cpp.

gcn::Rectangle Popup::getChildrenArea ( void   )  [virtual]

Definition at line 113 of file popup.cpp.


Member Data Documentation

std::string Popup::mPopupName [private]

Name of the popup.

Definition at line 154 of file popup.h.

std::string Popup::mDefaultSkinPath [private]

Default skin path for this popup.

Definition at line 155 of file popup.h.

int Popup::mMinWidth [private]

Minimum popup width.

Definition at line 156 of file popup.h.

int Popup::mMinHeight [private]

Minimum popup height.

Definition at line 157 of file popup.h.

int Popup::mMaxWidth [private]

Maximum popup width.

Definition at line 158 of file popup.h.

int Popup::mMaxHeight [private]

Maximum popup height.

Definition at line 159 of file popup.h.

int Popup::mPadding [private]

Holds the padding of the popup.

Definition at line 160 of file popup.h.

Skin* Popup::mSkin [private]

Skin in use by this popup.

Definition at line 162 of file popup.h.


The documentation for this class was generated from the following files:

Generated on Sun Apr 26 17:30:43 2009 for The Mana World by  doxygen 1.5.5