rnd-20060402-1-src
authorHolger Schemel <info@artsoft.org>
Sun, 2 Apr 2006 10:42:04 +0000 (12:42 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:51:23 +0000 (10:51 +0200)
* fixed handling of over-large selectboxes (less error-prone now)

ChangeLog
src/conftime.h
src/editor.c
src/libgame/gadgets.c
src/main.h

index 3c54da87b6281bc453362dc57ef70c0eb38b6e1c..a57b005d77d2f72fc2636c497ee618d198f2ca2c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2006-04-02
+       * fixed handling of over-large selectboxes (less error-prone now)
+
 2006-04-01
        * added use of "Insert" and "Delete" keys to navigate element list in
          level editor to start of custom elements or start of group elements
index cb6b7aa8c8d26887544505575f240c762ff7ea3b..ad07cdb08e05c8abc4297319c52998415d028bf8 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-04-01 21:21]"
+#define COMPILE_DATE_STRING "[2006-04-02 12:38]"
index 9e29e561f0e281da4447b8fa761ee2628ba5c69f..d628b8be7bb53fb3c7a2e643b05fd125163e098a 100644 (file)
@@ -1751,6 +1751,8 @@ static struct ValueTextInfo options_action_arg_number[] =
   { 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"                           },
@@ -1786,6 +1788,8 @@ static struct ValueTextInfo options_action_arg_value[] =
   { 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"                           },
index 9322fd84a84dd6e05ea92ae41be19f7aeef930e5..00a41a8b94d18fc73c970398e745b3d507aa67f4 100644 (file)
@@ -1385,6 +1385,7 @@ boolean HandleGadgets(int mx, int my, int button)
   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;
@@ -1511,6 +1512,10 @@ boolean HandleGadgets(int mx, int my, int button)
     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;
@@ -1527,8 +1532,9 @@ boolean HandleGadgets(int mx, int my, int button)
   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;
@@ -1589,7 +1595,8 @@ boolean HandleGadgets(int mx, int my, int button)
       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;
 
@@ -1713,6 +1720,12 @@ boolean HandleGadgets(int mx, int my, int button)
        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);
 
@@ -1746,7 +1759,7 @@ boolean HandleGadgets(int mx, int my, int button)
       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;
 
@@ -1818,7 +1831,8 @@ boolean HandleGadgets(int mx, int my, int button)
 
     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;
index 31740d333801224fea2464fbbcb7b57c4c8b874e..682f8b5312e57edac23a16155a4c405c67446e3e 100644 (file)
 #define GFX_ELEMENT(e)         (element_info[e].use_gfx_element ?      \
                                 element_info[e].gfx_element : e)
 
+/* !!! CHECK THIS !!! */
 #if 1
 #define TILE_GFX_ELEMENT(x, y)                                         \
                   (GfxElement[x][y] != EL_UNDEFINED &&                 \