[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33694] trunk/blender/source/blender: Bugfix, own collection

Ton Roosendaal ton at blender.org
Wed Dec 15 19:09:25 CET 2010


Revision: 33694
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33694
Author:   ton
Date:     2010-12-15 19:09:25 +0100 (Wed, 15 Dec 2010)

Log Message:
-----------
Bugfix, own collection

Using RMB on menus to change hotkeys was broken.
- the input button was on a weird place outside menu, assign
  would close pulldown, so you had to reopen to check
- ESC didn't close the button, but assigned ESC as hotkey.
  This key is a protected key, and always should be escaping.
- Worst bug: if you used this on a 'user keymap' it removed
  all entries from the map... 

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_handlers.c
    trunk/blender/source/blender/windowmanager/intern/wm_keymap.c
    trunk/blender/source/blender/windowmanager/wm_event_types.h

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c	2010-12-15 17:36:08 UTC (rev 33693)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c	2010-12-15 18:09:25 UTC (rev 33694)
@@ -2081,6 +2081,12 @@
 				button_activate_state(C, but, BUTTON_STATE_EXIT);
 				return WM_UI_HANDLER_BREAK;
 			}
+			else if(event->type == ESCKEY) {
+				data->cancel= 1;
+				data->escapecancel= 1;
+				button_activate_state(C, but, BUTTON_STATE_EXIT);
+			}
+			
 		}
 	}
 	
@@ -4011,14 +4017,14 @@
 	
 	block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
 	uiBlockSetHandleFunc(block, but_shortcut_name_func, but);
-	uiBlockSetFlag(block, UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT);
+	uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT);
 	uiBlockSetDirection(block, UI_CENTER);
 	
 	layout= uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, style);
 	
 	uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT|UI_ITEM_R_IMMEDIATE, "", 0);
 	
-	uiPopupBoundsBlock(block, 6, 100, 10);
+	uiPopupBoundsBlock(block, 6, -50, 26);
 	uiEndBlock(C, block);
 	
 	return block;
@@ -4056,7 +4062,7 @@
 
 	uiItemR(layout, &ptr, "type", UI_ITEM_R_FULL_EVENT|UI_ITEM_R_IMMEDIATE, "", 0);
 	
-	uiPopupBoundsBlock(block, 6, 100, 10);
+	uiPopupBoundsBlock(block, 6, -50, 26);
 	uiEndBlock(C, block);
 	
 	return block;

Modified: trunk/blender/source/blender/windowmanager/intern/wm_keymap.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_keymap.c	2010-12-15 17:36:08 UTC (rev 33693)
+++ trunk/blender/source/blender/windowmanager/intern/wm_keymap.c	2010-12-15 18:09:25 UTC (rev 33694)
@@ -652,6 +652,10 @@
 
 	usermap= WM_keymap_list_find(&U.keymaps, keymap->idname, keymap->spaceid, keymap->regionid);
 
+	/* XXX this function is only used by RMB setting hotkeys, and it clears maps on 2nd try this way */
+	if(keymap==usermap)
+		return;
+	
 	if(!usermap) {
 		/* not saved yet, duplicate existing */
 		usermap= MEM_dupallocN(keymap);

Modified: trunk/blender/source/blender/windowmanager/wm_event_types.h
===================================================================
--- trunk/blender/source/blender/windowmanager/wm_event_types.h	2010-12-15 17:36:08 UTC (rev 33693)
+++ trunk/blender/source/blender/windowmanager/wm_event_types.h	2010-12-15 18:09:25 UTC (rev 33694)
@@ -227,7 +227,7 @@
 #define ISTWEAK(event)	(event >= EVT_TWEAK_L && event <= EVT_GESTURE)
 
 /* test whether event type is acceptable as hotkey, excluding modifiers */
-#define ISHOTKEY(event)	((ISKEYBOARD(event) || ISMOUSE(event)) && !(event>=LEFTCTRLKEY && event<=LEFTSHIFTKEY) && !(event>=UNKNOWNKEY && event<=GRLESSKEY))
+#define ISHOTKEY(event)	((ISKEYBOARD(event) || ISMOUSE(event)) && event!=ESCKEY && !(event>=LEFTCTRLKEY && event<=LEFTSHIFTKEY) && !(event>=UNKNOWNKEY && event<=GRLESSKEY))
 
 /* **************** BLENDER GESTURE EVENTS (0x5000) **************** */
 





More information about the Bf-blender-cvs mailing list