from RadioButton.hpp:36
class RadioButton : public AbstractButton
{
public:
RadioButton() : AbstractButton(), bitmapUnselected(), bitmapUnselectedPressed(), bitmapSelected(), bitmapSelectedPressed(), alpha(255), selected(false), deselectionEnabled(false), deselectedAction(0)
{ }
virtual ~RadioButton() { }
virtual void draw(const Rect& invalidatedArea) const;
virtual void handleClickEvent(const ClickEvent& event);
virtual void setBitmaps(const Bitmap& bmpUnselected, const Bitmap& bmpUnselectedPressed, const Bitmap& bmpSelected, const Bitmap& bmpSelectedPressed);
void setDeselectedAction(GenericCallback< const AbstractButton& >& callback)
{
deselectedAction = &callback;
}
virtual Rect getSolidRect() const;
void setAlpha(uint8_t alpha)
{
this->alpha = alpha;
}
uint8_t getAlpha() const
{
return alpha;
}
void setDeselectionEnabled(bool state)
{
deselectionEnabled = state;
}
bool getDeselectionEnabled() const
{
return deselectionEnabled;
}
void setSelected(bool newSelected);
bool getSelected() const
{
return selected;
}
Bitmap getCurrentlyDisplayedBitmap() const
{
return (selected ? (AbstractButton::pressed ? bitmapSelectedPressed : bitmapSelected) : (AbstractButton::pressed ? bitmapUnselectedPressed : bitmapUnselected));
}
virtual uint16_t getType() const
{
return (uint16_t)TYPE_RADIOBUTTON;
}
protected:
Bitmap bitmapUnselected;
Bitmap bitmapUnselectedPressed;
Bitmap bitmapSelected;
Bitmap bitmapSelectedPressed;
uint8_t alpha;
bool selected;
bool deselectionEnabled;
GenericCallback< const AbstractButton& >* deselectedAction;
};