![]() |
ManaPlus
|
#include <shortcutcontainer.h>
Public Member Functions | |
| ~ShortcutContainer () | |
| void | widgetResized (const Event &event) |
| void | widgetMoved (const Event &event) |
| void | mouseDragged (MouseEvent &event) |
| void | mousePressed (MouseEvent &event) |
| void | mouseReleased (MouseEvent &event) |
| int | getMaxItems () const |
| int | getBoxWidth () const |
| int | getBoxHeight () const |
| void | drawBackground (Graphics *const g) |
| void | safeDrawBackground (Graphics *const g) |
| virtual void | setSkin (const Widget2 *const widget, Skin *const skin) |
Public Member Functions inherited from Widget | |
| Widget (const Widget2 *const widget) | |
| ~Widget () | |
| virtual void | draw (Graphics *const graphics)=0 |
| virtual void | safeDraw (Graphics *const graphics)=0 |
| 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 WidgetListener | |
| virtual | ~WidgetListener () |
| virtual void | widgetHidden (const Event &event) |
| virtual void | widgetShown (const Event &event) |
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 | mouseWheelMovedUp (MouseEvent &event) |
| virtual void | mouseWheelMovedDown (MouseEvent &event) |
| virtual void | mouseMoved (MouseEvent &event) |
Protected Member Functions | |
| ShortcutContainer (Widget2 *const widget) | |
| int | getIndexFromGrid (const int pointX, const int pointY) const |
Protected Member Functions inherited from Widget | |
| void | distributeActionEvent () |
| void | distributeResizedEvent () |
| void | distributeMovedEvent () |
| void | distributeHiddenEvent () |
| void | distributeShownEvent () |
Protected Member Functions inherited from Widget2 | |
| Widget2 (const Widget2 *const widget) | |
Protected Member Functions inherited from WidgetListener | |
| WidgetListener () | |
Protected Member Functions inherited from MouseListener | |
| MouseListener () | |
Protected Attributes | |
| Image * | mBackgroundImg |
| Skin * | mSkin |
| unsigned | mMaxItems |
| int | mBoxWidth |
| int | mBoxHeight |
| int | mGridWidth |
| int | mGridHeight |
| int | mImageOffsetX |
| int | mImageOffsetY |
| int | mTextOffsetX |
| int | mTextOffsetY |
| ImageCollection * | mVertexes |
Protected Attributes inherited from Widget | |
| MouseListenerList | mMouseListeners |
| KeyListenerList | mKeyListeners |
| ActionListenerList | mActionListeners |
| WidgetDeathListenerList | mDeathListeners |
| FocusListenerList | mFocusListeners |
| WidgetListenerList | mWidgetListeners |
| Color | mForegroundColor |
| Color | mBackgroundColor |
| Color | mBaseColor |
| Rect | mDimension |
| std::string | mActionEventId |
| std::string | mId |
| FocusHandler * | mFocusHandler |
| FocusHandler * | mInternalFocusHandler |
| Widget * | mParent |
| Font * | mCurrentFont |
| unsigned int | mFrameSize |
| bool | mFocusable |
| bool | mTabIn |
| bool | mTabOut |
| bool | mEnabled |
| bool | mAllowLogic |
| bool | mMouseConsume |
| bool | mRedraw |
| bool | mSelectable |
Protected Attributes inherited from Widget2 | |
| int | mPaletteOffset |
| Widget * | mWindow |
| Color | mForegroundColor2 |
Static Protected Attributes | |
| static float | mAlpha = 1.0 |
Static Protected Attributes inherited from Widget | |
| static Font * | mGlobalFont = 0 |
Additional Inherited Members | |
Static Public Member Functions inherited from Widget | |
| static void | setGlobalFont (Font *const font) |
| static Font * | getGloablFont () |
| static void | cleanGlobalFont () |
| static bool | widgetExists (const Widget *const widget) |
| static void | distributeWindowResizeEvent () |
| static Widget * | callPostInit (Widget *const widget) |
Data Fields inherited from Widget | |
| Visible | mVisible |
Protected Types inherited from Widget | |
| typedef std::list< MouseListener * > | MouseListenerList |
| typedef MouseListenerList::iterator | MouseListenerIterator |
| typedef std::list< KeyListener * > | KeyListenerList |
| typedef KeyListenerList::iterator | KeyListenerIterator |
| typedef std::list< ActionListener * > | ActionListenerList |
| typedef ActionListenerList::iterator | ActionListenerIterator |
| typedef std::list< WidgetDeathListener * > | WidgetDeathListenerList |
| typedef WidgetDeathListenerList::iterator | WidgetDeathListenerIterator |
| typedef std::list< FocusListener * > | FocusListenerList |
| typedef FocusListenerList::iterator | FocusListenerIterator |
| typedef std::list< WidgetListener * > | WidgetListenerList |
| typedef WidgetListenerList::iterator | WidgetListenerIterator |
A generic shortcut container.
Definition at line 41 of file shortcutcontainer.h.
| ShortcutContainer::~ShortcutContainer | ( | ) |
Destructor.
Definition at line 84 of file shortcutcontainer.cpp.
References delete2, gui, mBackgroundImg, mVertexes, and Gui::removeDragged().
|
explicitprotected |
Constructor. Initializes the shortcut container.
Definition at line 43 of file shortcutcontainer.cpp.
References Widget::addMouseListener(), Widget::addWidgetListener(), Theme::getImageFromThemeXml(), Widget2::getThemeColor(), Settings::guiAlpha, Widget::mAllowLogic, mBackgroundImg, mBoxHeight, mBoxWidth, Widget::mForegroundColor, Widget2::mForegroundColor2, settings, and QuestType::TEXT.
| void ShortcutContainer::drawBackground | ( | Graphics *const | g | ) |
Definition at line 131 of file shortcutcontainer.cpp.
References Graphics::calcTileCollection(), ImageCollection::clear(), Graphics::drawTileCollection(), Graphics::finalize(), mBackgroundImg, mBoxHeight, mBoxWidth, mGridWidth, mMaxItems, Widget::mRedraw, and mVertexes.
Referenced by ItemShortcutContainer::draw(), SpellShortcutContainer::draw(), and VirtShortcutContainer::draw().
|
inline |
Definition at line 88 of file shortcutcontainer.h.
References mBoxHeight.
Referenced by ShortcutWindow::ShortcutWindow().
|
inline |
Definition at line 85 of file shortcutcontainer.h.
References mBoxWidth.
Referenced by ShortcutWindow::ShortcutWindow().
|
protected |
Gets the index from the grid provided the point is in an item box.
| pointX | X coordinate of the point. |
| pointY | Y coordinate of the point. |
Definition at line 114 of file shortcutcontainer.cpp.
References CAST_S32, Rect::isPointInRect(), mBoxHeight, mBoxWidth, mGridHeight, mGridWidth, and mMaxItems.
Referenced by ItemShortcutContainer::mouseDragged(), SpellShortcutContainer::mouseDragged(), VirtShortcutContainer::mouseDragged(), ItemShortcutContainer::mouseMoved(), SpellShortcutContainer::mouseMoved(), VirtShortcutContainer::mouseMoved(), ItemShortcutContainer::mousePressed(), SpellShortcutContainer::mousePressed(), VirtShortcutContainer::mousePressed(), ItemShortcutContainer::mouseReleased(), SpellShortcutContainer::mouseReleased(), and VirtShortcutContainer::mouseReleased().
|
inline |
Definition at line 82 of file shortcutcontainer.h.
References mMaxItems.
Referenced by ShortcutWindow::ShortcutWindow().
|
inlinevirtual |
Handles mouse when dragged.
Reimplemented from MouseListener.
Reimplemented in VirtShortcutContainer, and SpellShortcutContainer.
Definition at line 64 of file shortcutcontainer.h.
|
inlinevirtual |
Handles mouse when pressed.
Reimplemented from MouseListener.
Reimplemented in VirtShortcutContainer, and SpellShortcutContainer.
Definition at line 71 of file shortcutcontainer.h.
|
inlinevirtual |
Handles mouse release.
Reimplemented from MouseListener.
Reimplemented in VirtShortcutContainer, and SpellShortcutContainer.
Definition at line 78 of file shortcutcontainer.h.
| void ShortcutContainer::safeDrawBackground | ( | Graphics *const | g | ) |
Definition at line 151 of file shortcutcontainer.cpp.
References Graphics::drawImage(), mBackgroundImg, mBoxHeight, mBoxWidth, mGridWidth, and mMaxItems.
Referenced by ItemShortcutContainer::safeDraw(), SpellShortcutContainer::safeDraw(), and VirtShortcutContainer::safeDraw().
Reimplemented in VirtShortcutContainer, SpellShortcutContainer, ItemShortcutContainer, and EmoteShortcutContainer.
Definition at line 168 of file shortcutcontainer.cpp.
References Skin::getOption(), mImageOffsetX, mImageOffsetY, mSkin, mTextOffsetX, mTextOffsetY, and Widget2::setWidget2().
Referenced by ShortcutWindow::addTab(), EmoteShortcutContainer::setSkin(), ItemShortcutContainer::setSkin(), SpellShortcutContainer::setSkin(), and VirtShortcutContainer::setSkin().
|
virtual |
Invoked when a widget is moved.
| event | Describes the event. |
Reimplemented from WidgetListener.
Definition at line 163 of file shortcutcontainer.cpp.
References Widget::mRedraw.
|
virtual |
Invoked when a widget changes its size. This is used to determine the new height of the container.
Reimplemented from WidgetListener.
Definition at line 98 of file shortcutcontainer.cpp.
References CAST_U32, mBoxHeight, mBoxWidth, Widget::mDimension, mGridHeight, mGridWidth, mMaxItems, Widget::mRedraw, Widget::setHeight(), and Rect::width.
|
staticprotected |
Definition at line 116 of file shortcutcontainer.h.
Referenced by ItemShortcutContainer::draw(), SpellShortcutContainer::draw(), VirtShortcutContainer::draw(), ItemShortcutContainer::safeDraw(), SpellShortcutContainer::safeDraw(), and VirtShortcutContainer::safeDraw().
|
protected |
Definition at line 114 of file shortcutcontainer.h.
Referenced by ItemShortcutContainer::draw(), SpellShortcutContainer::draw(), VirtShortcutContainer::draw(), drawBackground(), EmoteShortcutContainer::EmoteShortcutContainer(), ItemShortcutContainer::safeDraw(), SpellShortcutContainer::safeDraw(), VirtShortcutContainer::safeDraw(), safeDrawBackground(), ShortcutContainer(), and ~ShortcutContainer().
|
protected |
Definition at line 120 of file shortcutcontainer.h.
Referenced by ItemShortcutContainer::draw(), SpellShortcutContainer::draw(), VirtShortcutContainer::draw(), drawBackground(), getBoxHeight(), getIndexFromGrid(), ItemShortcutContainer::safeDraw(), SpellShortcutContainer::safeDraw(), VirtShortcutContainer::safeDraw(), safeDrawBackground(), ShortcutContainer(), and widgetResized().
|
protected |
Definition at line 119 of file shortcutcontainer.h.
Referenced by ItemShortcutContainer::draw(), SpellShortcutContainer::draw(), VirtShortcutContainer::draw(), drawBackground(), getBoxWidth(), getIndexFromGrid(), ItemShortcutContainer::safeDraw(), SpellShortcutContainer::safeDraw(), VirtShortcutContainer::safeDraw(), safeDrawBackground(), ShortcutContainer(), and widgetResized().
|
protected |
Definition at line 122 of file shortcutcontainer.h.
Referenced by getIndexFromGrid(), and widgetResized().
|
protected |
Definition at line 121 of file shortcutcontainer.h.
Referenced by ItemShortcutContainer::draw(), SpellShortcutContainer::draw(), VirtShortcutContainer::draw(), drawBackground(), getIndexFromGrid(), ItemShortcutContainer::safeDraw(), SpellShortcutContainer::safeDraw(), VirtShortcutContainer::safeDraw(), safeDrawBackground(), and widgetResized().
|
protected |
Definition at line 123 of file shortcutcontainer.h.
Referenced by ItemShortcutContainer::draw(), SpellShortcutContainer::draw(), VirtShortcutContainer::draw(), ItemShortcutContainer::safeDraw(), SpellShortcutContainer::safeDraw(), VirtShortcutContainer::safeDraw(), and setSkin().
|
protected |
Definition at line 124 of file shortcutcontainer.h.
Referenced by ItemShortcutContainer::draw(), SpellShortcutContainer::draw(), VirtShortcutContainer::draw(), ItemShortcutContainer::safeDraw(), SpellShortcutContainer::safeDraw(), VirtShortcutContainer::safeDraw(), and setSkin().
|
protected |
Definition at line 118 of file shortcutcontainer.h.
Referenced by ItemShortcutContainer::draw(), SpellShortcutContainer::draw(), VirtShortcutContainer::draw(), drawBackground(), EmoteShortcutContainer::EmoteShortcutContainer(), getIndexFromGrid(), getMaxItems(), ItemShortcutContainer::ItemShortcutContainer(), ItemShortcutContainer::safeDraw(), SpellShortcutContainer::safeDraw(), VirtShortcutContainer::safeDraw(), safeDrawBackground(), SpellShortcutContainer::SpellShortcutContainer(), VirtShortcutContainer::VirtShortcutContainer(), and widgetResized().
|
protected |
Definition at line 115 of file shortcutcontainer.h.
Referenced by ItemShortcutContainer::setSkin(), and setSkin().
|
protected |
Definition at line 125 of file shortcutcontainer.h.
Referenced by ItemShortcutContainer::draw(), SpellShortcutContainer::draw(), ItemShortcutContainer::safeDraw(), SpellShortcutContainer::safeDraw(), and setSkin().
|
protected |
Definition at line 126 of file shortcutcontainer.h.
Referenced by ItemShortcutContainer::draw(), SpellShortcutContainer::draw(), ItemShortcutContainer::safeDraw(), SpellShortcutContainer::safeDraw(), and setSkin().
|
protected |
Definition at line 127 of file shortcutcontainer.h.
Referenced by drawBackground(), and ~ShortcutContainer().