68 {
69
71
72 if (event->type == SDL_MOUSEMOTION && (event->motion.state & SDL_BUTTON_LMASK)) {
74
75 SDL_Point offset = this->contentOffset;
76
77 offset.x += event->motion.xrel;
78 offset.y += event->motion.yrel;
79
81 return true;
82 } else if (event->type == SDL_MOUSEWHEEL) {
83 SDL_Point offset = this->contentOffset;
84
85 offset.x -= event->wheel.x * this->step;
86 offset.y += event->wheel.y * this->step;
87
89 return true;
90 } else if (event->type == SDL_MOUSEBUTTONUP && (event->button.button & SDL_BUTTON_LMASK)) {
91
93 self->
state &= ~ControlStateHighlighted;
94 return true;
95 }
96 }
97
99}
@ ControlStateHighlighted
Controls are Views which capture events and dispatch Actions.
_Bool captureEvent(Control *self, const SDL_Event *event)
Captures a given event, potentially altering the state of this Control.
unsigned int state
The bit mask of ControlState.
_Bool isHighlighted(const Control *self)