You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
795 B

#ifndef __SDL_BUTTON_WIDGET_HEADER__
#define __SDL_BUTTON_WIDGET_HEADER__
#include "../core/coreWidget.h"
#include "../core/coreLabel.h"
class classGUI_SDL;
class sdlButtonWidget : public sdlCoreWidget {
private:
uint8_t m_bState;
sdlLabel * m_pLabel;
bool m_bToggleEnabled;
bool m_bUnderCursor;
protected:
virtual void drawBefore(SDL_Renderer* pRenderer);
public:
explicit sdlButtonWidget(CSTR text, int x, int y, int width, int height, sdlCoreWidget* pParent = NULL);
~sdlButtonWidget();
virtual void dispatch(SDL_Event* pEvt);
void setToggle(bool enable) { m_bToggleEnabled = enable; };
/*emitters*/
void (*Pushed)(void) = NULL;
void (*Toggled)(void) = NULL;
void (*UnToggled)(void) = NULL;
friend classGUI_SDL;
};
#endif