#include <emotecontainer.h>
Used to show emotes in inventory and trade dialog.
Definition at line 44 of file emotecontainer.h.
Public Member Functions | |
EmoteContainer () | |
Constructor. | |
virtual | ~EmoteContainer () |
Destructor. | |
void | draw (gcn::Graphics *graphics) |
Draws the emotes. | |
void | widgetResized (const gcn::Event &event) |
Called whenever the widget changes size. | |
void | mousePressed (gcn::MouseEvent &event) |
Handles mouse click. | |
int | getSelectedEmote () |
Returns the selected emote. | |
void | selectNone () |
Sets selected emote to NULL. | |
void | addSelectionListener (gcn::SelectionListener *listener) |
Adds a listener to the list that's notified each time a change to the selection occurs. | |
void | removeSelectionListener (gcn::SelectionListener *listener) |
Removes a listener from the list that's notified each time a change to the selection occurs. | |
Private Member Functions | |
void | setSelectedEmoteIndex (int index) |
Sets the currently selected emote. | |
void | refindSelectedEmote (void) |
Find the current emote index by the most recently used emote ID. | |
void | recalculateHeight (void) |
Determine and set the height of the container. | |
void | distributeValueChangedEvent (void) |
Sends out selection events to the list of selection listeners. | |
Private Attributes | |
std::vector< const AnimatedSprite * > | mEmoteImg |
Image * | mSelImg |
int | mSelectedEmoteIndex |
int | mMaxEmote |
std::list < gcn::SelectionListener * > | mListeners |
Static Private Attributes | |
static const int | gridWidth = 34 |
static const int | gridHeight = 36 |
EmoteContainer::EmoteContainer | ( | ) |
EmoteContainer::~EmoteContainer | ( | ) | [virtual] |
void EmoteContainer::draw | ( | gcn::Graphics * | graphics | ) |
void EmoteContainer::widgetResized | ( | const gcn::Event & | event | ) |
void EmoteContainer::mousePressed | ( | gcn::MouseEvent & | event | ) |
int EmoteContainer::getSelectedEmote | ( | ) |
void EmoteContainer::selectNone | ( | ) |
void EmoteContainer::addSelectionListener | ( | gcn::SelectionListener * | listener | ) | [inline] |
Adds a listener to the list that's notified each time a change to the selection occurs.
Definition at line 88 of file emotecontainer.h.
void EmoteContainer::removeSelectionListener | ( | gcn::SelectionListener * | listener | ) | [inline] |
Removes a listener from the list that's notified each time a change to the selection occurs.
Definition at line 97 of file emotecontainer.h.
void EmoteContainer::setSelectedEmoteIndex | ( | int | index | ) | [private] |
Sets the currently selected emote.
Invalid (e.g., negative) indices set `no emotr'.
Definition at line 136 of file emotecontainer.cpp.
void EmoteContainer::refindSelectedEmote | ( | void | ) | [private] |
Find the current emote index by the most recently used emote ID.
void EmoteContainer::recalculateHeight | ( | void | ) | [private] |
void EmoteContainer::distributeValueChangedEvent | ( | void | ) | [private] |
Sends out selection events to the list of selection listeners.
Definition at line 144 of file emotecontainer.cpp.
std::vector<const AnimatedSprite*> EmoteContainer::mEmoteImg [private] |
Definition at line 124 of file emotecontainer.h.
Image* EmoteContainer::mSelImg [private] |
Definition at line 125 of file emotecontainer.h.
int EmoteContainer::mSelectedEmoteIndex [private] |
Definition at line 126 of file emotecontainer.h.
int EmoteContainer::mMaxEmote [private] |
Definition at line 128 of file emotecontainer.h.
std::list<gcn::SelectionListener*> EmoteContainer::mListeners [private] |
Definition at line 130 of file emotecontainer.h.
const int EmoteContainer::gridWidth = 34 [static, private] |
Definition at line 132 of file emotecontainer.h.
const int EmoteContainer::gridHeight = 36 [static, private] |
Definition at line 133 of file emotecontainer.h.