ManaPlus
|
#include <avatarlistbox.h>
Public Member Functions | |
AvatarListBox (const Widget2 *const widget, AvatarListModel *const model) | |
~AvatarListBox () | |
void | draw (Graphics *gcnGraphics) |
void | safeDraw (Graphics *gcnGraphics) |
void | mousePressed (MouseEvent &event) |
void | mouseReleased (MouseEvent &event) |
void | optionChanged (const std::string &value) |
Public Member Functions inherited from ListBox | |
ListBox (const Widget2 *const widget, ListModel *const listModel, const std::string &skin) | |
~ListBox () | |
void | postInit () |
void | draw (Graphics *const graphics) |
void | safeDraw (Graphics *const graphics) |
void | updateAlpha () |
void | keyPressed (KeyEvent &event) |
void | mouseWheelMovedUp (MouseEvent &event) |
void | mouseWheelMovedDown (MouseEvent &event) |
void | mousePressed (MouseEvent &event) |
void | mouseReleased (MouseEvent &event) |
void | mouseReleased1 (const MouseEvent &event) |
void | mouseDragged (MouseEvent &event) |
void | refocus () |
void | setDistributeMousePressed (const bool b) |
virtual void | adjustSize () |
void | logic () |
virtual int | getSelectionByMouse (const int y) const |
void | setCenter (const bool b) |
int | getPressedIndex () const |
virtual unsigned int | getRowHeight () const |
void | setRowHeight (unsigned int n) |
int | getSelected () const |
void | setSelected (const int selected) |
void | setListModel (ListModel *listModel) |
ListModel * | getListModel () const |
bool | isWrappingEnabled () const |
void | setWrappingEnabled (const bool wrappingEnabled) |
void | addSelectionListener (SelectionListener *const selectionListener) |
void | removeSelectionListener (SelectionListener *const selectionListener) |
void | distributeValueChangedEvent () |
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 |
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 () |
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 | mouseClicked (MouseEvent &event) |
virtual void | mouseMoved (MouseEvent &event) |
Public Member Functions inherited from KeyListener | |
virtual | ~KeyListener () |
virtual void | keyReleased (KeyEvent &event) |
Public Member Functions inherited from ConfigListener | |
ConfigListener () | |
virtual | ~ConfigListener () |
Private Attributes | |
int | mImagePadding |
bool | mShowGender |
bool | mShowLevel |
Static Private Attributes | |
static int | instances = 0 |
static Image * | onlineIcon = 0 |
static Image * | offlineIcon = 0 |
Definition at line 31 of file avatarlistbox.h.
AvatarListBox::AvatarListBox | ( | const Widget2 *const | widget, |
AvatarListModel *const | model | ||
) |
Definition at line 57 of file avatarlistbox.cpp.
References Configuration::addListener(), config, Theme::getImageFromThemeXml(), Widget2::getThemeColor(), instances, Widget::mForegroundColor, Widget2::mForegroundColor2, offlineIcon, onlineIcon, Widget::setWidth(), and QuestType::TEXT.
AvatarListBox::~AvatarListBox | ( | ) |
Definition at line 81 of file avatarlistbox.cpp.
References CHECKLISTENERS, config, instances, offlineIcon, onlineIcon, and Configuration::removeListeners().
|
virtual |
Draws the list box.
Implements Widget.
Definition at line 103 of file avatarlistbox.cpp.
References Color::a, BLOCK_END, BLOCK_START, boldFont, Graphics::calcTileCollection(), Graphics::drawLine(), Font::drawString(), Graphics::drawTileCollection(), Gender::FEMALE, Graphics::fillRectangle(), Graphics::finalize(), Avatar::getAdditionString(), AvatarListModel::getAvatarAt(), Avatar::getComplexName(), Avatar::getDamageHp(), Avatar::getDisplayBold(), Widget::getFont(), Avatar::getGender(), Font::getHeight(), Avatar::getHp(), Avatar::getLevel(), Avatar::getMap(), Avatar::getMaxHp(), Avatar::getName(), Being::getName(), ListModel::getNumberOfElements(), Avatar::getOnline(), Avatar::getPoison(), Theme::getProgressColor(), Graphics::getSecure(), Avatar::getType(), Widget::getWidth(), Avatar::getX(), Avatar::getY(), localPlayer, Gender::MALE, Widget::mForegroundColor, mImagePadding, ListBox::mListModel, ListBox::mPadding, Widget::mParent, mShowGender, mShowLevel, offlineIcon, onlineIcon, ProgressColorId::PROG_HP, ProgressColorId::PROG_HP_POISON, MapItemType::SEPARATOR, Graphics::setColor(), Widget::setWidth(), strprintf(), Gender::UNSPECIFIED, ListBox::updateAlpha(), and y.
|
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 582 of file avatarlistbox.cpp.
References actorManager, ChatWindow::addWhisperTab(), MapItemType::ARROW_DOWN, MapItemType::ARROW_LEFT, MapItemType::ARROW_RIGHT, MapItemType::ARROW_UP, MapItemType::ATTACK, chatWindow, MapItemType::CROSS, Widget::distributeActionEvent(), MapItemType::EMPTY, ActorManager::findBeingByName(), Map::findPortalXY(), AvatarListModel::getAvatarAt(), Widget::getFont(), Font::getHeight(), Avatar::getLevel(), Viewport::getMap(), Avatar::getName(), ListModel::getNumberOfElements(), ListBox::getSelected(), Avatar::getType(), Avatar::getX(), Avatar::getY(), ActorManager::heal(), MapItemType::HOME, MapItemType::IGNORE_, MouseButton::LEFT, localPlayer, MouseButton::MIDDLE, ListBox::mListModel, Viewport::mMouseX, Viewport::mMouseY, ListBox::mPadding, MapItemType::MUSIC, LocalPlayer::navigateTo(), MapItemType::NOPICKUP, MapItemType::PICKUP, ActorType::Player, popupManager, popupMenu, MapItemType::PORTAL, MapItemType::PRIORITY, MouseButton::RIGHT, MapItemType::ROAD, ChatWindow::saveState(), MapItemType::SEPARATOR, ListBox::setSelected(), PopupMenu::showAttackMonsterPopup(), PopupMenu::showPickupItemPopup(), PopupMenu::showPlayerPopup(), PopupMenu::showPopup(), viewport, and y.
|
virtual |
Called when a mouse button has been released on the widget area.
event | Describes the event. |
Reimplemented from MouseListener.
Definition at line 727 of file avatarlistbox.cpp.
|
virtual |
Called when an option changed. The config listener will have to be registered to the option name first.
Implements ConfigListener.
Definition at line 731 of file avatarlistbox.cpp.
References config, Configuration::getBoolValue(), mShowGender, and mShowLevel.
|
virtual |
Implements Widget.
Definition at line 346 of file avatarlistbox.cpp.
References Color::a, BLOCK_END, BLOCK_START, boldFont, Graphics::drawImage(), Graphics::drawLine(), Font::drawString(), Gender::FEMALE, Graphics::fillRectangle(), Avatar::getAdditionString(), AvatarListModel::getAvatarAt(), Avatar::getComplexName(), Avatar::getDamageHp(), Avatar::getDisplayBold(), Widget::getFont(), Avatar::getGender(), Font::getHeight(), Avatar::getHp(), Avatar::getLevel(), Avatar::getMap(), Avatar::getMaxHp(), Avatar::getName(), Being::getName(), ListModel::getNumberOfElements(), Avatar::getOnline(), Avatar::getPoison(), Theme::getProgressColor(), Graphics::getSecure(), Avatar::getType(), Widget::getWidth(), Avatar::getX(), Avatar::getY(), localPlayer, Gender::MALE, Widget::mForegroundColor, mImagePadding, ListBox::mListModel, ListBox::mPadding, Widget::mParent, mShowGender, mShowLevel, offlineIcon, onlineIcon, ProgressColorId::PROG_HP, ProgressColorId::PROG_HP_POISON, MapItemType::SEPARATOR, Graphics::setColor(), Widget::setWidth(), strprintf(), Gender::UNSPECIFIED, ListBox::updateAlpha(), and y.
|
staticprivate |
Definition at line 60 of file avatarlistbox.h.
Referenced by AvatarListBox(), and ~AvatarListBox().
|
private |
Definition at line 56 of file avatarlistbox.h.
Referenced by draw(), and safeDraw().
|
private |
Definition at line 57 of file avatarlistbox.h.
Referenced by draw(), optionChanged(), and safeDraw().
|
private |
Definition at line 58 of file avatarlistbox.h.
Referenced by draw(), optionChanged(), and safeDraw().
|
staticprivate |
Definition at line 62 of file avatarlistbox.h.
Referenced by AvatarListBox(), draw(), safeDraw(), and ~AvatarListBox().
|
staticprivate |
Definition at line 61 of file avatarlistbox.h.
Referenced by AvatarListBox(), draw(), safeDraw(), and ~AvatarListBox().