{ CA_ARG_4, "4" },
{ CA_ARG_5, "5" },
{ CA_ARG_10, "10" },
+ { CA_ARG_100, "100" },
+ { CA_ARG_1000, "1000" },
{ CA_ARG_UNDEFINED, " " },
{ CA_ARG_NUMBER_MIN, "min" },
{ CA_ARG_NUMBER_MAX, "max" },
{ CA_ARG_4, "4" },
{ CA_ARG_5, "5" },
{ CA_ARG_10, "10" },
+ { CA_ARG_100, "100" },
+ { CA_ARG_1000, "1000" },
{ CA_ARG_UNDEFINED, " " },
{ CA_ARG_NUMBER_MIN, "min" },
{ CA_ARG_NUMBER_MAX, "max" },
static int last_button = 0;
static int last_mx = 0, last_my = 0;
static int pressed_mx = 0, pressed_my = 0;
+ static boolean keep_selectbox_open = FALSE;
int scrollbar_mouse_pos = 0;
struct GadgetInfo *new_gi, *gi;
boolean press_event;
gadget_released_inside_select_area = FALSE;
}
+ /* setting state for handling over-large selectbox */
+ if (keep_selectbox_open && (press_event || !mouse_inside_select_line))
+ keep_selectbox_open = FALSE;
+
/* if new gadget pressed, store this gadget */
if (gadget_pressed)
last_gi = new_gi;
if (gadget_released)
{
if (gi->type & GD_TYPE_SELECTBOX &&
- (mouse_released_where_pressed ||
- !gadget_released_inside_select_area)) /* selectbox stays open */
+ (keep_selectbox_open ||
+ mouse_released_where_pressed ||
+ !gadget_released_inside_select_area)) /* selectbox stays open */
{
gi->selectbox.stay_open = TRUE;
pressed_mx = 0;
if (gi->textarea.cursor_position != old_cursor_position)
DrawGadget(gi, DG_PRESSED, gi->direct_draw);
}
- else if (gi->type & GD_TYPE_SELECTBOX && gi->selectbox.open)
+ else if (gi->type & GD_TYPE_SELECTBOX && gi->selectbox.open &&
+ !keep_selectbox_open)
{
int old_index = gi->selectbox.current_index;
return TRUE;
}
}
+ 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);
+ }
DrawGadget(gi, DG_PRESSED, gi->direct_draw);
else if (gadget_moving_off_borders && gi->state == GD_BUTTON_PRESSED)
DrawGadget(gi, DG_UNPRESSED, gi->direct_draw);
}
- else if (gi->type & GD_TYPE_SELECTBOX)
+ else if (gi->type & GD_TYPE_SELECTBOX && !keep_selectbox_open)
{
int old_index = gi->selectbox.current_index;
if (gi->type & GD_TYPE_SELECTBOX)
{
- if (mouse_released_where_pressed ||
+ if (keep_selectbox_open ||
+ mouse_released_where_pressed ||
!gadget_released_inside_select_area) /* selectbox stays open */
{
deactivate_gadget = FALSE;