replaced preprocessor constants with enum values
authorHolger Schemel <info@artsoft.org>
Sun, 21 Oct 2018 12:51:07 +0000 (14:51 +0200)
committerHolger Schemel <info@artsoft.org>
Sun, 21 Oct 2018 12:51:07 +0000 (14:51 +0200)
src/editor.c

index 50c147a025d32f57a0e4304256cf98a214c32bce..fe006ee671a98ddc6389d958b8ec9c2870efb7b2 100644 (file)
   -----------------------------------------------------------------------------
 */
 
-/* drawing toolbox buttons */
-#define GADGET_ID_NONE                 -1
-#define GADGET_ID_TOOLBOX_FIRST                0
-
-#define GADGET_ID_SINGLE_ITEMS         (GADGET_ID_TOOLBOX_FIRST + 0)
-#define GADGET_ID_CONNECTED_ITEMS      (GADGET_ID_TOOLBOX_FIRST + 1)
-#define GADGET_ID_LINE                 (GADGET_ID_TOOLBOX_FIRST + 2)
-#define GADGET_ID_ARC                  (GADGET_ID_TOOLBOX_FIRST + 3)
-#define GADGET_ID_RECTANGLE            (GADGET_ID_TOOLBOX_FIRST + 4)
-#define GADGET_ID_FILLED_BOX           (GADGET_ID_TOOLBOX_FIRST + 5)
-#define GADGET_ID_WRAP_UP              (GADGET_ID_TOOLBOX_FIRST + 6)
-#define GADGET_ID_TEXT                 (GADGET_ID_TOOLBOX_FIRST + 7)
-#define GADGET_ID_FLOOD_FILL           (GADGET_ID_TOOLBOX_FIRST + 8)
-#define GADGET_ID_WRAP_LEFT            (GADGET_ID_TOOLBOX_FIRST + 9)
-#define GADGET_ID_ZOOM                 (GADGET_ID_TOOLBOX_FIRST + 10)
-#define GADGET_ID_WRAP_RIGHT           (GADGET_ID_TOOLBOX_FIRST + 11)
-#define GADGET_ID_RANDOM_PLACEMENT     (GADGET_ID_TOOLBOX_FIRST + 12)
-#define GADGET_ID_GRAB_BRUSH           (GADGET_ID_TOOLBOX_FIRST + 13)
-#define GADGET_ID_WRAP_DOWN            (GADGET_ID_TOOLBOX_FIRST + 14)
-#define GADGET_ID_PICK_ELEMENT         (GADGET_ID_TOOLBOX_FIRST + 15)
-
-#define GADGET_ID_UNDO                 (GADGET_ID_TOOLBOX_FIRST + 16)
-#define GADGET_ID_INFO                 (GADGET_ID_TOOLBOX_FIRST + 17)
-#define GADGET_ID_SAVE                 (GADGET_ID_TOOLBOX_FIRST + 18)
-#define GADGET_ID_CLEAR                        (GADGET_ID_TOOLBOX_FIRST + 19)
-#define GADGET_ID_TEST                 (GADGET_ID_TOOLBOX_FIRST + 20)
-#define GADGET_ID_EXIT                 (GADGET_ID_TOOLBOX_FIRST + 21)
-
-#define GADGET_ID_CUSTOM_COPY_FROM     (GADGET_ID_TOOLBOX_FIRST + 22)
-#define GADGET_ID_CUSTOM_COPY_TO       (GADGET_ID_TOOLBOX_FIRST + 23)
-#define GADGET_ID_CUSTOM_EXCHANGE      (GADGET_ID_TOOLBOX_FIRST + 24)
-#define GADGET_ID_CUSTOM_COPY          (GADGET_ID_TOOLBOX_FIRST + 25)
-#define GADGET_ID_CUSTOM_PASTE         (GADGET_ID_TOOLBOX_FIRST + 26)
-
-#define GADGET_ID_PROPERTIES           (GADGET_ID_TOOLBOX_FIRST + 27)
-#define GADGET_ID_ELEMENT_LEFT         (GADGET_ID_TOOLBOX_FIRST + 28)
-#define GADGET_ID_ELEMENT_MIDDLE       (GADGET_ID_TOOLBOX_FIRST + 29)
-#define GADGET_ID_ELEMENT_RIGHT                (GADGET_ID_TOOLBOX_FIRST + 30)
-#define GADGET_ID_PALETTE              (GADGET_ID_TOOLBOX_FIRST + 31)
-
-/* counter gadget identifiers */
-#define GADGET_ID_COUNTER_FIRST                (GADGET_ID_TOOLBOX_FIRST + 32)
-
-#define GADGET_ID_SELECT_LEVEL_DOWN    (GADGET_ID_COUNTER_FIRST + 0)
-#define GADGET_ID_SELECT_LEVEL_TEXT    (GADGET_ID_COUNTER_FIRST + 1)
-#define GADGET_ID_SELECT_LEVEL_UP      (GADGET_ID_COUNTER_FIRST + 2)
-#define GADGET_ID_LEVEL_XSIZE_DOWN     (GADGET_ID_COUNTER_FIRST + 3)
-#define GADGET_ID_LEVEL_XSIZE_TEXT     (GADGET_ID_COUNTER_FIRST + 4)
-#define GADGET_ID_LEVEL_XSIZE_UP       (GADGET_ID_COUNTER_FIRST + 5)
-#define GADGET_ID_LEVEL_YSIZE_DOWN     (GADGET_ID_COUNTER_FIRST + 6)
-#define GADGET_ID_LEVEL_YSIZE_TEXT     (GADGET_ID_COUNTER_FIRST + 7)
-#define GADGET_ID_LEVEL_YSIZE_UP       (GADGET_ID_COUNTER_FIRST + 8)
-#define GADGET_ID_LEVEL_RANDOM_DOWN    (GADGET_ID_COUNTER_FIRST + 9)
-#define GADGET_ID_LEVEL_RANDOM_TEXT    (GADGET_ID_COUNTER_FIRST + 10)
-#define GADGET_ID_LEVEL_RANDOM_UP      (GADGET_ID_COUNTER_FIRST + 11)
-#define GADGET_ID_LEVEL_GEMSLIMIT_DOWN (GADGET_ID_COUNTER_FIRST + 12)
-#define GADGET_ID_LEVEL_GEMSLIMIT_TEXT (GADGET_ID_COUNTER_FIRST + 13)
-#define GADGET_ID_LEVEL_GEMSLIMIT_UP   (GADGET_ID_COUNTER_FIRST + 14)
-#define GADGET_ID_LEVEL_TIMELIMIT_DOWN (GADGET_ID_COUNTER_FIRST + 15)
-#define GADGET_ID_LEVEL_TIMELIMIT_TEXT (GADGET_ID_COUNTER_FIRST + 16)
-#define GADGET_ID_LEVEL_TIMELIMIT_UP   (GADGET_ID_COUNTER_FIRST + 17)
-#define GADGET_ID_LEVEL_TIMESCORE_DOWN (GADGET_ID_COUNTER_FIRST + 18)
-#define GADGET_ID_LEVEL_TIMESCORE_TEXT (GADGET_ID_COUNTER_FIRST + 19)
-#define GADGET_ID_LEVEL_TIMESCORE_UP   (GADGET_ID_COUNTER_FIRST + 20)
-#define GADGET_ID_LEVEL_RANDOM_SEED_DOWN (GADGET_ID_COUNTER_FIRST + 21)
-#define GADGET_ID_LEVEL_RANDOM_SEED_TEXT (GADGET_ID_COUNTER_FIRST + 22)
-#define GADGET_ID_LEVEL_RANDOM_SEED_UP (GADGET_ID_COUNTER_FIRST + 23)
-#define GADGET_ID_LEVELSET_NUM_LEVELS_DOWN (GADGET_ID_COUNTER_FIRST + 24)
-#define GADGET_ID_LEVELSET_NUM_LEVELS_TEXT (GADGET_ID_COUNTER_FIRST + 25)
-#define GADGET_ID_LEVELSET_NUM_LEVELS_UP   (GADGET_ID_COUNTER_FIRST + 26)
-#define GADGET_ID_ELEMENT_VALUE1_DOWN  (GADGET_ID_COUNTER_FIRST + 27)
-#define GADGET_ID_ELEMENT_VALUE1_TEXT  (GADGET_ID_COUNTER_FIRST + 28)
-#define GADGET_ID_ELEMENT_VALUE1_UP    (GADGET_ID_COUNTER_FIRST + 29)
-#define GADGET_ID_ELEMENT_VALUE2_DOWN  (GADGET_ID_COUNTER_FIRST + 30)
-#define GADGET_ID_ELEMENT_VALUE2_TEXT  (GADGET_ID_COUNTER_FIRST + 31)
-#define GADGET_ID_ELEMENT_VALUE2_UP    (GADGET_ID_COUNTER_FIRST + 32)
-#define GADGET_ID_ELEMENT_VALUE3_DOWN  (GADGET_ID_COUNTER_FIRST + 33)
-#define GADGET_ID_ELEMENT_VALUE3_TEXT  (GADGET_ID_COUNTER_FIRST + 34)
-#define GADGET_ID_ELEMENT_VALUE3_UP    (GADGET_ID_COUNTER_FIRST + 35)
-#define GADGET_ID_ELEMENT_VALUE4_DOWN  (GADGET_ID_COUNTER_FIRST + 36)
-#define GADGET_ID_ELEMENT_VALUE4_TEXT  (GADGET_ID_COUNTER_FIRST + 37)
-#define GADGET_ID_ELEMENT_VALUE4_UP    (GADGET_ID_COUNTER_FIRST + 38)
-#define GADGET_ID_YAMYAM_CONTENT_DOWN  (GADGET_ID_COUNTER_FIRST + 39)
-#define GADGET_ID_YAMYAM_CONTENT_TEXT  (GADGET_ID_COUNTER_FIRST + 40)
-#define GADGET_ID_YAMYAM_CONTENT_UP    (GADGET_ID_COUNTER_FIRST + 41)
-#define GADGET_ID_BALL_CONTENT_DOWN    (GADGET_ID_COUNTER_FIRST + 42)
-#define GADGET_ID_BALL_CONTENT_TEXT    (GADGET_ID_COUNTER_FIRST + 43)
-#define GADGET_ID_BALL_CONTENT_UP      (GADGET_ID_COUNTER_FIRST + 44)
-#define GADGET_ID_ANDROID_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 45)
-#define GADGET_ID_ANDROID_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 46)
-#define GADGET_ID_ANDROID_CONTENT_UP   (GADGET_ID_COUNTER_FIRST + 47)
-#define GADGET_ID_ENVELOPE_XSIZE_DOWN  (GADGET_ID_COUNTER_FIRST + 48)
-#define GADGET_ID_ENVELOPE_XSIZE_TEXT  (GADGET_ID_COUNTER_FIRST + 49)
-#define GADGET_ID_ENVELOPE_XSIZE_UP    (GADGET_ID_COUNTER_FIRST + 50)
-#define GADGET_ID_ENVELOPE_YSIZE_DOWN  (GADGET_ID_COUNTER_FIRST + 51)
-#define GADGET_ID_ENVELOPE_YSIZE_TEXT  (GADGET_ID_COUNTER_FIRST + 52)
-#define GADGET_ID_ENVELOPE_YSIZE_UP    (GADGET_ID_COUNTER_FIRST + 53)
-#define GADGET_ID_INVENTORY_SIZE_DOWN  (GADGET_ID_COUNTER_FIRST + 54)
-#define GADGET_ID_INVENTORY_SIZE_TEXT  (GADGET_ID_COUNTER_FIRST + 55)
-#define GADGET_ID_INVENTORY_SIZE_UP    (GADGET_ID_COUNTER_FIRST + 56)
-#define GADGET_ID_CUSTOM_SCORE_DOWN    (GADGET_ID_COUNTER_FIRST + 57)
-#define GADGET_ID_CUSTOM_SCORE_TEXT    (GADGET_ID_COUNTER_FIRST + 58)
-#define GADGET_ID_CUSTOM_SCORE_UP      (GADGET_ID_COUNTER_FIRST + 59)
-#define GADGET_ID_CUSTOM_GEMCOUNT_DOWN (GADGET_ID_COUNTER_FIRST + 60)
-#define GADGET_ID_CUSTOM_GEMCOUNT_TEXT (GADGET_ID_COUNTER_FIRST + 61)
-#define GADGET_ID_CUSTOM_GEMCOUNT_UP   (GADGET_ID_COUNTER_FIRST + 62)
-#define GADGET_ID_CUSTOM_VALUE_FIX_DOWN        (GADGET_ID_COUNTER_FIRST + 63)
-#define GADGET_ID_CUSTOM_VALUE_FIX_TEXT        (GADGET_ID_COUNTER_FIRST + 64)
-#define GADGET_ID_CUSTOM_VALUE_FIX_UP  (GADGET_ID_COUNTER_FIRST + 65)
-#define GADGET_ID_CUSTOM_VALUE_RND_DOWN        (GADGET_ID_COUNTER_FIRST + 66)
-#define GADGET_ID_CUSTOM_VALUE_RND_TEXT        (GADGET_ID_COUNTER_FIRST + 67)
-#define GADGET_ID_CUSTOM_VALUE_RND_UP  (GADGET_ID_COUNTER_FIRST + 68)
-#define GADGET_ID_PUSH_DELAY_FIX_DOWN  (GADGET_ID_COUNTER_FIRST + 69)
-#define GADGET_ID_PUSH_DELAY_FIX_TEXT  (GADGET_ID_COUNTER_FIRST + 70)
-#define GADGET_ID_PUSH_DELAY_FIX_UP    (GADGET_ID_COUNTER_FIRST + 71)
-#define GADGET_ID_PUSH_DELAY_RND_DOWN  (GADGET_ID_COUNTER_FIRST + 72)
-#define GADGET_ID_PUSH_DELAY_RND_TEXT  (GADGET_ID_COUNTER_FIRST + 73)
-#define GADGET_ID_PUSH_DELAY_RND_UP    (GADGET_ID_COUNTER_FIRST + 74)
-#define GADGET_ID_DROP_DELAY_FIX_DOWN  (GADGET_ID_COUNTER_FIRST + 75)
-#define GADGET_ID_DROP_DELAY_FIX_TEXT  (GADGET_ID_COUNTER_FIRST + 76)
-#define GADGET_ID_DROP_DELAY_FIX_UP    (GADGET_ID_COUNTER_FIRST + 77)
-#define GADGET_ID_DROP_DELAY_RND_DOWN  (GADGET_ID_COUNTER_FIRST + 78)
-#define GADGET_ID_DROP_DELAY_RND_TEXT  (GADGET_ID_COUNTER_FIRST + 79)
-#define GADGET_ID_DROP_DELAY_RND_UP    (GADGET_ID_COUNTER_FIRST + 80)
-#define GADGET_ID_MOVE_DELAY_FIX_DOWN  (GADGET_ID_COUNTER_FIRST + 81)
-#define GADGET_ID_MOVE_DELAY_FIX_TEXT  (GADGET_ID_COUNTER_FIRST + 82)
-#define GADGET_ID_MOVE_DELAY_FIX_UP    (GADGET_ID_COUNTER_FIRST + 83)
-#define GADGET_ID_MOVE_DELAY_RND_DOWN  (GADGET_ID_COUNTER_FIRST + 84)
-#define GADGET_ID_MOVE_DELAY_RND_TEXT  (GADGET_ID_COUNTER_FIRST + 85)
-#define GADGET_ID_MOVE_DELAY_RND_UP    (GADGET_ID_COUNTER_FIRST + 86)
-#define GADGET_ID_EXPLOSION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 87)
-#define GADGET_ID_EXPLOSION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 88)
-#define GADGET_ID_EXPLOSION_DELAY_UP   (GADGET_ID_COUNTER_FIRST + 89)
-#define GADGET_ID_IGNITION_DELAY_DOWN  (GADGET_ID_COUNTER_FIRST + 90)
-#define GADGET_ID_IGNITION_DELAY_TEXT  (GADGET_ID_COUNTER_FIRST + 91)
-#define GADGET_ID_IGNITION_DELAY_UP    (GADGET_ID_COUNTER_FIRST + 92)
-#define GADGET_ID_CHANGE_DELAY_FIX_DOWN        (GADGET_ID_COUNTER_FIRST + 93)
-#define GADGET_ID_CHANGE_DELAY_FIX_TEXT        (GADGET_ID_COUNTER_FIRST + 94)
-#define GADGET_ID_CHANGE_DELAY_FIX_UP  (GADGET_ID_COUNTER_FIRST + 95)
-#define GADGET_ID_CHANGE_DELAY_RND_DOWN        (GADGET_ID_COUNTER_FIRST + 96)
-#define GADGET_ID_CHANGE_DELAY_RND_TEXT        (GADGET_ID_COUNTER_FIRST + 97)
-#define GADGET_ID_CHANGE_DELAY_RND_UP  (GADGET_ID_COUNTER_FIRST + 98)
-#define GADGET_ID_CHANGE_CONT_RND_DOWN (GADGET_ID_COUNTER_FIRST + 99)
-#define GADGET_ID_CHANGE_CONT_RND_TEXT (GADGET_ID_COUNTER_FIRST + 100)
-#define GADGET_ID_CHANGE_CONT_RND_UP   (GADGET_ID_COUNTER_FIRST + 101)
-#define GADGET_ID_GROUP_CONTENT_DOWN   (GADGET_ID_COUNTER_FIRST + 102)
-#define GADGET_ID_GROUP_CONTENT_TEXT   (GADGET_ID_COUNTER_FIRST + 103)
-#define GADGET_ID_GROUP_CONTENT_UP     (GADGET_ID_COUNTER_FIRST + 104)
-
-/* drawing area identifiers */
-#define GADGET_ID_DRAWING_AREA_FIRST   (GADGET_ID_COUNTER_FIRST + 105)
-
-#define GADGET_ID_DRAWING_LEVEL                (GADGET_ID_DRAWING_AREA_FIRST + 0)
-#define GADGET_ID_YAMYAM_CONTENT_0     (GADGET_ID_DRAWING_AREA_FIRST + 1)
-#define GADGET_ID_YAMYAM_CONTENT_1     (GADGET_ID_DRAWING_AREA_FIRST + 2)
-#define GADGET_ID_YAMYAM_CONTENT_2     (GADGET_ID_DRAWING_AREA_FIRST + 3)
-#define GADGET_ID_YAMYAM_CONTENT_3     (GADGET_ID_DRAWING_AREA_FIRST + 4)
-#define GADGET_ID_YAMYAM_CONTENT_4     (GADGET_ID_DRAWING_AREA_FIRST + 5)
-#define GADGET_ID_YAMYAM_CONTENT_5     (GADGET_ID_DRAWING_AREA_FIRST + 6)
-#define GADGET_ID_YAMYAM_CONTENT_6     (GADGET_ID_DRAWING_AREA_FIRST + 7)
-#define GADGET_ID_YAMYAM_CONTENT_7     (GADGET_ID_DRAWING_AREA_FIRST + 8)
-#define GADGET_ID_MAGIC_BALL_CONTENT_0 (GADGET_ID_DRAWING_AREA_FIRST + 9)
-#define GADGET_ID_MAGIC_BALL_CONTENT_1 (GADGET_ID_DRAWING_AREA_FIRST + 10)
-#define GADGET_ID_MAGIC_BALL_CONTENT_2 (GADGET_ID_DRAWING_AREA_FIRST + 11)
-#define GADGET_ID_MAGIC_BALL_CONTENT_3 (GADGET_ID_DRAWING_AREA_FIRST + 12)
-#define GADGET_ID_MAGIC_BALL_CONTENT_4 (GADGET_ID_DRAWING_AREA_FIRST + 13)
-#define GADGET_ID_MAGIC_BALL_CONTENT_5 (GADGET_ID_DRAWING_AREA_FIRST + 14)
-#define GADGET_ID_MAGIC_BALL_CONTENT_6 (GADGET_ID_DRAWING_AREA_FIRST + 15)
-#define GADGET_ID_MAGIC_BALL_CONTENT_7 (GADGET_ID_DRAWING_AREA_FIRST + 16)
-#define GADGET_ID_ANDROID_CONTENT      (GADGET_ID_DRAWING_AREA_FIRST + 17)
-#define GADGET_ID_AMOEBA_CONTENT       (GADGET_ID_DRAWING_AREA_FIRST + 18)
-#define GADGET_ID_START_ELEMENT                (GADGET_ID_DRAWING_AREA_FIRST + 19)
-#define GADGET_ID_ARTWORK_ELEMENT      (GADGET_ID_DRAWING_AREA_FIRST + 20)
-#define GADGET_ID_EXPLOSION_ELEMENT    (GADGET_ID_DRAWING_AREA_FIRST + 21)
-#define GADGET_ID_INVENTORY_CONTENT    (GADGET_ID_DRAWING_AREA_FIRST + 22)
-#define GADGET_ID_CUSTOM_GRAPHIC       (GADGET_ID_DRAWING_AREA_FIRST + 23)
-#define GADGET_ID_CUSTOM_CONTENT       (GADGET_ID_DRAWING_AREA_FIRST + 24)
-#define GADGET_ID_CUSTOM_MOVE_ENTER    (GADGET_ID_DRAWING_AREA_FIRST + 25)
-#define GADGET_ID_CUSTOM_MOVE_LEAVE    (GADGET_ID_DRAWING_AREA_FIRST + 26)
-#define GADGET_ID_CUSTOM_CHANGE_TARGET (GADGET_ID_DRAWING_AREA_FIRST + 27)
-#define GADGET_ID_CUSTOM_CHANGE_CONTENT        (GADGET_ID_DRAWING_AREA_FIRST + 28)
-#define GADGET_ID_CUSTOM_CHANGE_TRIGGER        (GADGET_ID_DRAWING_AREA_FIRST + 29)
-#define GADGET_ID_CUSTOM_CHANGE_ACTION (GADGET_ID_DRAWING_AREA_FIRST + 30)
-#define GADGET_ID_GROUP_CONTENT                (GADGET_ID_DRAWING_AREA_FIRST + 31)
-#define GADGET_ID_RANDOM_BACKGROUND    (GADGET_ID_DRAWING_AREA_FIRST + 32)
-
-/* text input identifiers */
-#define GADGET_ID_TEXT_INPUT_FIRST     (GADGET_ID_DRAWING_AREA_FIRST + 33)
-
-#define GADGET_ID_LEVEL_NAME           (GADGET_ID_TEXT_INPUT_FIRST + 0)
-#define GADGET_ID_LEVEL_AUTHOR         (GADGET_ID_TEXT_INPUT_FIRST + 1)
-#define GADGET_ID_LEVELSET_NAME                (GADGET_ID_TEXT_INPUT_FIRST + 2)
-#define GADGET_ID_LEVELSET_AUTHOR      (GADGET_ID_TEXT_INPUT_FIRST + 3)
-#define GADGET_ID_ELEMENT_NAME         (GADGET_ID_TEXT_INPUT_FIRST + 4)
-
-/* text area identifiers */
-#define GADGET_ID_TEXT_AREA_FIRST      (GADGET_ID_TEXT_INPUT_FIRST + 5)
-
-#define GADGET_ID_ENVELOPE_INFO                (GADGET_ID_TEXT_AREA_FIRST + 0)
-
-/* selectbox identifiers */
-#define GADGET_ID_SELECTBOX_FIRST      (GADGET_ID_TEXT_AREA_FIRST + 1)
-
-#define GADGET_ID_TIME_OR_STEPS                (GADGET_ID_SELECTBOX_FIRST + 0)
-#define GADGET_ID_GAME_ENGINE_TYPE     (GADGET_ID_SELECTBOX_FIRST + 1)
-#define GADGET_ID_LEVELSET_SAVE_MODE   (GADGET_ID_SELECTBOX_FIRST + 2)
-#define GADGET_ID_WIND_DIRECTION       (GADGET_ID_SELECTBOX_FIRST + 3)
-#define GADGET_ID_PLAYER_SPEED         (GADGET_ID_SELECTBOX_FIRST + 4)
-#define GADGET_ID_CUSTOM_WALK_TO_ACTION        (GADGET_ID_SELECTBOX_FIRST + 5)
-#define GADGET_ID_CUSTOM_EXPLOSION_TYPE        (GADGET_ID_SELECTBOX_FIRST + 6)
-#define GADGET_ID_CUSTOM_DEADLINESS    (GADGET_ID_SELECTBOX_FIRST + 7)
-#define GADGET_ID_CUSTOM_MOVE_PATTERN  (GADGET_ID_SELECTBOX_FIRST + 8)
-#define GADGET_ID_CUSTOM_MOVE_DIRECTION        (GADGET_ID_SELECTBOX_FIRST + 9)
-#define GADGET_ID_CUSTOM_MOVE_STEPSIZE (GADGET_ID_SELECTBOX_FIRST + 10)
-#define GADGET_ID_CUSTOM_MOVE_LEAVE_TYPE (GADGET_ID_SELECTBOX_FIRST + 11)
-#define GADGET_ID_CUSTOM_SMASH_TARGETS (GADGET_ID_SELECTBOX_FIRST + 12)
-#define GADGET_ID_CUSTOM_SLIPPERY_TYPE (GADGET_ID_SELECTBOX_FIRST + 13)
-#define GADGET_ID_CUSTOM_ACCESS_TYPE   (GADGET_ID_SELECTBOX_FIRST + 14)
-#define GADGET_ID_CUSTOM_ACCESS_LAYER  (GADGET_ID_SELECTBOX_FIRST + 15)
-#define GADGET_ID_CUSTOM_ACCESS_PROTECTED (GADGET_ID_SELECTBOX_FIRST + 16)
-#define GADGET_ID_CUSTOM_ACCESS_DIRECTION (GADGET_ID_SELECTBOX_FIRST + 17)
-#define GADGET_ID_CHANGE_TIME_UNITS    (GADGET_ID_SELECTBOX_FIRST + 18)
-#define GADGET_ID_CHANGE_DIRECT_ACTION (GADGET_ID_SELECTBOX_FIRST + 19)
-#define GADGET_ID_CHANGE_OTHER_ACTION  (GADGET_ID_SELECTBOX_FIRST + 20)
-#define GADGET_ID_CHANGE_SIDE          (GADGET_ID_SELECTBOX_FIRST + 21)
-#define GADGET_ID_CHANGE_PLAYER                (GADGET_ID_SELECTBOX_FIRST + 22)
-#define GADGET_ID_CHANGE_PAGE          (GADGET_ID_SELECTBOX_FIRST + 23)
-#define GADGET_ID_CHANGE_REPLACE_WHEN  (GADGET_ID_SELECTBOX_FIRST + 24)
-#define GADGET_ID_ACTION_TYPE          (GADGET_ID_SELECTBOX_FIRST + 25)
-#define GADGET_ID_ACTION_MODE          (GADGET_ID_SELECTBOX_FIRST + 26)
-#define GADGET_ID_ACTION_ARG           (GADGET_ID_SELECTBOX_FIRST + 27)
-#define GADGET_ID_SELECT_CHANGE_PAGE   (GADGET_ID_SELECTBOX_FIRST + 28)
-#define GADGET_ID_GROUP_CHOICE_MODE    (GADGET_ID_SELECTBOX_FIRST + 29)
-
-/* textbutton identifiers */
-#define GADGET_ID_TEXTBUTTON_FIRST     (GADGET_ID_SELECTBOX_FIRST + 30)
-
-#define GADGET_ID_LEVELINFO_LEVEL      (GADGET_ID_TEXTBUTTON_FIRST + 0)
-#define GADGET_ID_LEVELINFO_LEVELSET   (GADGET_ID_TEXTBUTTON_FIRST + 1)
-#define GADGET_ID_LEVELINFO_EDITOR     (GADGET_ID_TEXTBUTTON_FIRST + 2)
-#define GADGET_ID_PROPERTIES_INFO      (GADGET_ID_TEXTBUTTON_FIRST + 3)
-#define GADGET_ID_PROPERTIES_CONFIG    (GADGET_ID_TEXTBUTTON_FIRST + 4)
-#define GADGET_ID_PROPERTIES_CONFIG_1  (GADGET_ID_TEXTBUTTON_FIRST + 5)
-#define GADGET_ID_PROPERTIES_CONFIG_2  (GADGET_ID_TEXTBUTTON_FIRST + 6)
-#define GADGET_ID_PROPERTIES_CHANGE    (GADGET_ID_TEXTBUTTON_FIRST + 7)
-#define GADGET_ID_SAVE_AS_TEMPLATE_1   (GADGET_ID_TEXTBUTTON_FIRST + 8)
-#define GADGET_ID_SAVE_AS_TEMPLATE_2   (GADGET_ID_TEXTBUTTON_FIRST + 9)
-#define GADGET_ID_SAVE_LEVELSET                (GADGET_ID_TEXTBUTTON_FIRST + 10)
-#define GADGET_ID_ADD_CHANGE_PAGE      (GADGET_ID_TEXTBUTTON_FIRST + 11)
-#define GADGET_ID_DEL_CHANGE_PAGE      (GADGET_ID_TEXTBUTTON_FIRST + 12)
-
-/* graphicbutton identifiers */
-#define GADGET_ID_GRAPHICBUTTON_FIRST  (GADGET_ID_TEXTBUTTON_FIRST + 13)
-
-#define GADGET_ID_PREV_CHANGE_PAGE     (GADGET_ID_GRAPHICBUTTON_FIRST + 0)
-#define GADGET_ID_NEXT_CHANGE_PAGE     (GADGET_ID_GRAPHICBUTTON_FIRST + 1)
-#define GADGET_ID_COPY_CHANGE_PAGE     (GADGET_ID_GRAPHICBUTTON_FIRST + 2)
-#define GADGET_ID_PASTE_CHANGE_PAGE    (GADGET_ID_GRAPHICBUTTON_FIRST + 3)
-
-/* gadgets for scrolling of drawing area */
-#define GADGET_ID_SCROLLING_FIRST      (GADGET_ID_GRAPHICBUTTON_FIRST + 4)
-
-#define GADGET_ID_SCROLL_UP            (GADGET_ID_SCROLLING_FIRST + 0)
-#define GADGET_ID_SCROLL_DOWN          (GADGET_ID_SCROLLING_FIRST + 1)
-#define GADGET_ID_SCROLL_LEFT          (GADGET_ID_SCROLLING_FIRST + 2)
-#define GADGET_ID_SCROLL_RIGHT         (GADGET_ID_SCROLLING_FIRST + 3)
-#define GADGET_ID_SCROLL_HORIZONTAL    (GADGET_ID_SCROLLING_FIRST + 4)
-#define GADGET_ID_SCROLL_VERTICAL      (GADGET_ID_SCROLLING_FIRST + 5)
-
-/* gadgets for scrolling element list */
-#define GADGET_ID_SCROLLING_LIST_FIRST (GADGET_ID_SCROLLING_FIRST + 6)
-
-#define GADGET_ID_SCROLL_LIST_UP       (GADGET_ID_SCROLLING_LIST_FIRST + 0)
-#define GADGET_ID_SCROLL_LIST_DOWN     (GADGET_ID_SCROLLING_LIST_FIRST + 1)
-#define GADGET_ID_SCROLL_LIST_VERTICAL (GADGET_ID_SCROLLING_LIST_FIRST + 2)
-
-/* checkbuttons/radiobuttons for level/element properties */
-#define GADGET_ID_CHECKBUTTON_FIRST    (GADGET_ID_SCROLLING_LIST_FIRST + 3)
-
-#define GADGET_ID_AUTO_COUNT_GEMS      (GADGET_ID_CHECKBUTTON_FIRST + 0)
-#define GADGET_ID_USE_LEVELSET_ARTWORK (GADGET_ID_CHECKBUTTON_FIRST + 1)
-#define GADGET_ID_COPY_LEVEL_TEMPLATE  (GADGET_ID_CHECKBUTTON_FIRST + 2)
-#define GADGET_ID_RANDOM_PERCENTAGE    (GADGET_ID_CHECKBUTTON_FIRST + 3)
-#define GADGET_ID_RANDOM_QUANTITY      (GADGET_ID_CHECKBUTTON_FIRST + 4)
-#define GADGET_ID_RANDOM_RESTRICTED    (GADGET_ID_CHECKBUTTON_FIRST + 5)
-#define GADGET_ID_STICK_ELEMENT                (GADGET_ID_CHECKBUTTON_FIRST + 6)
-#define GADGET_ID_EM_SLIPPERY_GEMS     (GADGET_ID_CHECKBUTTON_FIRST + 7)
-#define GADGET_ID_EM_EXPLODES_BY_FIRE  (GADGET_ID_CHECKBUTTON_FIRST + 8)
-#define GADGET_ID_USE_SPRING_BUG       (GADGET_ID_CHECKBUTTON_FIRST + 9)
-#define GADGET_ID_USE_TIME_ORB_BUG     (GADGET_ID_CHECKBUTTON_FIRST + 10)
-#define GADGET_ID_USE_LIFE_BUGS                (GADGET_ID_CHECKBUTTON_FIRST + 11)
-#define GADGET_ID_RANDOM_BALL_CONTENT  (GADGET_ID_CHECKBUTTON_FIRST + 12)
-#define GADGET_ID_INITIAL_BALL_STATE   (GADGET_ID_CHECKBUTTON_FIRST + 13)
-#define GADGET_ID_GROW_INTO_DIGGABLE   (GADGET_ID_CHECKBUTTON_FIRST + 14)
-#define GADGET_ID_AUTO_EXIT_SOKOBAN    (GADGET_ID_CHECKBUTTON_FIRST + 15)
-#define GADGET_ID_SOLVED_BY_ONE_PLAYER (GADGET_ID_CHECKBUTTON_FIRST + 16)
-#define GADGET_ID_CONTINUOUS_SNAPPING  (GADGET_ID_CHECKBUTTON_FIRST + 17)
-#define GADGET_ID_BLOCK_SNAP_FIELD     (GADGET_ID_CHECKBUTTON_FIRST + 18)
-#define GADGET_ID_BLOCK_LAST_FIELD     (GADGET_ID_CHECKBUTTON_FIRST + 19)
-#define GADGET_ID_SP_BLOCK_LAST_FIELD  (GADGET_ID_CHECKBUTTON_FIRST + 20)
-#define GADGET_ID_INSTANT_RELOCATION   (GADGET_ID_CHECKBUTTON_FIRST + 21)
-#define GADGET_ID_SHIFTED_RELOCATION   (GADGET_ID_CHECKBUTTON_FIRST + 22)
-#define GADGET_ID_LAZY_RELOCATION      (GADGET_ID_CHECKBUTTON_FIRST + 23)
-#define GADGET_ID_USE_START_ELEMENT    (GADGET_ID_CHECKBUTTON_FIRST + 24)
-#define GADGET_ID_USE_ARTWORK_ELEMENT  (GADGET_ID_CHECKBUTTON_FIRST + 25)
-#define GADGET_ID_USE_EXPLOSION_ELEMENT        (GADGET_ID_CHECKBUTTON_FIRST + 26)
-#define GADGET_ID_INITIAL_GRAVITY      (GADGET_ID_CHECKBUTTON_FIRST + 27)
-#define GADGET_ID_USE_INITIAL_INVENTORY        (GADGET_ID_CHECKBUTTON_FIRST + 28)
-#define GADGET_ID_CAN_PASS_TO_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 29)
-#define GADGET_ID_CAN_FALL_INTO_ACID   (GADGET_ID_CHECKBUTTON_FIRST + 30)
-#define GADGET_ID_CAN_MOVE_INTO_ACID   (GADGET_ID_CHECKBUTTON_FIRST + 31)
-#define GADGET_ID_DONT_COLLIDE_WITH    (GADGET_ID_CHECKBUTTON_FIRST + 32)
-#define GADGET_ID_ENVELOPE_AUTOWRAP    (GADGET_ID_CHECKBUTTON_FIRST + 33)
-#define GADGET_ID_ENVELOPE_CENTERED    (GADGET_ID_CHECKBUTTON_FIRST + 34)
-#define GADGET_ID_MM_LASER_RED         (GADGET_ID_CHECKBUTTON_FIRST + 35)
-#define GADGET_ID_MM_LASER_GREEN       (GADGET_ID_CHECKBUTTON_FIRST + 36)
-#define GADGET_ID_MM_LASER_BLUE                (GADGET_ID_CHECKBUTTON_FIRST + 37)
-#define GADGET_ID_DF_LASER_RED         (GADGET_ID_CHECKBUTTON_FIRST + 38)
-#define GADGET_ID_DF_LASER_GREEN       (GADGET_ID_CHECKBUTTON_FIRST + 39)
-#define GADGET_ID_DF_LASER_BLUE                (GADGET_ID_CHECKBUTTON_FIRST + 40)
-#define GADGET_ID_CUSTOM_INDESTRUCTIBLE        (GADGET_ID_CHECKBUTTON_FIRST + 41)
-#define GADGET_ID_CUSTOM_CAN_EXPLODE   (GADGET_ID_CHECKBUTTON_FIRST + 42)
-#define GADGET_ID_CUSTOM_EXPLODE_FIRE  (GADGET_ID_CHECKBUTTON_FIRST + 43)
-#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 44)
-#define GADGET_ID_CUSTOM_EXPLODE_IMPACT        (GADGET_ID_CHECKBUTTON_FIRST + 45)
-#define GADGET_ID_CUSTOM_WALK_TO_OBJECT        (GADGET_ID_CHECKBUTTON_FIRST + 46)
-#define GADGET_ID_CUSTOM_DEADLY                (GADGET_ID_CHECKBUTTON_FIRST + 47)
-#define GADGET_ID_CUSTOM_CAN_MOVE      (GADGET_ID_CHECKBUTTON_FIRST + 48)
-#define GADGET_ID_CUSTOM_CAN_FALL      (GADGET_ID_CHECKBUTTON_FIRST + 49)
-#define GADGET_ID_CUSTOM_CAN_SMASH     (GADGET_ID_CHECKBUTTON_FIRST + 50)
-#define GADGET_ID_CUSTOM_SLIPPERY      (GADGET_ID_CHECKBUTTON_FIRST + 51)
-#define GADGET_ID_CUSTOM_ACCESSIBLE    (GADGET_ID_CHECKBUTTON_FIRST + 52)
-#define GADGET_ID_CUSTOM_GRAV_REACHABLE        (GADGET_ID_CHECKBUTTON_FIRST + 53)
-#define GADGET_ID_CUSTOM_USE_LAST_VALUE        (GADGET_ID_CHECKBUTTON_FIRST + 54)
-#define GADGET_ID_CUSTOM_USE_GRAPHIC   (GADGET_ID_CHECKBUTTON_FIRST + 55)
-#define GADGET_ID_CUSTOM_USE_TEMPLATE_1        (GADGET_ID_CHECKBUTTON_FIRST + 56)
-#define GADGET_ID_CUSTOM_USE_TEMPLATE_2        (GADGET_ID_CHECKBUTTON_FIRST + 57)
-#define GADGET_ID_CUSTOM_USE_TEMPLATE_3        (GADGET_ID_CHECKBUTTON_FIRST + 58)
-#define GADGET_ID_CUSTOM_CAN_CHANGE    (GADGET_ID_CHECKBUTTON_FIRST + 59)
-#define GADGET_ID_CHANGE_USE_CONTENT   (GADGET_ID_CHECKBUTTON_FIRST + 60)
-#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 61)
-#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 62)
-#define GADGET_ID_CHANGE_USE_RANDOM    (GADGET_ID_CHECKBUTTON_FIRST + 63)
-#define GADGET_ID_CHANGE_HAS_ACTION    (GADGET_ID_CHECKBUTTON_FIRST + 64)
-#define GADGET_ID_CHANGE_DELAY         (GADGET_ID_CHECKBUTTON_FIRST + 65)
-#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 66)
-#define GADGET_ID_CHANGE_BY_OTHER_ACT  (GADGET_ID_CHECKBUTTON_FIRST + 67)
-
-/* gadgets for buttons in element list */
-#define GADGET_ID_ELEMENTLIST_FIRST    (GADGET_ID_CHECKBUTTON_FIRST + 68)
+enum
+{
+  GADGET_ID_NONE = -1,
+
+  /* drawing toolbox buttons */
+
+  GADGET_ID_SINGLE_ITEMS,
+  GADGET_ID_CONNECTED_ITEMS,
+  GADGET_ID_LINE,
+  GADGET_ID_ARC,
+  GADGET_ID_RECTANGLE,
+  GADGET_ID_FILLED_BOX,
+  GADGET_ID_WRAP_UP,
+  GADGET_ID_TEXT,
+  GADGET_ID_FLOOD_FILL,
+  GADGET_ID_WRAP_LEFT,
+  GADGET_ID_ZOOM,
+  GADGET_ID_WRAP_RIGHT,
+  GADGET_ID_RANDOM_PLACEMENT,
+  GADGET_ID_GRAB_BRUSH,
+  GADGET_ID_WRAP_DOWN,
+  GADGET_ID_PICK_ELEMENT,
+
+  GADGET_ID_UNDO,
+  GADGET_ID_INFO,
+  GADGET_ID_SAVE,
+  GADGET_ID_CLEAR,
+  GADGET_ID_TEST,
+  GADGET_ID_EXIT,
+
+  GADGET_ID_CUSTOM_COPY_FROM,
+  GADGET_ID_CUSTOM_COPY_TO,
+  GADGET_ID_CUSTOM_EXCHANGE,
+  GADGET_ID_CUSTOM_COPY,
+  GADGET_ID_CUSTOM_PASTE,
+
+  GADGET_ID_PROPERTIES,
+  GADGET_ID_ELEMENT_LEFT,
+  GADGET_ID_ELEMENT_MIDDLE,
+  GADGET_ID_ELEMENT_RIGHT,
+  GADGET_ID_PALETTE,
+
+  /* counter gadget identifiers */
+
+  GADGET_ID_SELECT_LEVEL_DOWN,
+  GADGET_ID_SELECT_LEVEL_TEXT,
+  GADGET_ID_SELECT_LEVEL_UP,
+  GADGET_ID_LEVEL_XSIZE_DOWN,
+  GADGET_ID_LEVEL_XSIZE_TEXT,
+  GADGET_ID_LEVEL_XSIZE_UP,
+  GADGET_ID_LEVEL_YSIZE_DOWN,
+  GADGET_ID_LEVEL_YSIZE_TEXT,
+  GADGET_ID_LEVEL_YSIZE_UP,
+  GADGET_ID_LEVEL_RANDOM_DOWN,
+  GADGET_ID_LEVEL_RANDOM_TEXT,
+  GADGET_ID_LEVEL_RANDOM_UP,
+  GADGET_ID_LEVEL_GEMSLIMIT_DOWN,
+  GADGET_ID_LEVEL_GEMSLIMIT_TEXT,
+  GADGET_ID_LEVEL_GEMSLIMIT_UP,
+  GADGET_ID_LEVEL_TIMELIMIT_DOWN,
+  GADGET_ID_LEVEL_TIMELIMIT_TEXT,
+  GADGET_ID_LEVEL_TIMELIMIT_UP,
+  GADGET_ID_LEVEL_TIMESCORE_DOWN,
+  GADGET_ID_LEVEL_TIMESCORE_TEXT,
+  GADGET_ID_LEVEL_TIMESCORE_UP,
+  GADGET_ID_LEVEL_RANDOM_SEED_DOWN,
+  GADGET_ID_LEVEL_RANDOM_SEED_TEXT,
+  GADGET_ID_LEVEL_RANDOM_SEED_UP,
+  GADGET_ID_LEVELSET_NUM_LEVELS_DOWN,
+  GADGET_ID_LEVELSET_NUM_LEVELS_TEXT,
+  GADGET_ID_LEVELSET_NUM_LEVELS_UP,
+  GADGET_ID_ELEMENT_VALUE1_DOWN,
+  GADGET_ID_ELEMENT_VALUE1_TEXT,
+  GADGET_ID_ELEMENT_VALUE1_UP,
+  GADGET_ID_ELEMENT_VALUE2_DOWN,
+  GADGET_ID_ELEMENT_VALUE2_TEXT,
+  GADGET_ID_ELEMENT_VALUE2_UP,
+  GADGET_ID_ELEMENT_VALUE3_DOWN,
+  GADGET_ID_ELEMENT_VALUE3_TEXT,
+  GADGET_ID_ELEMENT_VALUE3_UP,
+  GADGET_ID_ELEMENT_VALUE4_DOWN,
+  GADGET_ID_ELEMENT_VALUE4_TEXT,
+  GADGET_ID_ELEMENT_VALUE4_UP,
+  GADGET_ID_YAMYAM_CONTENT_DOWN,
+  GADGET_ID_YAMYAM_CONTENT_TEXT,
+  GADGET_ID_YAMYAM_CONTENT_UP,
+  GADGET_ID_BALL_CONTENT_DOWN,
+  GADGET_ID_BALL_CONTENT_TEXT,
+  GADGET_ID_BALL_CONTENT_UP,
+  GADGET_ID_ANDROID_CONTENT_DOWN,
+  GADGET_ID_ANDROID_CONTENT_TEXT,
+  GADGET_ID_ANDROID_CONTENT_UP,
+  GADGET_ID_ENVELOPE_XSIZE_DOWN,
+  GADGET_ID_ENVELOPE_XSIZE_TEXT,
+  GADGET_ID_ENVELOPE_XSIZE_UP,
+  GADGET_ID_ENVELOPE_YSIZE_DOWN,
+  GADGET_ID_ENVELOPE_YSIZE_TEXT,
+  GADGET_ID_ENVELOPE_YSIZE_UP,
+  GADGET_ID_INVENTORY_SIZE_DOWN,
+  GADGET_ID_INVENTORY_SIZE_TEXT,
+  GADGET_ID_INVENTORY_SIZE_UP,
+  GADGET_ID_CUSTOM_SCORE_DOWN,
+  GADGET_ID_CUSTOM_SCORE_TEXT,
+  GADGET_ID_CUSTOM_SCORE_UP,
+  GADGET_ID_CUSTOM_GEMCOUNT_DOWN,
+  GADGET_ID_CUSTOM_GEMCOUNT_TEXT,
+  GADGET_ID_CUSTOM_GEMCOUNT_UP,
+  GADGET_ID_CUSTOM_VALUE_FIX_DOWN,
+  GADGET_ID_CUSTOM_VALUE_FIX_TEXT,
+  GADGET_ID_CUSTOM_VALUE_FIX_UP,
+  GADGET_ID_CUSTOM_VALUE_RND_DOWN,
+  GADGET_ID_CUSTOM_VALUE_RND_TEXT,
+  GADGET_ID_CUSTOM_VALUE_RND_UP,
+  GADGET_ID_PUSH_DELAY_FIX_DOWN,
+  GADGET_ID_PUSH_DELAY_FIX_TEXT,
+  GADGET_ID_PUSH_DELAY_FIX_UP,
+  GADGET_ID_PUSH_DELAY_RND_DOWN,
+  GADGET_ID_PUSH_DELAY_RND_TEXT,
+  GADGET_ID_PUSH_DELAY_RND_UP,
+  GADGET_ID_DROP_DELAY_FIX_DOWN,
+  GADGET_ID_DROP_DELAY_FIX_TEXT,
+  GADGET_ID_DROP_DELAY_FIX_UP,
+  GADGET_ID_DROP_DELAY_RND_DOWN,
+  GADGET_ID_DROP_DELAY_RND_TEXT,
+  GADGET_ID_DROP_DELAY_RND_UP,
+  GADGET_ID_MOVE_DELAY_FIX_DOWN,
+  GADGET_ID_MOVE_DELAY_FIX_TEXT,
+  GADGET_ID_MOVE_DELAY_FIX_UP,
+  GADGET_ID_MOVE_DELAY_RND_DOWN,
+  GADGET_ID_MOVE_DELAY_RND_TEXT,
+  GADGET_ID_MOVE_DELAY_RND_UP,
+  GADGET_ID_EXPLOSION_DELAY_DOWN,
+  GADGET_ID_EXPLOSION_DELAY_TEXT,
+  GADGET_ID_EXPLOSION_DELAY_UP,
+  GADGET_ID_IGNITION_DELAY_DOWN,
+  GADGET_ID_IGNITION_DELAY_TEXT,
+  GADGET_ID_IGNITION_DELAY_UP,
+  GADGET_ID_CHANGE_DELAY_FIX_DOWN,
+  GADGET_ID_CHANGE_DELAY_FIX_TEXT,
+  GADGET_ID_CHANGE_DELAY_FIX_UP,
+  GADGET_ID_CHANGE_DELAY_RND_DOWN,
+  GADGET_ID_CHANGE_DELAY_RND_TEXT,
+  GADGET_ID_CHANGE_DELAY_RND_UP,
+  GADGET_ID_CHANGE_CONT_RND_DOWN,
+  GADGET_ID_CHANGE_CONT_RND_TEXT,
+  GADGET_ID_CHANGE_CONT_RND_UP,
+  GADGET_ID_GROUP_CONTENT_DOWN,
+  GADGET_ID_GROUP_CONTENT_TEXT,
+  GADGET_ID_GROUP_CONTENT_UP,
+
+  /* drawing area identifiers */
+
+  GADGET_ID_DRAWING_LEVEL,
+  GADGET_ID_YAMYAM_CONTENT_0,
+  GADGET_ID_YAMYAM_CONTENT_1,
+  GADGET_ID_YAMYAM_CONTENT_2,
+  GADGET_ID_YAMYAM_CONTENT_3,
+  GADGET_ID_YAMYAM_CONTENT_4,
+  GADGET_ID_YAMYAM_CONTENT_5,
+  GADGET_ID_YAMYAM_CONTENT_6,
+  GADGET_ID_YAMYAM_CONTENT_7,
+  GADGET_ID_MAGIC_BALL_CONTENT_0,
+  GADGET_ID_MAGIC_BALL_CONTENT_1,
+  GADGET_ID_MAGIC_BALL_CONTENT_2,
+  GADGET_ID_MAGIC_BALL_CONTENT_3,
+  GADGET_ID_MAGIC_BALL_CONTENT_4,
+  GADGET_ID_MAGIC_BALL_CONTENT_5,
+  GADGET_ID_MAGIC_BALL_CONTENT_6,
+  GADGET_ID_MAGIC_BALL_CONTENT_7,
+  GADGET_ID_ANDROID_CONTENT,
+  GADGET_ID_AMOEBA_CONTENT,
+  GADGET_ID_START_ELEMENT,
+  GADGET_ID_ARTWORK_ELEMENT,
+  GADGET_ID_EXPLOSION_ELEMENT,
+  GADGET_ID_INVENTORY_CONTENT,
+  GADGET_ID_CUSTOM_GRAPHIC,
+  GADGET_ID_CUSTOM_CONTENT,
+  GADGET_ID_CUSTOM_MOVE_ENTER,
+  GADGET_ID_CUSTOM_MOVE_LEAVE,
+  GADGET_ID_CUSTOM_CHANGE_TARGET,
+  GADGET_ID_CUSTOM_CHANGE_CONTENT,
+  GADGET_ID_CUSTOM_CHANGE_TRIGGER,
+  GADGET_ID_CUSTOM_CHANGE_ACTION,
+  GADGET_ID_GROUP_CONTENT,
+  GADGET_ID_RANDOM_BACKGROUND,
+
+  /* text input identifiers */
+
+  GADGET_ID_LEVEL_NAME,
+  GADGET_ID_LEVEL_AUTHOR,
+  GADGET_ID_LEVELSET_NAME,
+  GADGET_ID_LEVELSET_AUTHOR,
+  GADGET_ID_ELEMENT_NAME,
+
+  /* text area identifiers */
+
+  GADGET_ID_ENVELOPE_INFO,
+
+  /* selectbox identifiers */
+
+  GADGET_ID_TIME_OR_STEPS,
+  GADGET_ID_GAME_ENGINE_TYPE,
+  GADGET_ID_LEVELSET_SAVE_MODE,
+  GADGET_ID_WIND_DIRECTION,
+  GADGET_ID_PLAYER_SPEED,
+  GADGET_ID_CUSTOM_WALK_TO_ACTION,
+  GADGET_ID_CUSTOM_EXPLOSION_TYPE,
+  GADGET_ID_CUSTOM_DEADLINESS,
+  GADGET_ID_CUSTOM_MOVE_PATTERN,
+  GADGET_ID_CUSTOM_MOVE_DIRECTION,
+  GADGET_ID_CUSTOM_MOVE_STEPSIZE,
+  GADGET_ID_CUSTOM_MOVE_LEAVE_TYPE,
+  GADGET_ID_CUSTOM_SMASH_TARGETS,
+  GADGET_ID_CUSTOM_SLIPPERY_TYPE,
+  GADGET_ID_CUSTOM_ACCESS_TYPE,
+  GADGET_ID_CUSTOM_ACCESS_LAYER,
+  GADGET_ID_CUSTOM_ACCESS_PROTECTED,
+  GADGET_ID_CUSTOM_ACCESS_DIRECTION,
+  GADGET_ID_CHANGE_TIME_UNITS,
+  GADGET_ID_CHANGE_DIRECT_ACTION,
+  GADGET_ID_CHANGE_OTHER_ACTION,
+  GADGET_ID_CHANGE_SIDE,
+  GADGET_ID_CHANGE_PLAYER,
+  GADGET_ID_CHANGE_PAGE,
+  GADGET_ID_CHANGE_REPLACE_WHEN,
+  GADGET_ID_ACTION_TYPE,
+  GADGET_ID_ACTION_MODE,
+  GADGET_ID_ACTION_ARG,
+  GADGET_ID_SELECT_CHANGE_PAGE,
+  GADGET_ID_GROUP_CHOICE_MODE,
+
+  /* textbutton identifiers */
+
+  GADGET_ID_LEVELINFO_LEVEL,
+  GADGET_ID_LEVELINFO_LEVELSET,
+  GADGET_ID_LEVELINFO_EDITOR,
+  GADGET_ID_PROPERTIES_INFO,
+  GADGET_ID_PROPERTIES_CONFIG,
+  GADGET_ID_PROPERTIES_CONFIG_1,
+  GADGET_ID_PROPERTIES_CONFIG_2,
+  GADGET_ID_PROPERTIES_CHANGE,
+  GADGET_ID_SAVE_AS_TEMPLATE_1,
+  GADGET_ID_SAVE_AS_TEMPLATE_2,
+  GADGET_ID_SAVE_LEVELSET,
+  GADGET_ID_ADD_CHANGE_PAGE,
+  GADGET_ID_DEL_CHANGE_PAGE,
+
+  /* graphicbutton identifiers */
+
+  GADGET_ID_PREV_CHANGE_PAGE,
+  GADGET_ID_NEXT_CHANGE_PAGE,
+  GADGET_ID_COPY_CHANGE_PAGE,
+  GADGET_ID_PASTE_CHANGE_PAGE,
+
+  /* gadgets for scrolling of drawing area */
+
+  GADGET_ID_SCROLL_UP,
+  GADGET_ID_SCROLL_DOWN,
+  GADGET_ID_SCROLL_LEFT,
+  GADGET_ID_SCROLL_RIGHT,
+  GADGET_ID_SCROLL_HORIZONTAL,
+  GADGET_ID_SCROLL_VERTICAL,
+
+  /* gadgets for scrolling element list */
+
+  GADGET_ID_SCROLL_LIST_UP,
+  GADGET_ID_SCROLL_LIST_DOWN,
+  GADGET_ID_SCROLL_LIST_VERTICAL,
+
+  /* checkbuttons/radiobuttons for level/element properties */
+
+  GADGET_ID_AUTO_COUNT_GEMS,
+  GADGET_ID_USE_LEVELSET_ARTWORK,
+  GADGET_ID_COPY_LEVEL_TEMPLATE,
+  GADGET_ID_RANDOM_PERCENTAGE,
+  GADGET_ID_RANDOM_QUANTITY,
+  GADGET_ID_RANDOM_RESTRICTED,
+  GADGET_ID_STICK_ELEMENT,
+  GADGET_ID_EM_SLIPPERY_GEMS,
+  GADGET_ID_EM_EXPLODES_BY_FIRE,
+  GADGET_ID_USE_SPRING_BUG,
+  GADGET_ID_USE_TIME_ORB_BUG,
+  GADGET_ID_USE_LIFE_BUGS,
+  GADGET_ID_RANDOM_BALL_CONTENT,
+  GADGET_ID_INITIAL_BALL_STATE,
+  GADGET_ID_GROW_INTO_DIGGABLE,
+  GADGET_ID_AUTO_EXIT_SOKOBAN,
+  GADGET_ID_SOLVED_BY_ONE_PLAYER,
+  GADGET_ID_CONTINUOUS_SNAPPING,
+  GADGET_ID_BLOCK_SNAP_FIELD,
+  GADGET_ID_BLOCK_LAST_FIELD,
+  GADGET_ID_SP_BLOCK_LAST_FIELD,
+  GADGET_ID_INSTANT_RELOCATION,
+  GADGET_ID_SHIFTED_RELOCATION,
+  GADGET_ID_LAZY_RELOCATION,
+  GADGET_ID_USE_START_ELEMENT,
+  GADGET_ID_USE_ARTWORK_ELEMENT,
+  GADGET_ID_USE_EXPLOSION_ELEMENT,
+  GADGET_ID_INITIAL_GRAVITY,
+  GADGET_ID_USE_INITIAL_INVENTORY,
+  GADGET_ID_CAN_PASS_TO_WALKABLE,
+  GADGET_ID_CAN_FALL_INTO_ACID,
+  GADGET_ID_CAN_MOVE_INTO_ACID,
+  GADGET_ID_DONT_COLLIDE_WITH,
+  GADGET_ID_ENVELOPE_AUTOWRAP,
+  GADGET_ID_ENVELOPE_CENTERED,
+  GADGET_ID_MM_LASER_RED,
+  GADGET_ID_MM_LASER_GREEN,
+  GADGET_ID_MM_LASER_BLUE,
+  GADGET_ID_DF_LASER_RED,
+  GADGET_ID_DF_LASER_GREEN,
+  GADGET_ID_DF_LASER_BLUE,
+  GADGET_ID_CUSTOM_INDESTRUCTIBLE,
+  GADGET_ID_CUSTOM_CAN_EXPLODE,
+  GADGET_ID_CUSTOM_EXPLODE_FIRE,
+  GADGET_ID_CUSTOM_EXPLODE_SMASH,
+  GADGET_ID_CUSTOM_EXPLODE_IMPACT,
+  GADGET_ID_CUSTOM_WALK_TO_OBJECT,
+  GADGET_ID_CUSTOM_DEADLY,
+  GADGET_ID_CUSTOM_CAN_MOVE,
+  GADGET_ID_CUSTOM_CAN_FALL,
+  GADGET_ID_CUSTOM_CAN_SMASH,
+  GADGET_ID_CUSTOM_SLIPPERY,
+  GADGET_ID_CUSTOM_ACCESSIBLE,
+  GADGET_ID_CUSTOM_GRAV_REACHABLE,
+  GADGET_ID_CUSTOM_USE_LAST_VALUE,
+  GADGET_ID_CUSTOM_USE_GRAPHIC,
+  GADGET_ID_CUSTOM_USE_TEMPLATE_1,
+  GADGET_ID_CUSTOM_USE_TEMPLATE_2,
+  GADGET_ID_CUSTOM_USE_TEMPLATE_3,
+  GADGET_ID_CUSTOM_CAN_CHANGE,
+  GADGET_ID_CHANGE_USE_CONTENT,
+  GADGET_ID_CHANGE_USE_EXPLOSION,
+  GADGET_ID_CHANGE_ONLY_COMPLETE,
+  GADGET_ID_CHANGE_USE_RANDOM,
+  GADGET_ID_CHANGE_HAS_ACTION,
+  GADGET_ID_CHANGE_DELAY,
+  GADGET_ID_CHANGE_BY_DIRECT_ACT,
+  GADGET_ID_CHANGE_BY_OTHER_ACT,
+
+  NUM_STATIC_GADGET_IDS
+};
+
+/* gadgets for buttons in element list (dynamic) */
+#define GADGET_ID_ELEMENTLIST_FIRST    (NUM_STATIC_GADGET_IDS)
 #define GADGET_ID_ELEMENTLIST_LAST     (GADGET_ID_ELEMENTLIST_FIRST +  \
                                        ED_NUM_ELEMENTLIST_BUTTONS - 1)
 
 #define NUM_EDITOR_GADGETS             (GADGET_ID_ELEMENTLIST_LAST + 1)
 
 /* radio button numbers */
-#define RADIO_NR_NONE                  0
-#define RADIO_NR_DRAWING_TOOLBOX       1
-#define RADIO_NR_RANDOM_ELEMENTS       2
+enum
+{
+  RADIO_NR_NONE,
+  RADIO_NR_DRAWING_TOOLBOX,
+  RADIO_NR_RANDOM_ELEMENTS
+};
 
 /* values for counter gadgets */
-#define ED_COUNTER_ID_SELECT_LEVEL     0
-#define ED_COUNTER_ID_LEVEL_XSIZE      1
-#define ED_COUNTER_ID_LEVEL_YSIZE      2
-#define ED_COUNTER_ID_LEVEL_GEMSLIMIT  3
-#define ED_COUNTER_ID_LEVEL_TIMELIMIT  4
-#define ED_COUNTER_ID_LEVEL_TIMESCORE  5
-#define ED_COUNTER_ID_LEVEL_RANDOM_SEED        6
-#define ED_COUNTER_ID_LEVELSET_NUM_LEVELS 7
-#define ED_COUNTER_ID_LEVEL_RANDOM     8
-#define ED_COUNTER_ID_ELEMENT_VALUE1   9
-#define ED_COUNTER_ID_ELEMENT_VALUE2   10
-#define ED_COUNTER_ID_ELEMENT_VALUE3   11
-#define ED_COUNTER_ID_ELEMENT_VALUE4   12
-#define ED_COUNTER_ID_YAMYAM_CONTENT   13
-#define ED_COUNTER_ID_BALL_CONTENT     14
-#define ED_COUNTER_ID_ANDROID_CONTENT  15
-#define ED_COUNTER_ID_ENVELOPE_XSIZE   16
-#define ED_COUNTER_ID_ENVELOPE_YSIZE   17
-#define ED_COUNTER_ID_INVENTORY_SIZE   18
-#define ED_COUNTER_ID_CUSTOM_SCORE     19
-#define ED_COUNTER_ID_CUSTOM_GEMCOUNT  20
-#define ED_COUNTER_ID_CUSTOM_VALUE_FIX 21
-#define ED_COUNTER_ID_CUSTOM_VALUE_RND 22
-#define ED_COUNTER_ID_PUSH_DELAY_FIX   23
-#define ED_COUNTER_ID_PUSH_DELAY_RND   24
-#define ED_COUNTER_ID_DROP_DELAY_FIX   25
-#define ED_COUNTER_ID_DROP_DELAY_RND   26
-#define ED_COUNTER_ID_MOVE_DELAY_FIX   27
-#define ED_COUNTER_ID_MOVE_DELAY_RND   28
-#define ED_COUNTER_ID_EXPLOSION_DELAY  29
-#define ED_COUNTER_ID_IGNITION_DELAY   30
-#define ED_COUNTER_ID_GROUP_CONTENT    31
-#define ED_COUNTER_ID_CHANGE_DELAY_FIX 32
-#define ED_COUNTER_ID_CHANGE_DELAY_RND 33
-#define ED_COUNTER_ID_CHANGE_CONT_RND  34
-
-#define ED_NUM_COUNTERBUTTONS          35
+enum
+{
+  ED_COUNTER_ID_SELECT_LEVEL,
+  ED_COUNTER_ID_LEVEL_XSIZE,
+  ED_COUNTER_ID_LEVEL_YSIZE,
+  ED_COUNTER_ID_LEVEL_GEMSLIMIT,
+  ED_COUNTER_ID_LEVEL_TIMELIMIT,
+  ED_COUNTER_ID_LEVEL_TIMESCORE,
+  ED_COUNTER_ID_LEVEL_RANDOM_SEED,
+  ED_COUNTER_ID_LEVELSET_NUM_LEVELS,
+  ED_COUNTER_ID_LEVEL_RANDOM,
+  ED_COUNTER_ID_ELEMENT_VALUE1,
+  ED_COUNTER_ID_ELEMENT_VALUE2,
+  ED_COUNTER_ID_ELEMENT_VALUE3,
+  ED_COUNTER_ID_ELEMENT_VALUE4,
+  ED_COUNTER_ID_YAMYAM_CONTENT,
+  ED_COUNTER_ID_BALL_CONTENT,
+  ED_COUNTER_ID_ANDROID_CONTENT,
+  ED_COUNTER_ID_ENVELOPE_XSIZE,
+  ED_COUNTER_ID_ENVELOPE_YSIZE,
+  ED_COUNTER_ID_INVENTORY_SIZE,
+  ED_COUNTER_ID_CUSTOM_SCORE,
+  ED_COUNTER_ID_CUSTOM_GEMCOUNT,
+  ED_COUNTER_ID_CUSTOM_VALUE_FIX,
+  ED_COUNTER_ID_CUSTOM_VALUE_RND,
+  ED_COUNTER_ID_PUSH_DELAY_FIX,
+  ED_COUNTER_ID_PUSH_DELAY_RND,
+  ED_COUNTER_ID_DROP_DELAY_FIX,
+  ED_COUNTER_ID_DROP_DELAY_RND,
+  ED_COUNTER_ID_MOVE_DELAY_FIX,
+  ED_COUNTER_ID_MOVE_DELAY_RND,
+  ED_COUNTER_ID_EXPLOSION_DELAY,
+  ED_COUNTER_ID_IGNITION_DELAY,
+  ED_COUNTER_ID_GROUP_CONTENT,
+  ED_COUNTER_ID_CHANGE_DELAY_FIX,
+  ED_COUNTER_ID_CHANGE_DELAY_RND,
+  ED_COUNTER_ID_CHANGE_CONT_RND,
+
+  ED_NUM_COUNTERBUTTONS
+};
 
 #define ED_COUNTER_ID_LEVEL_FIRST      ED_COUNTER_ID_LEVEL_XSIZE
 #define ED_COUNTER_ID_LEVEL_LAST       ED_COUNTER_ID_LEVEL_RANDOM_SEED
 #define ED_COUNTER_ID_CHANGE_LAST      ED_COUNTER_ID_CHANGE_CONT_RND
 
 /* values for scrollbutton gadgets */
-#define ED_SCROLLBUTTON_ID_AREA_UP     0
-#define ED_SCROLLBUTTON_ID_AREA_DOWN   1
-#define ED_SCROLLBUTTON_ID_AREA_LEFT   2
-#define ED_SCROLLBUTTON_ID_AREA_RIGHT  3
-#define ED_SCROLLBUTTON_ID_LIST_UP     4
-#define ED_SCROLLBUTTON_ID_LIST_DOWN   5
+enum
+{
+  ED_SCROLLBUTTON_ID_AREA_UP,
+  ED_SCROLLBUTTON_ID_AREA_DOWN,
+  ED_SCROLLBUTTON_ID_AREA_LEFT,
+  ED_SCROLLBUTTON_ID_AREA_RIGHT,
+  ED_SCROLLBUTTON_ID_LIST_UP,
+  ED_SCROLLBUTTON_ID_LIST_DOWN,
 
-#define ED_NUM_SCROLLBUTTONS           6
+  ED_NUM_SCROLLBUTTONS
+};
 
 #define ED_SCROLLBUTTON_ID_AREA_FIRST  ED_SCROLLBUTTON_ID_AREA_UP
 #define ED_SCROLLBUTTON_ID_AREA_LAST   ED_SCROLLBUTTON_ID_AREA_RIGHT
 
 /* values for scrollbar gadgets */
-#define ED_SCROLLBAR_ID_AREA_HORIZONTAL        0
-#define ED_SCROLLBAR_ID_AREA_VERTICAL  1
-#define ED_SCROLLBAR_ID_LIST_VERTICAL  2
+enum
+{
+  ED_SCROLLBAR_ID_AREA_HORIZONTAL,
+  ED_SCROLLBAR_ID_AREA_VERTICAL,
+  ED_SCROLLBAR_ID_LIST_VERTICAL,
 
-#define ED_NUM_SCROLLBARS              3
+  ED_NUM_SCROLLBARS
+};
 
 #define ED_SCROLLBAR_ID_AREA_FIRST     ED_SCROLLBAR_ID_AREA_HORIZONTAL
 #define ED_SCROLLBAR_ID_AREA_LAST      ED_SCROLLBAR_ID_AREA_VERTICAL
 
 /* values for text input gadgets */
-#define ED_TEXTINPUT_ID_LEVEL_NAME     0
-#define ED_TEXTINPUT_ID_LEVEL_AUTHOR   1
-#define ED_TEXTINPUT_ID_LEVELSET_NAME  2
-#define ED_TEXTINPUT_ID_LEVELSET_AUTHOR        3
-#define ED_TEXTINPUT_ID_ELEMENT_NAME   4
+enum
+{
+  ED_TEXTINPUT_ID_LEVEL_NAME,
+  ED_TEXTINPUT_ID_LEVEL_AUTHOR,
+  ED_TEXTINPUT_ID_LEVELSET_NAME,
+  ED_TEXTINPUT_ID_LEVELSET_AUTHOR,
+  ED_TEXTINPUT_ID_ELEMENT_NAME,
 
-#define ED_NUM_TEXTINPUT               5
+  ED_NUM_TEXTINPUT
+};
 
 #define ED_TEXTINPUT_ID_LEVEL_FIRST    ED_TEXTINPUT_ID_LEVEL_NAME
 #define ED_TEXTINPUT_ID_LEVEL_LAST     ED_TEXTINPUT_ID_LEVEL_AUTHOR
 #define ED_TEXTINPUT_ID_LEVELSET_LAST  ED_TEXTINPUT_ID_LEVELSET_AUTHOR
 
 /* values for text area gadgets */
-#define ED_TEXTAREA_ID_ENVELOPE_INFO   0
+enum
+{
+  ED_TEXTAREA_ID_ENVELOPE_INFO,
 
-#define ED_NUM_TEXTAREAS                       1
+  ED_NUM_TEXTAREAS
+};
 
 #define ED_TEXTAREA_ID_LEVEL_FIRST     ED_TEXTAREA_ID_ENVELOPE
 #define ED_TEXTAREA_ID_LEVEL_LAST      ED_TEXTAREA_ID_ENVELOPE
 
 /* values for selectbox gadgets */
-#define ED_SELECTBOX_ID_TIME_OR_STEPS          0
-#define ED_SELECTBOX_ID_GAME_ENGINE_TYPE       1
-#define ED_SELECTBOX_ID_LEVELSET_SAVE_MODE     2
-#define ED_SELECTBOX_ID_WIND_DIRECTION         3
-#define ED_SELECTBOX_ID_PLAYER_SPEED           4
-#define ED_SELECTBOX_ID_CUSTOM_ACCESS_TYPE     5
-#define ED_SELECTBOX_ID_CUSTOM_ACCESS_LAYER    6
-#define ED_SELECTBOX_ID_CUSTOM_ACCESS_PROTECTED        7
-#define ED_SELECTBOX_ID_CUSTOM_ACCESS_DIRECTION        8
-#define ED_SELECTBOX_ID_CUSTOM_WALK_TO_ACTION  9
-#define ED_SELECTBOX_ID_CUSTOM_MOVE_PATTERN    10
-#define ED_SELECTBOX_ID_CUSTOM_MOVE_DIRECTION  11
-#define ED_SELECTBOX_ID_CUSTOM_MOVE_STEPSIZE   12
-#define ED_SELECTBOX_ID_CUSTOM_MOVE_LEAVE_TYPE 13
-#define ED_SELECTBOX_ID_CUSTOM_SMASH_TARGETS   14
-#define ED_SELECTBOX_ID_CUSTOM_SLIPPERY_TYPE   15
-#define ED_SELECTBOX_ID_CUSTOM_DEADLINESS      16
-#define ED_SELECTBOX_ID_CUSTOM_EXPLOSION_TYPE  17
-#define ED_SELECTBOX_ID_CHANGE_TIME_UNITS      18
-#define ED_SELECTBOX_ID_CHANGE_DIRECT_ACTION   19
-#define ED_SELECTBOX_ID_CHANGE_OTHER_ACTION    20
-#define ED_SELECTBOX_ID_CHANGE_SIDE            21
-#define ED_SELECTBOX_ID_CHANGE_PLAYER          22
-#define ED_SELECTBOX_ID_CHANGE_PAGE            23
-#define ED_SELECTBOX_ID_CHANGE_REPLACE_WHEN    24
-#define ED_SELECTBOX_ID_ACTION_TYPE            25
-#define ED_SELECTBOX_ID_ACTION_MODE            26
-#define ED_SELECTBOX_ID_ACTION_ARG             27
-#define ED_SELECTBOX_ID_SELECT_CHANGE_PAGE     28
-#define ED_SELECTBOX_ID_GROUP_CHOICE_MODE      29
-
-#define ED_NUM_SELECTBOX                       30
+enum
+{
+  ED_SELECTBOX_ID_TIME_OR_STEPS,
+  ED_SELECTBOX_ID_GAME_ENGINE_TYPE,
+  ED_SELECTBOX_ID_LEVELSET_SAVE_MODE,
+  ED_SELECTBOX_ID_WIND_DIRECTION,
+  ED_SELECTBOX_ID_PLAYER_SPEED,
+  ED_SELECTBOX_ID_CUSTOM_ACCESS_TYPE,
+  ED_SELECTBOX_ID_CUSTOM_ACCESS_LAYER,
+  ED_SELECTBOX_ID_CUSTOM_ACCESS_PROTECTED,
+  ED_SELECTBOX_ID_CUSTOM_ACCESS_DIRECTION,
+  ED_SELECTBOX_ID_CUSTOM_WALK_TO_ACTION,
+  ED_SELECTBOX_ID_CUSTOM_MOVE_PATTERN,
+  ED_SELECTBOX_ID_CUSTOM_MOVE_DIRECTION,
+  ED_SELECTBOX_ID_CUSTOM_MOVE_STEPSIZE,
+  ED_SELECTBOX_ID_CUSTOM_MOVE_LEAVE_TYPE,
+  ED_SELECTBOX_ID_CUSTOM_SMASH_TARGETS,
+  ED_SELECTBOX_ID_CUSTOM_SLIPPERY_TYPE,
+  ED_SELECTBOX_ID_CUSTOM_DEADLINESS,
+  ED_SELECTBOX_ID_CUSTOM_EXPLOSION_TYPE,
+  ED_SELECTBOX_ID_CHANGE_TIME_UNITS,
+  ED_SELECTBOX_ID_CHANGE_DIRECT_ACTION,
+  ED_SELECTBOX_ID_CHANGE_OTHER_ACTION,
+  ED_SELECTBOX_ID_CHANGE_SIDE,
+  ED_SELECTBOX_ID_CHANGE_PLAYER,
+  ED_SELECTBOX_ID_CHANGE_PAGE,
+  ED_SELECTBOX_ID_CHANGE_REPLACE_WHEN,
+  ED_SELECTBOX_ID_ACTION_TYPE,
+  ED_SELECTBOX_ID_ACTION_MODE,
+  ED_SELECTBOX_ID_ACTION_ARG,
+  ED_SELECTBOX_ID_SELECT_CHANGE_PAGE,
+  ED_SELECTBOX_ID_GROUP_CHOICE_MODE,
+
+  ED_NUM_SELECTBOX
+};
 
 #define ED_SELECTBOX_ID_LEVEL_FIRST    ED_SELECTBOX_ID_TIME_OR_STEPS
 #define ED_SELECTBOX_ID_LEVEL_LAST     ED_SELECTBOX_ID_GAME_ENGINE_TYPE
 #define ED_SELECTBOX_ID_CHANGE_LAST    ED_SELECTBOX_ID_SELECT_CHANGE_PAGE
 
 /* values for textbutton gadgets */
-#define ED_TEXTBUTTON_ID_LEVELINFO_LEVEL       0
-#define ED_TEXTBUTTON_ID_LEVELINFO_LEVELSET    1
-#define ED_TEXTBUTTON_ID_LEVELINFO_EDITOR      2
-#define ED_TEXTBUTTON_ID_PROPERTIES_INFO       3
-#define ED_TEXTBUTTON_ID_PROPERTIES_CONFIG     4
-#define ED_TEXTBUTTON_ID_PROPERTIES_CONFIG_1   5
-#define ED_TEXTBUTTON_ID_PROPERTIES_CONFIG_2   6
-#define ED_TEXTBUTTON_ID_PROPERTIES_CHANGE     7
-#define ED_TEXTBUTTON_ID_SAVE_LEVELSET         8
-#define ED_TEXTBUTTON_ID_SAVE_AS_TEMPLATE_2    9
-#define ED_TEXTBUTTON_ID_SAVE_AS_TEMPLATE_1    10
-#define ED_TEXTBUTTON_ID_ADD_CHANGE_PAGE       11
-#define ED_TEXTBUTTON_ID_DEL_CHANGE_PAGE       12
-
-#define ED_NUM_TEXTBUTTONS                     13
+enum
+{
+  ED_TEXTBUTTON_ID_LEVELINFO_LEVEL,
+  ED_TEXTBUTTON_ID_LEVELINFO_LEVELSET,
+  ED_TEXTBUTTON_ID_LEVELINFO_EDITOR,
+  ED_TEXTBUTTON_ID_PROPERTIES_INFO,
+  ED_TEXTBUTTON_ID_PROPERTIES_CONFIG,
+  ED_TEXTBUTTON_ID_PROPERTIES_CONFIG_1,
+  ED_TEXTBUTTON_ID_PROPERTIES_CONFIG_2,
+  ED_TEXTBUTTON_ID_PROPERTIES_CHANGE,
+  ED_TEXTBUTTON_ID_SAVE_LEVELSET,
+  ED_TEXTBUTTON_ID_SAVE_AS_TEMPLATE_2,
+  ED_TEXTBUTTON_ID_SAVE_AS_TEMPLATE_1,
+  ED_TEXTBUTTON_ID_ADD_CHANGE_PAGE,
+  ED_TEXTBUTTON_ID_DEL_CHANGE_PAGE,
+
+  ED_NUM_TEXTBUTTONS
+};
 
 #define ED_TAB_BUTTON_ID_LEVELINFO_FIRST ED_TEXTBUTTON_ID_LEVELINFO_LEVEL
 #define ED_TAB_BUTTON_ID_LEVELINFO_LAST  ED_TEXTBUTTON_ID_LEVELINFO_EDITOR
 #define ED_TEXTBUTTON_ID_CHANGE_LAST   ED_TEXTBUTTON_ID_DEL_CHANGE_PAGE
 
 /* values for graphicbutton gadgets */
-#define ED_GRAPHICBUTTON_ID_PREV_CHANGE_PAGE   0
-#define ED_GRAPHICBUTTON_ID_NEXT_CHANGE_PAGE   1
-#define ED_GRAPHICBUTTON_ID_COPY_CHANGE_PAGE   2
-#define ED_GRAPHICBUTTON_ID_PASTE_CHANGE_PAGE  3
+enum
+{
+  ED_GRAPHICBUTTON_ID_PREV_CHANGE_PAGE,
+  ED_GRAPHICBUTTON_ID_NEXT_CHANGE_PAGE,
+  ED_GRAPHICBUTTON_ID_COPY_CHANGE_PAGE,
+  ED_GRAPHICBUTTON_ID_PASTE_CHANGE_PAGE,
 
-#define ED_NUM_GRAPHICBUTTONS                  4
+  ED_NUM_GRAPHICBUTTONS
+};
 
 #define ED_GRAPHICBUTTON_ID_CHANGE_FIRST  ED_GRAPHICBUTTON_ID_PREV_CHANGE_PAGE
 #define ED_GRAPHICBUTTON_ID_CHANGE_LAST   ED_GRAPHICBUTTON_ID_PASTE_CHANGE_PAGE
 
 /* values for checkbutton gadgets */
-#define ED_CHECKBUTTON_ID_AUTO_COUNT_GEMS      0
-#define ED_CHECKBUTTON_ID_USE_LEVELSET_ARTWORK 1
-#define ED_CHECKBUTTON_ID_COPY_LEVEL_TEMPLATE  2
-#define ED_CHECKBUTTON_ID_RANDOM_RESTRICTED    3
-#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_3        4
-#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_2        5
-#define ED_CHECKBUTTON_ID_STICK_ELEMENT                6
-#define ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS     7
-#define ED_CHECKBUTTON_ID_EM_EXPLODES_BY_FIRE  8
-#define ED_CHECKBUTTON_ID_USE_SPRING_BUG       9
-#define ED_CHECKBUTTON_ID_USE_TIME_ORB_BUG     10
-#define ED_CHECKBUTTON_ID_USE_LIFE_BUGS                11
-#define ED_CHECKBUTTON_ID_RANDOM_BALL_CONTENT  12
-#define ED_CHECKBUTTON_ID_INITIAL_BALL_STATE   13
-#define ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE   14
-#define ED_CHECKBUTTON_ID_AUTO_EXIT_SOKOBAN    15
-#define ED_CHECKBUTTON_ID_SOLVED_BY_ONE_PLAYER 16
-#define ED_CHECKBUTTON_ID_CONTINUOUS_SNAPPING  17
-#define ED_CHECKBUTTON_ID_BLOCK_SNAP_FIELD     18
-#define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD     19
-#define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD  20
-#define ED_CHECKBUTTON_ID_INSTANT_RELOCATION   21
-#define ED_CHECKBUTTON_ID_SHIFTED_RELOCATION   22
-#define ED_CHECKBUTTON_ID_LAZY_RELOCATION      23
-#define ED_CHECKBUTTON_ID_USE_START_ELEMENT    24
-#define ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT  25
-#define ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT        26
-#define ED_CHECKBUTTON_ID_INITIAL_GRAVITY      27
-#define ED_CHECKBUTTON_ID_USE_INITIAL_INVENTORY        28
-#define ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE 29
-#define ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID   30
-#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID   31
-#define ED_CHECKBUTTON_ID_DONT_COLLIDE_WITH    32
-#define ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP    33
-#define ED_CHECKBUTTON_ID_ENVELOPE_CENTERED    34
-#define ED_CHECKBUTTON_ID_MM_LASER_RED         35
-#define ED_CHECKBUTTON_ID_MM_LASER_GREEN       36
-#define ED_CHECKBUTTON_ID_MM_LASER_BLUE                37
-#define ED_CHECKBUTTON_ID_DF_LASER_RED         38
-#define ED_CHECKBUTTON_ID_DF_LASER_GREEN       39
-#define ED_CHECKBUTTON_ID_DF_LASER_BLUE                40
-#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC   41
-#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_1        42
-#define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE    43
-#define ED_CHECKBUTTON_ID_CUSTOM_GRAV_REACHABLE        44
-#define ED_CHECKBUTTON_ID_CUSTOM_USE_LAST_VALUE        45
-#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT        46
-#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE        47
-#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE      48
-#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL      49
-#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH     50
-#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY      51
-#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY                52
-#define ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE   53
-#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE  54
-#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 55
-#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT        56
-#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE    57
-#define ED_CHECKBUTTON_ID_CHANGE_DELAY         58
-#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 59
-#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT  60
-#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 61
-#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT   62
-#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 63
-#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM    64
-#define ED_CHECKBUTTON_ID_CHANGE_HAS_ACTION    65
-
-#define ED_NUM_CHECKBUTTONS                    66
+enum
+{
+  ED_CHECKBUTTON_ID_AUTO_COUNT_GEMS,
+  ED_CHECKBUTTON_ID_USE_LEVELSET_ARTWORK,
+  ED_CHECKBUTTON_ID_COPY_LEVEL_TEMPLATE,
+  ED_CHECKBUTTON_ID_RANDOM_RESTRICTED,
+  ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_3,
+  ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_2,
+  ED_CHECKBUTTON_ID_STICK_ELEMENT,
+  ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS,
+  ED_CHECKBUTTON_ID_EM_EXPLODES_BY_FIRE,
+  ED_CHECKBUTTON_ID_USE_SPRING_BUG,
+  ED_CHECKBUTTON_ID_USE_TIME_ORB_BUG,
+  ED_CHECKBUTTON_ID_USE_LIFE_BUGS,
+  ED_CHECKBUTTON_ID_RANDOM_BALL_CONTENT,
+  ED_CHECKBUTTON_ID_INITIAL_BALL_STATE,
+  ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE,
+  ED_CHECKBUTTON_ID_AUTO_EXIT_SOKOBAN,
+  ED_CHECKBUTTON_ID_SOLVED_BY_ONE_PLAYER,
+  ED_CHECKBUTTON_ID_CONTINUOUS_SNAPPING,
+  ED_CHECKBUTTON_ID_BLOCK_SNAP_FIELD,
+  ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD,
+  ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD,
+  ED_CHECKBUTTON_ID_INSTANT_RELOCATION,
+  ED_CHECKBUTTON_ID_SHIFTED_RELOCATION,
+  ED_CHECKBUTTON_ID_LAZY_RELOCATION,
+  ED_CHECKBUTTON_ID_USE_START_ELEMENT,
+  ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT,
+  ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT,
+  ED_CHECKBUTTON_ID_INITIAL_GRAVITY,
+  ED_CHECKBUTTON_ID_USE_INITIAL_INVENTORY,
+  ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE,
+  ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID,
+  ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID,
+  ED_CHECKBUTTON_ID_DONT_COLLIDE_WITH,
+  ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP,
+  ED_CHECKBUTTON_ID_ENVELOPE_CENTERED,
+  ED_CHECKBUTTON_ID_MM_LASER_RED,
+  ED_CHECKBUTTON_ID_MM_LASER_GREEN,
+  ED_CHECKBUTTON_ID_MM_LASER_BLUE,
+  ED_CHECKBUTTON_ID_DF_LASER_RED,
+  ED_CHECKBUTTON_ID_DF_LASER_GREEN,
+  ED_CHECKBUTTON_ID_DF_LASER_BLUE,
+  ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC,
+  ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_1,
+  ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE,
+  ED_CHECKBUTTON_ID_CUSTOM_GRAV_REACHABLE,
+  ED_CHECKBUTTON_ID_CUSTOM_USE_LAST_VALUE,
+  ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT,
+  ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE,
+  ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE,
+  ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL,
+  ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH,
+  ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY,
+  ED_CHECKBUTTON_ID_CUSTOM_DEADLY,
+  ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE,
+  ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE,
+  ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH,
+  ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT,
+  ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE,
+  ED_CHECKBUTTON_ID_CHANGE_DELAY,
+  ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT,
+  ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT,
+  ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION,
+  ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT,
+  ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE,
+  ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM,
+  ED_CHECKBUTTON_ID_CHANGE_HAS_ACTION,
+
+  ED_NUM_CHECKBUTTONS
+};
 
 #define ED_CHECKBUTTON_ID_LEVEL_FIRST  ED_CHECKBUTTON_ID_AUTO_COUNT_GEMS
 #define ED_CHECKBUTTON_ID_LEVEL_LAST   ED_CHECKBUTTON_ID_AUTO_COUNT_GEMS
 #define ED_CHECKBUTTON_ID_CHANGE_LAST  ED_CHECKBUTTON_ID_CHANGE_HAS_ACTION
 
 /* values for radiobutton gadgets */
-#define ED_RADIOBUTTON_ID_PERCENTAGE   0
-#define ED_RADIOBUTTON_ID_QUANTITY     1
+enum
+{
+  ED_RADIOBUTTON_ID_PERCENTAGE,
+  ED_RADIOBUTTON_ID_QUANTITY,
 
-#define ED_NUM_RADIOBUTTONS            2
+  ED_NUM_RADIOBUTTONS
+};
 
 #define ED_RADIOBUTTON_ID_EDITOR_FIRST ED_RADIOBUTTON_ID_PERCENTAGE
 #define ED_RADIOBUTTON_ID_EDITOR_LAST  ED_RADIOBUTTON_ID_QUANTITY
 
 /* values for drawing area gadgets */
-#define ED_DRAWING_ID_DRAWING_LEVEL            0
-#define ED_DRAWING_ID_YAMYAM_CONTENT_0         1
-#define ED_DRAWING_ID_YAMYAM_CONTENT_1         2
-#define ED_DRAWING_ID_YAMYAM_CONTENT_2         3
-#define ED_DRAWING_ID_YAMYAM_CONTENT_3         4
-#define ED_DRAWING_ID_YAMYAM_CONTENT_4         5
-#define ED_DRAWING_ID_YAMYAM_CONTENT_5         6
-#define ED_DRAWING_ID_YAMYAM_CONTENT_6         7
-#define ED_DRAWING_ID_YAMYAM_CONTENT_7         8
-#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_0     9
-#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_1     10
-#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_2     11
-#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_3     12
-#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_4     13
-#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_5     14
-#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_6     15
-#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_7     16
-#define ED_DRAWING_ID_ANDROID_CONTENT          17
-#define ED_DRAWING_ID_AMOEBA_CONTENT           18
-#define ED_DRAWING_ID_START_ELEMENT            19
-#define ED_DRAWING_ID_ARTWORK_ELEMENT          20
-#define ED_DRAWING_ID_EXPLOSION_ELEMENT                21
-#define ED_DRAWING_ID_INVENTORY_CONTENT                22
-#define ED_DRAWING_ID_CUSTOM_GRAPHIC           23
-#define ED_DRAWING_ID_CUSTOM_CONTENT           24
-#define ED_DRAWING_ID_CUSTOM_MOVE_ENTER                25
-#define ED_DRAWING_ID_CUSTOM_MOVE_LEAVE                26
-#define ED_DRAWING_ID_CUSTOM_CHANGE_TARGET     27
-#define ED_DRAWING_ID_CUSTOM_CHANGE_CONTENT    28
-#define ED_DRAWING_ID_CUSTOM_CHANGE_TRIGGER    29
-#define ED_DRAWING_ID_CUSTOM_CHANGE_ACTION     30
-#define ED_DRAWING_ID_GROUP_CONTENT            31
-#define ED_DRAWING_ID_RANDOM_BACKGROUND                32
-
-#define ED_NUM_DRAWING_AREAS                   33
+enum
+{
+  ED_DRAWING_ID_DRAWING_LEVEL,
+  ED_DRAWING_ID_YAMYAM_CONTENT_0,
+  ED_DRAWING_ID_YAMYAM_CONTENT_1,
+  ED_DRAWING_ID_YAMYAM_CONTENT_2,
+  ED_DRAWING_ID_YAMYAM_CONTENT_3,
+  ED_DRAWING_ID_YAMYAM_CONTENT_4,
+  ED_DRAWING_ID_YAMYAM_CONTENT_5,
+  ED_DRAWING_ID_YAMYAM_CONTENT_6,
+  ED_DRAWING_ID_YAMYAM_CONTENT_7,
+  ED_DRAWING_ID_MAGIC_BALL_CONTENT_0,
+  ED_DRAWING_ID_MAGIC_BALL_CONTENT_1,
+  ED_DRAWING_ID_MAGIC_BALL_CONTENT_2,
+  ED_DRAWING_ID_MAGIC_BALL_CONTENT_3,
+  ED_DRAWING_ID_MAGIC_BALL_CONTENT_4,
+  ED_DRAWING_ID_MAGIC_BALL_CONTENT_5,
+  ED_DRAWING_ID_MAGIC_BALL_CONTENT_6,
+  ED_DRAWING_ID_MAGIC_BALL_CONTENT_7,
+  ED_DRAWING_ID_ANDROID_CONTENT,
+  ED_DRAWING_ID_AMOEBA_CONTENT,
+  ED_DRAWING_ID_START_ELEMENT,
+  ED_DRAWING_ID_ARTWORK_ELEMENT,
+  ED_DRAWING_ID_EXPLOSION_ELEMENT,
+  ED_DRAWING_ID_INVENTORY_CONTENT,
+  ED_DRAWING_ID_CUSTOM_GRAPHIC,
+  ED_DRAWING_ID_CUSTOM_CONTENT,
+  ED_DRAWING_ID_CUSTOM_MOVE_ENTER,
+  ED_DRAWING_ID_CUSTOM_MOVE_LEAVE,
+  ED_DRAWING_ID_CUSTOM_CHANGE_TARGET,
+  ED_DRAWING_ID_CUSTOM_CHANGE_CONTENT,
+  ED_DRAWING_ID_CUSTOM_CHANGE_TRIGGER,
+  ED_DRAWING_ID_CUSTOM_CHANGE_ACTION,
+  ED_DRAWING_ID_GROUP_CONTENT,
+  ED_DRAWING_ID_RANDOM_BACKGROUND,
+
+  ED_NUM_DRAWING_AREAS
+};
 
 #define ED_DRAWING_ID_EDITOR_FIRST     ED_DRAWING_ID_RANDOM_BACKGROUND
 #define ED_DRAWING_ID_EDITOR_LAST      ED_DRAWING_ID_RANDOM_BACKGROUND