Files
wagic/projects/mtg/src/SimpleMenuItem.cpp
techdragon.nguyen@gmail.com a36d886dd5 Added first draft of an interactive button. Needs to handle addition of images a little better
refined detailed info window for stats display
removed PSP button for Touch interfaces (currently only iOS and Android) on deck selection screens
to not break the core engine and reduce some more complex code, I created a new vector in the JController object. mButtons.  This vector will contain all the valid buttons for a given screen.  The appropriate Add/Remove methods have been updated to account for this new vector.
2012-01-25 18:35:24 +00:00

53 lines
1.2 KiB
C++

#include "PrecompiledHeader.h"
#include "SimpleMenuItem.h"
#include "Translate.h"
#include "WResourceManager.h"
SimpleMenuItem::SimpleMenuItem(int id): SimpleButton(id)
{
}
SimpleMenuItem::SimpleMenuItem(SimpleMenu* _parent, int id, int fontId, string text, float x, float y, bool hasFocus, bool autoTranslate) :
SimpleButton( _parent, id, fontId, text, x, y, hasFocus, autoTranslate)
{
parent = (SimpleMenu *) _parent;
mDescription = "";
}
void SimpleMenuItem::Entering()
{
checkUserClick();
setFocus(true);
if (getParent() != NULL)
{
SimpleMenu *menu = (SimpleMenu *) parent;
menu->selectionTargetY = getY();
}
}
/* Accessors */
string SimpleMenuItem::getDescription() const
{
return mDescription;
}
void SimpleMenuItem::setDescription( const string& desc )
{
mDescription = desc;
}
ostream& SimpleMenuItem::toString(ostream& out) const
{
return out << "SimpleMenuItem ::: mHasFocus : " << hasFocus()
<< " ; parent : " << getParent()
<< " ; mText : " << getText()
<< " ; mScale : " << getScale()
<< " ; mTargetScale : " << getTargetScale()
<< " ; mX,mY : " << getX() << "," << getY();
}