Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
EmotePopup Class Reference

An emote popup. More...

#include <emotepopup.h>

Inheritance diagram for EmotePopup:
Popup Container

Public Member Functions

 EmotePopup ()
 Constructor.
 
 ~EmotePopup () override
 
void draw (gcn::Graphics *graphics) override
 Draws the emotes.
 
void mouseExited (gcn::MouseEvent &event) override
 
void mousePressed (gcn::MouseEvent &event) override
 
void mouseMoved (gcn::MouseEvent &event) override
 
int getSelectedEmoteId () const
 Returns the selected emote.
 
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.
 
- Public Member Functions inherited from Popup
 Popup (const std::string &name=std::string(), SkinType skinType=SkinType::Popup)
 Constructor.
 
 ~Popup () override
 Destructor.
 
void add (gcn::Widget *widget) override
 
void add (gcn::Widget *widget, int x, int y) override
 
void draw (gcn::Graphics *graphics) override
 Draws the popup.
 
void drawFrame (gcn::Graphics *graphics) override
 Draws the popup frame.
 
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 mouseMoved (gcn::MouseEvent &event) override
 
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.
 
gcn::Rectangle getChildrenArea () override
 
void position (int x, int y)
 Sets the location to display the popup.
 
const SkingetSkin () const
 Returns the Skin used by this popup.
 
- Public Member Functions inherited from Container
 Container ()
 
 ~Container () override
 
void drawFrame (gcn::Graphics *graphics) override
 

Private Member Functions

void setSelectedEmoteId (int emoteId)
 Sets the index of the currently selected emote.
 
int getIndexAt (int x, int y) const
 Returns the index at the specified coordinates.
 
void recalculateSize ()
 Determine and set the size of the container.
 
void distributeValueChangedEvent ()
 Sends out selection events to the list of selection listeners.
 

Private Attributes

int mSelectedEmoteId = -1
 
int mHoveredEmoteIndex = -1
 
int mRowCount = 1
 
int mColumnCount = 1
 
std::list< gcn::SelectionListener * > mListeners
 

Additional Inherited Members

- Static Public Member Functions inherited from Popup
static void setWindowContainer (WindowContainer *windowContainer)
 Sets the window container to be used by new popups.
 
- Protected Member Functions inherited from Container
LayoutgetLayout ()
 Gets the layout handler for this container.
 
LayoutCellplace (int x, int y, gcn::Widget *wg, int w=1, int h=1)
 Adds a widget to the container and sets it at given cell.
 
ContainerPlacer getPlacer (int x, int y)
 Returns a proxy for adding widgets in an inner table of the layout.
 

Detailed Description

An emote popup.

Used to activate emotes and assign them to shortcuts.

Definition at line 42 of file emotepopup.h.

Constructor & Destructor Documentation

◆ EmotePopup()

EmotePopup::EmotePopup ( )

Constructor.

Initializes the graphic.

Definition at line 38 of file emotepopup.cpp.

◆ ~EmotePopup()

EmotePopup::~EmotePopup ( )
overridedefault

Member Function Documentation

◆ addSelectionListener()

void EmotePopup::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 70 of file emotepopup.h.

◆ distributeValueChangedEvent()

void EmotePopup::distributeValueChangedEvent ( )
private

Sends out selection events to the list of selection listeners.

Definition at line 188 of file emotepopup.cpp.

◆ draw()

void EmotePopup::draw ( gcn::Graphics *  graphics)
override

Draws the emotes.

Definition at line 47 of file emotepopup.cpp.

◆ getIndexAt()

int EmotePopup::getIndexAt ( int  x,
int  y 
) const
private

Returns the index at the specified coordinates.

Returns -1 when there is no valid index.

Definition at line 137 of file emotepopup.cpp.

◆ getSelectedEmoteId()

int EmotePopup::getSelectedEmoteId ( ) const

Returns the selected emote.

Definition at line 123 of file emotepopup.cpp.

◆ mouseExited()

void EmotePopup::mouseExited ( gcn::MouseEvent &  event)
override

Definition at line 94 of file emotepopup.cpp.

◆ mouseMoved()

void EmotePopup::mouseMoved ( gcn::MouseEvent &  event)
override

Definition at line 116 of file emotepopup.cpp.

◆ mousePressed()

void EmotePopup::mousePressed ( gcn::MouseEvent &  event)
override

Definition at line 101 of file emotepopup.cpp.

◆ recalculateSize()

void EmotePopup::recalculateSize ( )
private

Determine and set the size of the container.

Definition at line 169 of file emotepopup.cpp.

◆ removeSelectionListener()

void EmotePopup::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 79 of file emotepopup.h.

◆ setSelectedEmoteId()

void EmotePopup::setSelectedEmoteId ( int  emoteId)
private

Sets the index of the currently selected emote.

Definition at line 128 of file emotepopup.cpp.

Member Data Documentation

◆ mColumnCount

int EmotePopup::mColumnCount = 1
private

Definition at line 110 of file emotepopup.h.

◆ mHoveredEmoteIndex

int EmotePopup::mHoveredEmoteIndex = -1
private

Definition at line 107 of file emotepopup.h.

◆ mListeners

std::list<gcn::SelectionListener *> EmotePopup::mListeners
private

Definition at line 112 of file emotepopup.h.

◆ mRowCount

int EmotePopup::mRowCount = 1
private

Definition at line 109 of file emotepopup.h.

◆ mSelectedEmoteId

int EmotePopup::mSelectedEmoteId = -1
private

Definition at line 106 of file emotepopup.h.


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