Mana
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ShortcutContainer Class Referenceabstract

A generic shortcut container. More...

#include <shortcutcontainer.h>

Inheritance diagram for ShortcutContainer:
EmoteShortcutContainer ItemShortcutContainer

Public Member Functions

 ShortcutContainer ()
 
void draw (gcn::Graphics *graphics) override=0
 Draws the shortcuts.
 
void drawFrame (gcn::Graphics *graphics) override
 
void widgetResized (const gcn::Event &event) override
 Invoked when a widget changes its size.
 
int getMaxItems () const
 
int getBoxWidth () const
 
int getBoxHeight () const
 

Protected Member Functions

int getIndexFromGrid (int pointX, int pointY) const
 Gets the index from the grid provided the point is in an item box.
 

Protected Attributes

int mMaxItems = 0
 
int mBoxWidth = 0
 
int mBoxHeight = 0
 
int mCursorPosX = 0
 
int mCursorPosY = 0
 
int mGridWidth = 1
 
int mGridHeight = 1
 

Detailed Description

A generic shortcut container.

Definition at line 33 of file shortcutcontainer.h.

Constructor & Destructor Documentation

◆ ShortcutContainer()

ShortcutContainer::ShortcutContainer ( )

Definition at line 28 of file shortcutcontainer.cpp.

Member Function Documentation

◆ draw()

void ShortcutContainer::draw ( gcn::Graphics *  graphics)
overridepure virtual

Draws the shortcuts.

Implemented in EmoteShortcutContainer, and ItemShortcutContainer.

◆ drawFrame()

void ShortcutContainer::drawFrame ( gcn::Graphics *  graphics)
inlineoverride

Definition at line 46 of file shortcutcontainer.h.

◆ getBoxHeight()

int ShortcutContainer::getBoxHeight ( ) const
inline

Definition at line 56 of file shortcutcontainer.h.

◆ getBoxWidth()

int ShortcutContainer::getBoxWidth ( ) const
inline

Definition at line 55 of file shortcutcontainer.h.

◆ getIndexFromGrid()

int ShortcutContainer::getIndexFromGrid ( int  pointX,
int  pointY 
) const
protected

Gets the index from the grid provided the point is in an item box.

Parameters
pointXX coordinate of the point.
pointYY coordinate of the point.
Returns
index on success, -1 on failure.

Definition at line 53 of file shortcutcontainer.cpp.

◆ getMaxItems()

int ShortcutContainer::getMaxItems ( ) const
inline

Definition at line 54 of file shortcutcontainer.h.

◆ widgetResized()

void ShortcutContainer::widgetResized ( const gcn::Event &  event)
override

Invoked when a widget changes its size.

This is used to determine the new height of the container.

Definition at line 38 of file shortcutcontainer.cpp.

Member Data Documentation

◆ mBoxHeight

int ShortcutContainer::mBoxHeight = 0
protected

Definition at line 70 of file shortcutcontainer.h.

◆ mBoxWidth

int ShortcutContainer::mBoxWidth = 0
protected

Definition at line 69 of file shortcutcontainer.h.

◆ mCursorPosX

int ShortcutContainer::mCursorPosX = 0
protected

Definition at line 71 of file shortcutcontainer.h.

◆ mCursorPosY

int ShortcutContainer::mCursorPosY = 0
protected

Definition at line 72 of file shortcutcontainer.h.

◆ mGridHeight

int ShortcutContainer::mGridHeight = 1
protected

Definition at line 74 of file shortcutcontainer.h.

◆ mGridWidth

int ShortcutContainer::mGridWidth = 1
protected

Definition at line 73 of file shortcutcontainer.h.

◆ mMaxItems

int ShortcutContainer::mMaxItems = 0
protected

Definition at line 68 of file shortcutcontainer.h.


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