140 {
141
143
144 if (event->type == SDL_EVENT_MOUSE_MOTION && (event->motion.state & SDL_BUTTON_LMASK)) {
146
147 SDL_Point offset = this->contentOffset;
148
149 offset.x += event->motion.xrel;
150 offset.y += event->motion.yrel;
151
152 $(this, scrollToOffset, &offset);
153 return true;
154 } else if (event->type == SDL_EVENT_MOUSE_WHEEL) {
155 SDL_Point offset = this->contentOffset;
156
157 offset.x -= event->wheel.x * this->step;
158 offset.y += event->wheel.y * this->step;
159
160 $(this, scrollToOffset, &offset);
161 return true;
162 } else if (event->type == SDL_EVENT_MOUSE_BUTTON_UP && (event->button.button & SDL_BUTTON_LMASK)) {
163
165 self->
state &= ~ControlStateHighlighted;
166 return true;
167 }
168 }
169
171}
static bool isHighlighted(const Control *self)
@ ControlStateHighlighted
Controls are Views which capture and respond to events.
unsigned int state
The bit mask of ControlState.