+ if (GTK_OBJECT_TYPE(menuitem) == GTK_TYPE_RADIO_MENU_ITEM) {
+ if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM (menuitem)))
+ return;
+ } else {
+ if (!gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON (menuitem)))
+ return;
+ }
+
+ if (ui.cur_mapping != 0 && !ui.button_switch_mapping) return; // not user-generated
+ if (ui.toolno[ui.cur_mapping] == TOOL_SELECTREGION) return;
+
+ ui.cur_mapping = 0; // don't use switch_mapping() (refreshes buttons too soon)
+ end_text();
+ ui.toolno[ui.cur_mapping] = TOOL_SELECTREGION;
+ update_mapping_linkings(-1);
+ update_tool_buttons();
+ update_tool_menu();
+ update_color_menu();
+ update_cursor();