2020-03-29 17:34:08 +00:00
|
|
|
#ifndef __qwaq_ui_button_h
|
|
|
|
#define __qwaq_ui_button_h
|
2020-03-19 04:52:14 +00:00
|
|
|
|
2020-03-29 17:34:08 +00:00
|
|
|
#include "ui/draw.h"
|
|
|
|
#include "ui/view.h"
|
2020-03-19 04:52:14 +00:00
|
|
|
|
|
|
|
@class ListenerGroup;
|
|
|
|
|
|
|
|
@interface Button : View
|
|
|
|
{
|
|
|
|
DrawBuffer *icon[2];
|
|
|
|
int pressed;
|
2020-03-19 10:25:57 +00:00
|
|
|
int click;
|
|
|
|
Point dragBase;
|
|
|
|
Point dragPos;
|
2020-03-19 04:52:14 +00:00
|
|
|
ListenerGroup *onPress;
|
|
|
|
ListenerGroup *onRelease;
|
|
|
|
ListenerGroup *onClick;
|
|
|
|
ListenerGroup *onDrag;
|
|
|
|
ListenerGroup *onAuto;
|
2020-03-19 04:57:10 +00:00
|
|
|
ListenerGroup *onHover;
|
2020-03-19 04:52:14 +00:00
|
|
|
}
|
2020-03-30 07:30:58 +00:00
|
|
|
+(Button *)withPos: (Point) pos releasedIcon: (DrawBuffer *) released
|
|
|
|
pressedIcon: (DrawBuffer *) pressed;
|
|
|
|
+(Button *)withRect: (Rect) rect; // invisible button
|
2020-03-19 04:52:14 +00:00
|
|
|
-initWithPos: (Point) pos releasedIcon: (DrawBuffer *) released
|
|
|
|
pressedIcon: (DrawBuffer *) pressed;
|
2020-03-23 13:00:05 +00:00
|
|
|
-initWithRect: (Rect) rect; // invisible button
|
2020-03-19 04:52:14 +00:00
|
|
|
-(ListenerGroup *) onPress;
|
|
|
|
-(ListenerGroup *) onRelease;
|
|
|
|
-(ListenerGroup *) onClick;
|
|
|
|
-(ListenerGroup *) onDrag;
|
|
|
|
-(ListenerGroup *) onAuto;
|
2020-03-19 04:57:10 +00:00
|
|
|
-(ListenerGroup *) onHover;
|
2020-03-19 10:25:57 +00:00
|
|
|
|
|
|
|
- (int) click;
|
|
|
|
- (Point) delta;
|
2020-03-19 04:52:14 +00:00
|
|
|
@end
|
|
|
|
|
2020-03-29 17:34:08 +00:00
|
|
|
#endif//__qwaq_ui_button_h
|