ManaPlus
|
#include <skillrectanglelistbox.h>
Public Member Functions | |
SkillRectangleListBox (const Widget2 *const widget, SkillModel *const model) | |
~SkillRectangleListBox () | |
SkillInfo * | getSelectedInfo () const |
void | draw (Graphics *const graphics) |
void | safeDraw (Graphics *const graphics) |
const SkillInfo * | getSkillByEvent (const MouseEvent &event) const |
int | getSelectionByEvent (const MouseEvent &event) const |
void | mouseMoved (MouseEvent &event) |
void | mouseDragged (MouseEvent &event) |
void | mousePressed (MouseEvent &event) |
void | mouseReleased (MouseEvent &event) |
void | mouseExited (MouseEvent &event) |
void | updateAlpha () |
void | setSelected (const int selected) |
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 | mouseClicked (MouseEvent &event) |
virtual void | mouseWheelMovedUp (MouseEvent &event) |
virtual void | mouseWheelMovedDown (MouseEvent &event) |
Private Attributes | |
Color | mHighlightColor |
Color | mTextColor |
Color | mTextColor2 |
Color | mCooldownColor |
Color | mForegroundSelectedColor |
Color | mForegroundSelectedColor2 |
SkillModel * | mModel |
Skin * | mSkin |
int | mSelected |
int | mPadding |
int | mBoxWidth |
int | mBoxHeight |
int | mIconXOffset |
int | mIconYOffset |
int | mTextXOffset |
int | mTextYOffset |
bool | mSkillClicked |
Static Private Attributes | |
static float | mAlpha = 1.0 |
Definition at line 48 of file skillrectanglelistbox.h.
|
inline |
Definition at line 52 of file skillrectanglelistbox.h.
References Widget::addMouseListener(), Widget::getFont(), Font::getHeight(), SkillModel::getNumberOfElements(), Skin::getOption(), Skin::getPadding(), SkillModel::getSkillAt(), Theme::getThemePath(), Font::getWidth(), Theme::load(), mBoxHeight, mBoxWidth, mIconXOffset, mIconYOffset, mPadding, mSkin, mTextXOffset, mTextYOffset, Widget::setHeight(), Widget::setWidth(), theme, SkillInfo::x, and SkillInfo::y.
|
inline |
Definition at line 125 of file skillrectanglelistbox.h.
|
inlinevirtual |
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 144 of file skillrectanglelistbox.h.
References Color::a, CAST_S32, data, SkillInfo::data, Font::drawString(), Widget::getFont(), SkillModel::getNumberOfElements(), SkillModel::getSkillAt(), Font::getWidth(), mAlpha, mBoxHeight, mBoxWidth, mForegroundSelectedColor, mHighlightColor, mIconXOffset, mIconYOffset, mModel, mPadding, mSelected, mTextColor, mTextColor2, mTextXOffset, mTextYOffset, Widget::setHeight(), Widget::setWidth(), SkillInfo::skillLevel, SkillInfo::skillLevelWidth, updateAlpha(), x, SkillInfo::x, y, and SkillInfo::y.
Referenced by safeDraw().
|
inline |
Definition at line 130 of file skillrectanglelistbox.h.
References SkillModel::getNumberOfElements(), SkillModel::getSkillAt(), mModel, and mSelected.
Referenced by SkillTab::getSelectedInfo().
|
inline |
Definition at line 258 of file skillrectanglelistbox.h.
References SkillModel::getNumberOfElements(), SkillModel::getSkillAt(), mBoxHeight, mBoxWidth, mModel, mPadding, SkillInfo::x, and SkillInfo::y.
Referenced by mouseDragged(), and mouseReleased().
|
inline |
Definition at line 238 of file skillrectanglelistbox.h.
References SkillModel::getNumberOfElements(), SkillModel::getSkillAt(), mBoxHeight, mBoxWidth, mModel, mPadding, SkillInfo::x, and SkillInfo::y.
Referenced by mouseDragged(), mouseMoved(), and mousePressed().
|
inlinevirtual |
Called when the mouse has moved and the mouse has previously been pressed on the widget.
event | Describes the event. |
Reimplemented from MouseListener.
Definition at line 295 of file skillrectanglelistbox.h.
References dragDrop, DragDrop::dragSkill(), getSelectionByEvent(), getSkillByEvent(), DragDrop::isEmpty(), MouseButton::LEFT, mSkillClicked, DragDrop::setItem(), DragDrop::setItemData(), setSelected(), Actions::skill(), SKILL_MIN_ID, and DragDropSource::Skills.
|
inlinevirtual |
Called when the mouse has exited the widget area.
event | Describes the event. |
Reimplemented from MouseListener.
Definition at line 367 of file skillrectanglelistbox.h.
References Popup::hide(), and skillPopup.
|
inlinevirtual |
Called when the mouse has moved in the widget area and no mouse button has been pressed (i.e no widget is being dragged).
event | Describes the event. |
Reimplemented from MouseListener.
Definition at line 278 of file skillrectanglelistbox.h.
References dragDrop, getSkillByEvent(), DragDrop::isEmpty(), Viewport::mMouseX, Viewport::mMouseY, Popup::position(), SkillPopup::show(), Actions::skill(), skillPopup, and viewport.
|
inlinevirtual |
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 316 of file skillrectanglelistbox.h.
References Widget::getFont(), Font::getHeight(), SkillModel::getSkillAt(), getSkillByEvent(), Popup::hide(), MouseButton::LEFT, mBoxHeight, mBoxWidth, mModel, mPadding, mSelected, mSkillClicked, mTextXOffset, mTextYOffset, popupMenu, MouseButton::RIGHT, PopupMenu::showSkillLevelPopup(), PopupMenu::showSkillPopup(), Actions::skill(), skillPopup, x, and y.
|
inlinevirtual |
Called when a mouse button has been released on the widget area.
event | Describes the event. |
Reimplemented from MouseListener.
Definition at line 358 of file skillrectanglelistbox.h.
References Widget::distributeActionEvent(), getSelectionByEvent(), MouseButton::LEFT, and setSelected().
|
inlinevirtual |
Implements Widget.
Definition at line 233 of file skillrectanglelistbox.h.
References draw().
|
inline |
Definition at line 381 of file skillrectanglelistbox.h.
References SkillModel::getNumberOfElements(), mModel, and mSelected.
Referenced by mouseDragged(), and mouseReleased().
|
inline |
Definition at line 372 of file skillrectanglelistbox.h.
References Theme::getMinimumOpacity(), Settings::guiAlpha, mAlpha, settings, and theme.
Referenced by draw().
|
staticprivate |
Definition at line 416 of file skillrectanglelistbox.h.
Referenced by draw(), and updateAlpha().
|
private |
Definition at line 410 of file skillrectanglelistbox.h.
Referenced by draw(), getSelectionByEvent(), getSkillByEvent(), mousePressed(), and SkillRectangleListBox().
|
private |
Definition at line 409 of file skillrectanglelistbox.h.
Referenced by draw(), getSelectionByEvent(), getSkillByEvent(), mousePressed(), and SkillRectangleListBox().
|
private |
Definition at line 402 of file skillrectanglelistbox.h.
|
private |
Definition at line 403 of file skillrectanglelistbox.h.
Referenced by draw().
|
private |
Definition at line 404 of file skillrectanglelistbox.h.
|
private |
Definition at line 399 of file skillrectanglelistbox.h.
Referenced by draw().
|
private |
Definition at line 411 of file skillrectanglelistbox.h.
Referenced by draw(), and SkillRectangleListBox().
|
private |
Definition at line 412 of file skillrectanglelistbox.h.
Referenced by draw(), and SkillRectangleListBox().
|
private |
Definition at line 405 of file skillrectanglelistbox.h.
Referenced by draw(), getSelectedInfo(), getSelectionByEvent(), getSkillByEvent(), mousePressed(), setSelected(), and ~SkillRectangleListBox().
|
private |
Definition at line 408 of file skillrectanglelistbox.h.
Referenced by draw(), getSelectionByEvent(), getSkillByEvent(), mousePressed(), and SkillRectangleListBox().
|
private |
Definition at line 407 of file skillrectanglelistbox.h.
Referenced by draw(), getSelectedInfo(), mousePressed(), and setSelected().
|
private |
Definition at line 415 of file skillrectanglelistbox.h.
Referenced by mouseDragged(), and mousePressed().
|
private |
Definition at line 406 of file skillrectanglelistbox.h.
Referenced by SkillRectangleListBox().
|
private |
Definition at line 400 of file skillrectanglelistbox.h.
Referenced by draw().
|
private |
Definition at line 401 of file skillrectanglelistbox.h.
Referenced by draw().
|
private |
Definition at line 413 of file skillrectanglelistbox.h.
Referenced by draw(), mousePressed(), and SkillRectangleListBox().
|
private |
Definition at line 414 of file skillrectanglelistbox.h.
Referenced by draw(), mousePressed(), and SkillRectangleListBox().