Files
wagic/projects/mtg/include/DeckMenuItem.h
2010-11-25 11:32:18 +00:00

52 lines
1.1 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;
int mRemainder; // difference between the number of characters shown and full title
DeckMenu* parent;
int fontId;
string mText;
public:
string imageFilename;
string desc;
string displayName;
int mScrollTimer;
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 Entering();
virtual bool Leaving(JButton key);
virtual bool ButtonPressed();
virtual ostream& toString(ostream& out) const;
virtual bool getTopLeft(float& top, float& left) {top = mY; left = mX; return true;};
};
#endif