66 {
67
69
70 if (event->type == SDL_EVENT_MOUSE_MOTION && (event->motion.state & SDL_BUTTON_LMASK)) {
72
73 SDL_Point offset = this->contentOffset;
74
75 offset.x += event->motion.xrel;
76 offset.y += event->motion.yrel;
77
78 $(this, scrollToOffset, &offset);
79 return true;
80 } else if (event->type == SDL_EVENT_MOUSE_WHEEL) {
81 SDL_Point offset = this->contentOffset;
82
83 offset.x -= event->wheel.x * this->step;
84 offset.y += event->wheel.y * this->step;
85
86 $(this, scrollToOffset, &offset);
87 return true;
88 } else if (event->type == SDL_EVENT_MOUSE_BUTTON_UP && (event->button.button & SDL_BUTTON_LMASK)) {
89
91 self->
state &= ~ControlStateHighlighted;
92 return true;
93 }
94 }
95
97}
static bool isHighlighted(const Control *self)
@ ControlStateHighlighted
Controls are Views which capture and respond to events.
unsigned int state
The bit mask of ControlState.