Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
widgets/EAButton.h
- Committer:
- richardparker
- Date:
- 2010-03-31
- Revision:
- 3:24fbf4dbd7e5
- Child:
- 7:6cf21b018420
File content as of revision 3:24fbf4dbd7e5:
// Copyright 2010 Richard Parker
#ifndef MBED_EABUTTON_H
#define MBED_EABUTTON_H
#include "mbed.h"
#include "EAWidget.h"
class EALCD;
class EAHitBox;
class EATouchManager;
class EAHitHandler;
/**
* Class to handle displaying a button on screen with hitbox.
* @author Richard Parker
*/
class EAButton: public EAWidget
{
public:
EAButton( EATouchManager& manager,
short x = 0,
short y = 0,
unsigned short width = 0,
unsigned short height = 0,
char* text = NULL,
EAHitHandler* handler = NULL);
~EAButton();
virtual void paint(EALCD& lcd);
bool setText(char* text);
inline const char* text() const { return _text; }
EAHitHandler* handler() const;
void setHandler(EAHitHandler* handler);
bool enabled() const;
void setEnabled(bool yes);
inline virtual void setX(short x) { EAWidget::setX(x); _updateHitBox(); }
inline virtual void setY(short y) { EAWidget::setY(y); _updateHitBox(); }
inline virtual void setWidth(unsigned short w) { EAWidget::setWidth(w); _updateHitBox(); }
inline virtual void setHeight(unsigned short h) { EAWidget::setHeight(h); _updateHitBox(); }
inline EAHitBox* hitBox() const { return _box; }
private:
EATouchManager& _manager;
EAHitBox* _box;
char* _text;
void _updateHitBox();
};
#endif