Files
wagic/projects/mtg/include/DeckMenuItem.h
techdragon.nguyen@gmail.com 6d5342c02b fixed a memory leaks in app delegate
* adjusted the touch sensitivity of the iOS port for deck menu selection.  Decks were being selected even though the selection was touched.  It was highlighted but as soon as you let go it would instantly select (OK button) select the selected deck.  This isn't a problem on Android as the SDL already handles this as far as I can tell.  I limited this to only iOS so I don't accidentally mess up the other ports.
2012-01-06 19:13:43 +00:00

68 lines
1.3 KiB
C++

#ifndef _DECKMENU_ITEM_H
#define _DECKMENU_ITEM_H
#include <string>
#include <JLBFont.h>
#include <JGui.h>
#include "DeckMenu.h"
using std::string;
class DeckMenuItem: public JGuiObject
{
private:
bool mHasFocus;
bool mScrollEnabled;
bool mDisplayInitialized;
bool mIsValidSelection;
DeckMenu* parent;
int fontId;
string mText;
float mTitleResetWidth;
static float mYOffset;
void checkUserClick();
public:
string imageFilename;
string desc;
float mScrollerOffset;
DeckMetaData *meta;
float mX;
float mY;
void Relocate(float x, float y);
float GetWidth();
string GetText()
{
return mText;
}
string GetDescription()
{
return desc;
}
bool hasFocus();
DeckMenuItem(DeckMenu* _parent, int id, int fontId, string text, float x, float y, bool hasFocus = false, bool autoTranslate = false, DeckMetaData *meta = NULL);
~DeckMenuItem();
void RenderWithOffset(float yOffset);
virtual void Render();
virtual void Update(float dt);
virtual void Entering();
virtual bool Leaving(JButton key);
virtual bool ButtonPressed();
virtual ostream& toString(ostream& out) const;
virtual bool getTopLeft(float& top, float& left)
{
top = mY + mYOffset;
left = mX;
return true;
}
;
};
#endif