128 {
129
131
132 if (event->type == SDL_EVENT_MOUSE_MOTION && (event->motion.state & SDL_BUTTON_LMASK)) {
134
135 SDL_Point offset = this->contentOffset;
136
137 offset.x += event->motion.xrel;
138 offset.y += event->motion.yrel;
139
140 $(this, scrollToOffset, &offset);
141 return true;
142 } else if (event->type == SDL_EVENT_MOUSE_WHEEL) {
143 SDL_Point offset = this->contentOffset;
144
145 offset.x -= event->wheel.x * this->step;
146 offset.y += event->wheel.y * this->step;
147
148 $(this, scrollToOffset, &offset);
149 return true;
150 } else if (event->type == SDL_EVENT_MOUSE_BUTTON_UP && (event->button.button & SDL_BUTTON_LMASK)) {
151
153 self->
state &= ~ControlStateHighlighted;
154 return true;
155 }
156 }
157
159}
static bool isHighlighted(const Control *self)
@ ControlStateHighlighted
Controls are Views which capture and respond to events.
unsigned int state
The bit mask of ControlState.