+
+ gi->checked = TRUE;
+ }
+ else if (gi->type & GD_TYPE_SCROLLBAR)
+ {
+ int mpos = (gi->type == GD_TYPE_SCROLLBAR_HORIZONTAL ? mx : my);
+ int gpos = (gi->type == GD_TYPE_SCROLLBAR_HORIZONTAL ? gi->x : gi->y);
+ int slider_start = gpos + gi->scrollbar.position;
+ int slider_end = gpos + gi->scrollbar.position + gi->scrollbar.size - 1;
+ boolean inside_slider = (mpos >= slider_start && mpos <= slider_end);
+
+ if (!IS_WHEEL_BUTTON(button) && inside_slider)
+ {
+ /* start dragging scrollbar */
+ gi->scrollbar.drag_position =
+ scrollbar_mouse_pos - gi->scrollbar.position;
+ }
+ }
+ else if (gi->type & GD_TYPE_SELECTBOX)
+ {
+ /* keep selectbox open in case of over-large selectbox */
+ keep_selectbox_open = (mouse_inside_select_line &&
+ mouse_inside_select_area);