move mouse select options into their own property function - more operators should...
authorCampbell Barton <ideasman42@gmail.com>
Mon, 28 May 2012 05:45:19 +0000 (05:45 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 28 May 2012 05:45:19 +0000 (05:45 +0000)
source/blender/editors/space_view3d/view3d_select.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_operators.c

index 18c7e975356014f677397f50cd4aa87e02fb25b7..bef9219f44c3bf5cb731d1e62c0fd318d84af63f 100644 (file)
@@ -2152,9 +2152,8 @@ void VIEW3D_OT_select(wmOperatorType *ot)
        ot->flag = OPTYPE_UNDO;
        
        /* properties */
-       RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first");
-       RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Remove from selection");
-       RNA_def_boolean(ot->srna, "toggle", 0, "Toggle Selection", "Toggles selection");
+       WM_operator_properties_mouse_select(ot);
+
        RNA_def_boolean(ot->srna, "center", 0, "Center", "Use the object center when selecting, in editmode used to extend object selection");
        RNA_def_boolean(ot->srna, "enumerate", 0, "Enumerate", "List objects under the mouse (object mode only)");
        RNA_def_boolean(ot->srna, "object", 0, "Object", "Use object selection (editmode only)");
index 3bbd5583aa5ecd2bb7d4064e15ddfcaf2fcd18ea..bfea3f3c40b1f0200a45bfa99c078280252d2276 100644 (file)
@@ -209,6 +209,7 @@ void                WM_operator_properties_create_ptr(struct PointerRNA *ptr, struct wmOperato
 void           WM_operator_properties_free(struct PointerRNA *ptr);
 void           WM_operator_properties_filesel(struct wmOperatorType *ot, int filter, short type, short action, short flag, short display);
 void           WM_operator_properties_gesture_border(struct wmOperatorType *ot, int extend);
+void        WM_operator_properties_mouse_select(struct wmOperatorType *ot);
 void           WM_operator_properties_gesture_straightline(struct wmOperatorType *ot, int cursor);
 void           WM_operator_properties_select_all(struct wmOperatorType *ot);
 
index 2cd955e9ee9cf1486d1aea32af20ee0d8710a564..0d1d9a7a552eb42909d145c70ad3a98a24c26abf 100644 (file)
@@ -918,6 +918,13 @@ void WM_operator_properties_gesture_border(wmOperatorType *ot, int extend)
                RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection instead of deselecting everything first");
 }
 
+void WM_operator_properties_mouse_select(wmOperatorType *ot)
+{
+       RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first");
+       RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Remove from selection");
+       RNA_def_boolean(ot->srna, "toggle", 0, "Toggle Selection", "Toggles selection");
+}
+
 void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor)
 {
        RNA_def_int(ot->srna, "xstart", 0, INT_MIN, INT_MAX, "X Start", "", INT_MIN, INT_MAX);