From: Holger Schemel Date: Wed, 26 Jul 2006 16:15:09 +0000 (+0200) Subject: rnd-20060726-4-src X-Git-Tag: 3.2.1^2~35 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=33cf8c53fa267584efab93b15a99fbf78f9fb0c1;p=rocksndiamonds.git rnd-20060726-4-src * added support for scrolling horizontal scrollbars with mouse wheel by holding "Ctrl" button pressed while scrolling the wheel --- diff --git a/ChangeLog b/ChangeLog index 97829c98..08579aa2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * improved level number selection in main menu and player selection in setup menu (input devices section) by using standard button gadgets * added support for mouse scroll wheel (caused buggy behaviour before) + * added support for scrolling horizontal scrollbars with mouse wheel by + holding "Ctrl" button pressed while scrolling the wheel 2006-07-25 * improved general scrollbar handling (when jump-scrolling scrollbars) diff --git a/src/conftime.h b/src/conftime.h index d7774c42..45b374e4 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-07-26 16:18]" +#define COMPILE_DATE_STRING "[2006-07-26 18:08]" diff --git a/src/editor.c b/src/editor.c index ec594406..cee0cd43 100644 --- a/src/editor.c +++ b/src/editor.c @@ -2413,8 +2413,8 @@ static struct ED_SCROLLBAR_XPOS, ED_SCROLLBAR_YPOS, SX + ED_SCROLL_HORIZONTAL_XPOS, SY + ED_SCROLL_HORIZONTAL_YPOS, ED_SCROLL_HORIZONTAL_XSIZE, ED_SCROLL_HORIZONTAL_YSIZE, - -1, -1, - -1, -1, + 0, 0, + SX + SXSIZE + SX, WIN_YSIZE, GD_TYPE_SCROLLBAR_HORIZONTAL, GADGET_ID_SCROLL_HORIZONTAL, "scroll level editing area horizontally" diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index e939f865..b01fe169 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -73,11 +73,14 @@ static struct GadgetInfo *getGadgetInfoFromMousePosition(int mx, int my, /* first check for scrollbars in case of mouse scroll wheel button events */ if (button == 4 || button == 5) { + boolean check_horizontal = (GetKeyModState() & KMOD_Control); + /* check for the first active scrollbar with matching mouse wheel area */ for (gi = gadget_list_first_entry; gi != NULL; gi = gi->next) { if (gi->mapped && gi->active && - gi->type & GD_TYPE_SCROLLBAR && + ((gi->type & GD_TYPE_SCROLLBAR_HORIZONTAL && check_horizontal) || + (gi->type & GD_TYPE_SCROLLBAR_VERTICAL && !check_horizontal)) && mx >= gi->wheelarea.x && mx < gi->wheelarea.x + gi->wheelarea.width && my >= gi->wheelarea.y && my < gi->wheelarea.y + gi->wheelarea.height) return gi;