ManaPlus
|
#include <emotepage.h>
Public Member Functions | |
EmotePage (const Widget2 *const widget) | |
~EmotePage () | |
void | draw (Graphics *const graphics) |
void | safeDraw (Graphics *const graphics) |
void | mousePressed (MouseEvent &event) |
int | getIndexFromGrid (const int x, const int y) const |
void | widgetResized (const Event &event) |
void | widgetMoved (const Event &event) |
void | resetAction () |
int | getSelectedIndex () const |
Public Member Functions inherited from Widget | |
Widget (const Widget2 *const widget) | |
~Widget () | |
virtual void | drawFrame (Graphics *graphics) |
virtual void | safeDrawFrame (Graphics *graphics) |
void | setFrameSize (const unsigned int frameSize) |
unsigned int | getFrameSize () const |
virtual void | logic () |
Widget * | getParent () const |
void | setWidth (const int width) |
int | getWidth () const |
void | setHeight (const int height) |
int | getHeight () const |
void | setSize (const int width, const int height) |
void | setX (const int x) |
int | getX () const |
void | setY (const int y) |
int | getY () const |
void | setPosition (const int x, const int y) |
void | setDimension (const Rect &dimension) |
const Rect & | getDimension () const |
void | setFocusable (const bool focusable) |
bool | isFocusable () const |
virtual bool | isFocused () const |
void | setEnabled (const bool enabled) |
bool | isEnabled () const |
void | setVisible (Visible visible) |
bool | isVisible () const |
void | setBaseColor (const Color &color) |
const Color & | getBaseColor () const |
void | setForegroundColor (const Color &color) |
const Color & | getForegroundColor () const |
void | setBackgroundColor (const Color &color) |
const Color & | getBackgroundColor () const |
virtual void | requestFocus () |
virtual void | requestMoveToTop () |
virtual void | requestMoveToBottom () |
virtual void | setFocusHandler (FocusHandler *const focusHandler) |
FocusHandler * | getFocusHandler () |
void | addActionListener (ActionListener *const actionListener) |
void | removeActionListener (ActionListener *const actionListener) |
void | addDeathListener (WidgetDeathListener *const deathListener) |
void | removeDeathListener (WidgetDeathListener *const deathListener) |
void | addMouseListener (MouseListener *const mouseListener) |
void | removeMouseListener (MouseListener *const mouseListener) |
void | addKeyListener (KeyListener *const keyListener) |
void | removeKeyListener (KeyListener *const keyListener) |
void | addFocusListener (FocusListener *const focusListener) |
void | removeFocusListener (FocusListener *const focusListener) |
void | addWidgetListener (WidgetListener *const widgetListener) |
void | removeWidgetListener (WidgetListener *const widgetListener) |
void | setActionEventId (const std::string &actionEventId) |
const std::string & | getActionEventId () const |
virtual void | getAbsolutePosition (int &x, int &y) const |
virtual void | setParent (Widget *parent) |
Font * | getFont () const |
void | setFont (Font *const font) |
virtual void | fontChanged () |
bool | isTabInEnabled () const |
void | setTabInEnabled (const bool enabled) |
bool | isTabOutEnabled () const |
void | setTabOutEnabled (const bool enabled) |
void | requestModalFocus () |
virtual void | requestModalMouseInputFocus () |
virtual void | releaseModalFocus () |
virtual void | releaseModalMouseInputFocus () |
virtual bool | isModalFocused () const |
virtual bool | isModalMouseInputFocused () const |
virtual Widget * | getWidgetAt (int x, int y) |
const std::list< MouseListener * > & | getMouseListeners () const A_CONST |
const std::list< KeyListener * > & | getKeyListeners () const A_CONST |
const std::list< FocusListener * > & | getFocusListeners () const A_CONST |
virtual Rect | getChildrenArea () |
virtual FocusHandler * | getInternalFocusHandler () |
void | setInternalFocusHandler (FocusHandler *const internalFocusHandler) |
virtual void | moveToTop (Widget *widget) |
virtual void | moveToBottom (Widget *widget) |
virtual void | focusNext () |
virtual void | focusPrevious () |
virtual void | showWidgetPart (Widget *const widget, const Rect &area) |
void | setId (const std::string &id) |
const std::string & | getId () const |
virtual void | showPart (const Rect &rectangle) |
bool | isAllowLogic () const |
void | setMouseConsume (const bool b) |
bool | isMouseConsume () const |
void | setRedraw (const bool b) |
virtual bool | isSelectable () const |
void | setSelectable (const bool selectable) |
void | windowResized () |
virtual void | postInit () |
Public Member Functions inherited from Widget2 | |
virtual | ~Widget2 () |
const Color & | getThemeColor (const ThemeColorIdT type, const unsigned int alpha) const A_INLINE |
const Color & | getThemeCharColor (const signed char c, bool &valid) const A_INLINE |
virtual void | setWidget2 (const Widget2 *const widget) |
void | setPalette (int palette) |
void | checkPalette () |
void | setForegroundColor2 (const Color &color) |
Widget * | getWindow () const |
virtual void | setWindow (Widget *const window) |
Public Member Functions inherited from MouseListener | |
virtual | ~MouseListener () |
virtual void | mouseEntered (MouseEvent &event) |
virtual void | mouseExited (MouseEvent &event) |
virtual void | mouseReleased (MouseEvent &event) |
virtual void | mouseClicked (MouseEvent &event) |
virtual void | mouseWheelMovedUp (MouseEvent &event) |
virtual void | mouseWheelMovedDown (MouseEvent &event) |
virtual void | mouseMoved (MouseEvent &event) |
virtual void | mouseDragged (MouseEvent &event) |
Public Member Functions inherited from WidgetListener | |
virtual | ~WidgetListener () |
virtual void | widgetHidden (const Event &event) |
virtual void | widgetShown (const Event &event) |
Private Attributes | |
ImageSet * | mEmotes |
ImageCollection * | mVertexes |
int | mSelectedIndex |
Definition at line 34 of file emotepage.h.
|
explicit |
Definition at line 43 of file emotepage.cpp.
References Widget::addMouseListener(), Widget::addWidgetListener(), and Widget::mAllowLogic.
EmotePage::~EmotePage | ( | ) |
Definition at line 57 of file emotepage.cpp.
References Resource::decRef(), delete2, mEmotes, and mVertexes.
|
virtual |
Draws the widget. It is called by the parent widget when it is time for the widget to draw itself. The graphics object is set up so that all drawing is relative to the widget, i.e coordinate (0,0) is the top left corner of the widget. It is not possible to draw outside of a widget's dimension.
graphics | aA graphics object to draw with. |
Implements Widget.
Definition at line 67 of file emotepage.cpp.
References BLOCK_END, BLOCK_START, Graphics::calcTileCollection(), ImageCollection::clear(), Graphics::drawTileCollection(), anonymous_namespace{emotepage.cpp}::emoteHeight, anonymous_namespace{emotepage.cpp}::emoteWidth, Graphics::finalize(), FOR_EACH, ImageSet::getImages(), Widget::mDimension, mEmotes, Widget::mRedraw, mVertexes, Rect::width, x, and y.
int EmotePage::getIndexFromGrid | ( | const int | x, |
const int | y | ||
) | const |
Definition at line 143 of file emotepage.cpp.
References CAST_S32, anonymous_namespace{emotepage.cpp}::emoteHeight, anonymous_namespace{emotepage.cpp}::emoteWidth, Rect::height, Widget::mDimension, mEmotes, ImageSet::size(), Rect::width, x, and y.
Referenced by mousePressed().
|
inline |
Definition at line 59 of file emotepage.h.
References mSelectedIndex.
Referenced by EmoteWindow::clearEmote(), and EmoteWindow::getSelectedEmote().
|
virtual |
Called when a mouse button has been pressed on the widget area.
NOTE: A mouse press is NOT equal to a mouse click. Use mouseClickMessage to check for mouse clicks.
event | Describes the event. |
Reimplemented from MouseListener.
Definition at line 136 of file emotepage.cpp.
References Widget::distributeActionEvent(), getIndexFromGrid(), MouseEvent::getX(), MouseEvent::getY(), and mSelectedIndex.
void EmotePage::resetAction | ( | ) |
Definition at line 155 of file emotepage.cpp.
References mSelectedIndex.
Referenced by EmoteWindow::clearEmote().
|
virtual |
Implements Widget.
Definition at line 105 of file emotepage.cpp.
References BLOCK_END, BLOCK_START, Graphics::drawImage(), anonymous_namespace{emotepage.cpp}::emoteHeight, anonymous_namespace{emotepage.cpp}::emoteWidth, FOR_EACH, ImageSet::getImages(), Widget::mDimension, mEmotes, Rect::width, x, and y.
|
virtual |
Invoked when a widget is moved.
event | Describes the event. |
Reimplemented from WidgetListener.
Definition at line 165 of file emotepage.cpp.
References Widget::mRedraw.
|
virtual |
Invoked when a widget changes its size.
event | Describes the event. |
Reimplemented from WidgetListener.
Definition at line 160 of file emotepage.cpp.
References Widget::mRedraw.
Referenced by EmoteWindow::widgetMoved(), and EmoteWindow::widgetResized().
|
private |
Definition at line 63 of file emotepage.h.
Referenced by draw(), getIndexFromGrid(), safeDraw(), and ~EmotePage().
|
private |
Definition at line 65 of file emotepage.h.
Referenced by getSelectedIndex(), mousePressed(), and resetAction().
|
private |
Definition at line 64 of file emotepage.h.
Referenced by draw(), and ~EmotePage().