26#define _Class _ScrollHandle
46 if (event->type == SDL_EVENT_MOUSE_BUTTON_DOWN) {
51 }
else if (event->type == SDL_EVENT_MOUSE_MOTION) {
53 if (this->delegate.didDrag) {
54 this->delegate.didDrag(
this, event->motion.yrel);
58 }
else if (event->type == SDL_EVENT_MOUSE_BUTTON_UP) {
60 self->
state &= ~ControlStateHighlighted;
68#pragma mark - ScrollHandle
84#pragma mark - Class lifecycle
91 ((ViewInterface *) clazz->interface)->
init =
init;
93 ((ControlInterface *) clazz->interface)->captureEvent =
captureEvent;
107 clazz = _initialize(&(
const ClassDef) {
108 .name =
"ScrollHandle",
112 .interfaceSize =
sizeof(ScrollHandleInterface),
@ ControlStateHighlighted
static void addClassName(View *self, const char *className)
static bool didReceiveEvent(const View *self, const SDL_Event *event)
Controls are Views which capture and respond to events.
unsigned int state
The bit mask of ControlState.
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
View * init(View *self)
Initializes this View.
View * initWithFrame(View *self, const SDL_Rect *frame)
Initializes this View with the specified frame.