[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23329] trunk/blender: Changed a few mutually exclusive options in preferences to radio buttons ( enums)

William Reynish william at reynish.com
Fri Sep 18 09:44:52 CEST 2009


Revision: 23329
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23329
Author:   billrey
Date:     2009-09-18 09:44:52 +0200 (Fri, 18 Sep 2009)

Log Message:
-----------
Changed a few mutually exclusive options in preferences to radio buttons (enums)

Modified Paths:
--------------
    trunk/blender/release/ui/space_userpref.py
    trunk/blender/source/blender/makesrna/intern/rna_userdef.c

Modified: trunk/blender/release/ui/space_userpref.py
===================================================================
--- trunk/blender/release/ui/space_userpref.py	2009-09-18 04:07:41 UTC (rev 23328)
+++ trunk/blender/release/ui/space_userpref.py	2009-09-18 07:44:52 UTC (rev 23329)
@@ -97,14 +97,18 @@
 		
 		sub1 = sub.column()
 		sub1.itemL(text="Mouse Buttons:")
-		sub1.itemR(view, "left_mouse_button_select")
-		sub1.itemR(view, "right_mouse_button_select")
-		sub1.itemR(view, "emulate_3_button_mouse")
+		
+		sub2 = sub1.column()
+		sub2.enabled = (view.select_mouse == 'RIGHT')
+		sub2.itemR(view, "emulate_3_button_mouse")
+		sub1.itemL(text="Select With:")
+		sub1.row().itemR(view, "select_mouse", expand=True)
+		sub1.itemL(text="Middle Mouse:")
+		sub1.row().itemR(view, "middle_mouse", expand=True)
 		sub1.itemR(view, "use_middle_mouse_paste")
-		sub1.itemR(view, "middle_mouse_rotate")
-		sub1.itemR(view, "middle_mouse_pan")
-		sub1.itemR(view, "wheel_invert_zoom")
-		sub1.itemR(view, "wheel_scroll_lines")
+		sub1.itemL(text="Mouse Wheel:")
+		sub1.itemR(view, "wheel_invert_zoom", text="Invert Zoom")
+		sub1.itemR(view, "wheel_scroll_lines", text="Scroll Lines")
 		sub1.itemS()
 		sub1.itemS()
 		sub1.itemS()

Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2009-09-18 04:07:41 UTC (rev 23328)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c	2009-09-18 07:44:52 UTC (rev 23329)
@@ -1563,6 +1563,16 @@
 		{USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zooms in and out based on vertical mouse movement."},
 		{USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zooms in and out like scaling the view, mouse movements relative to center."},
 		{0, NULL, 0, NULL, NULL}};
+	
+	static EnumPropertyItem select_mouse_items[] = {
+		{USER_LMOUSESELECT, "LEFT", 0, "Left", "Use left Mouse Button for selection."},
+		{0, "RIGHT", 0, "Right", "Use Right Mouse Button for selection."},
+		{0, NULL, 0, NULL, NULL}};
+		
+	static EnumPropertyItem middle_mouse_mouse_items[] = {
+		{0, "PAN", 0, "Pan", "Use the middle mouse button for panning the viewport."},
+		{USER_VIEWMOVE, "ROTATE", 0, "Rotate", "Use the middle mouse button for rotation the viewport."},
+		{0, NULL, 0, NULL, NULL}};
 
 	static EnumPropertyItem view_rotation_items[] = {
 		{0, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport."},
@@ -1678,15 +1688,11 @@
 	RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the orbiting center.");
 
 	/* select with */
-	prop= RNA_def_property(srna, "left_mouse_button_select", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_LMOUSESELECT);
-	RNA_def_property_boolean_funcs(prop, NULL, "rna_userdef_lmb_select_set");
-	RNA_def_property_ui_text(prop, "Left Mouse Button Select", "Use left Mouse Button for selection.");
 	
-	prop= RNA_def_property(srna, "right_mouse_button_select", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_LMOUSESELECT);
-	RNA_def_property_boolean_funcs(prop, NULL, "rna_userdef_rmb_select_set");
-	RNA_def_property_ui_text(prop, "Right Mouse Button Select", "Use Right Mouse Button for selection.");
+	prop= RNA_def_property(srna, "select_mouse", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+	RNA_def_property_enum_items(prop, select_mouse_items);
+	RNA_def_property_ui_text(prop, "Select Mouse", "The mouse button used for selection.");
 	
 	prop= RNA_def_property(srna, "emulate_3_button_mouse", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TWOBUTTONMOUSE);
@@ -1715,14 +1721,12 @@
 	RNA_def_property_update(prop, 0, "rna_userdef_update");
 
 	/* middle mouse button */
-	prop= RNA_def_property(srna, "middle_mouse_rotate", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_VIEWMOVE);
-	RNA_def_property_ui_text(prop, "Middle Mouse Rotate", "Use the middle mouse button for rotation the viewport.");
+	
+	prop= RNA_def_property(srna, "middle_mouse", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+	RNA_def_property_enum_items(prop, middle_mouse_mouse_items);
+	RNA_def_property_ui_text(prop, "Middle Mouse", "Use the middle mouse button to pan or zoom the view.");
 
-	prop= RNA_def_property(srna, "middle_mouse_pan", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_VIEWMOVE);
-	RNA_def_property_ui_text(prop, "Middle Mouse Pan", "Use the middle mouse button for panning the viewport.");
-
 	prop= RNA_def_property(srna, "wheel_invert_zoom", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_WHEELZOOMDIR);
 	RNA_def_property_ui_text(prop, "Wheel Invert Zoom", "Swap the Mouse Wheel zoom direction.");





More information about the Bf-blender-cvs mailing list