rnd-19990125-2
authorHolger Schemel <info@artsoft.org>
Mon, 25 Jan 1999 03:31:13 +0000 (04:31 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:33:14 +0000 (10:33 +0200)
src/editor.c

index f8542695ec65b0fb4b3c1f83f93b128c7b91c319..2812b01e9025311bb389fa9519b7c36a4fd68855 100644 (file)
@@ -4143,8 +4143,23 @@ static void HandleControlButtons(struct GadgetInfo *gi)
       break;
 
     default:
+      if (id >= GADGET_ID_ELEMENTLIST_FIRST &&
+         id <= GADGET_ID_ELEMENTLIST_LAST)
+      {
+       int element_position = id - GADGET_ID_ELEMENTLIST_FIRST;
+       int new_element = editor_element[element_position + element_shift];
+
+       PickDrawingElement(button, new_element);
+
+       if (!HAS_CONTENT(properties_element))
+       {
+         properties_element = new_element;
+         if (edit_mode == ED_MODE_PROPERTIES)
+           DrawPropertiesWindow();
+       }
+      }
 #ifdef DEBUG
-      if (gi->event.type == GD_EVENT_PRESSED)
+      else if (gi->event.type == GD_EVENT_PRESSED)
        printf("default: HandleControlButtons: GD_EVENT_PRESSED\n");
       else if (gi->event.type == GD_EVENT_RELEASED)
        printf("default: HandleControlButtons: GD_EVENT_RELEASED\n");