Revision: 18557
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18557
Author:   mfoxdogg
Date:     2009-01-18 02:26:20 +0100 (Sun, 18 Jan 2009)

Log Message:
-----------
 2.5
******
-ported some of the Object mode select menu to use uiDefMenuButO
        - select random/layer still uses the hard coded value as no sutible 
popup exists
        - select by type suffers from random crashes, somthing to do with 
Context
        - need some way of doing sub menu's using the operator's invoke
        - the old menu is just #if'ed out
        - and did a little hous cleaning aswel

- added some undo pushes to the select operators

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/object/object_edit.c
    
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c
    
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_select.c

Modified: 
branches/blender2.5/blender/source/blender/editors/object/object_edit.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/object/object_edit.c     
2009-01-17 22:14:08 UTC (rev 18556)
+++ branches/blender2.5/blender/source/blender/editors/object/object_edit.c     
2009-01-18 01:26:20 UTC (rev 18557)
@@ -1157,6 +1157,7 @@
        CTX_DATA_END;
        
        /* undo? */
+       ED_undo_push(C,"Select By Type");
        WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
        
        return OPERATOR_FINISHED;
@@ -1337,6 +1338,7 @@
        CTX_DATA_END;
        
        /* undo? */
+       ED_undo_push(C,"Select By Layer");
        WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
        
        return OPERATOR_FINISHED;
@@ -1368,6 +1370,7 @@
        CTX_DATA_END;
        
        /* undo? */
+       ED_undo_push(C,"Selection Invert");
        WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
        
        return OPERATOR_FINISHED;
@@ -1411,6 +1414,7 @@
        
        /* undo? */
        WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
+       ED_undo_push(C,"(De)Select All");
        
        return OPERATOR_FINISHED;
 }
@@ -1443,6 +1447,7 @@
        CTX_DATA_END;
        
        /* undo? */
+       ED_undo_push(C,"Select Random");
        WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
        
        return OPERATOR_FINISHED;
@@ -2760,7 +2765,7 @@
 if (tot_change) {
        ED_anim_dag_flush_update(C);
        allqueue(REDRAWVIEW3D, 0);
-       BIF_undo_push("Do Center");     
+       ED_undo_push(C,"Do Center");    
        }
        
        /* Warn if any errors occured */

Modified: 
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c 
    2009-01-17 22:14:08 UTC (rev 18556)
+++ 
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c 
    2009-01-18 01:26:20 UTC (rev 18557)
@@ -900,34 +900,14 @@
        return block;
 }
 
-void do_view3d_select_objectmenu(bContext *C, void *arg, int event)
-{
-#if 0
-       switch(event) {
-       
-       case 0: /* border select */
-               borderselect();
-               break;
-       case 1: /* Select/Deselect All */
-               deselectall();
-               break;
-       case 2: /* inverse */
-               selectswap();
-               break;
-       case 3: /* random */
-               selectrandom();
-               break;
-       }
-       allqueue(REDRAWVIEW3D, 0);
-#endif
-}
-
 static uiBlock *view3d_select_objectmenu(bContext *C, uiMenuBlockHandle 
*handle, void *arg_unused)
 {
        uiBlock *block;
        short yco= 0, menuwidth=120;
        
        block= uiBeginBlock(C, handle->region, "view3d_select_objectmenu", 
UI_EMBOSSP, UI_HELV);
+       
+#if 0
        uiBlockSetButmFunc(block, do_view3d_select_objectmenu, NULL);
        
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B",        
                        0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
@@ -945,7 +925,18 @@
        
        uiDefIconTextBlockBut(block, view3d_select_object_linkedmenu, NULL, 
ICON_RIGHTARROW_THIN, "Linked", 0, yco-=20, 120, 19, "");
        uiDefIconTextBlockBut(block, view3d_select_object_groupedmenu, NULL, 
ICON_RIGHTARROW_THIN, "Grouped", 0, yco-=20, 120, 19, "");
+#endif
+       uiDefMenuButO(block, "VIEW3D_OT_borderselect", "Border Select");
+       
+       uiDefMenuSep(block);
+       
+       uiDefMenuButO(block, "OBJECT_OT_de_select_all", "Select/Deselect All");
+       uiDefMenuButO(block, "OBJECT_OT_select_invert", "Inverse");
+       uiDefMenuButO(block, "OBJECT_OT_select_random", "Random");
+       uiDefMenuButO(block, "OBJECT_OT_select_by_layer", "Select All by 
Layer");
+       uiDefMenuButO(block, "OBJECT_OT_select_by_type", "Select All by Type");
 
+
        if(handle->region->alignment==RGN_ALIGN_TOP) {
                uiBlockSetDirection(block, UI_DOWN);
        }

Modified: 
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_select.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_select.c 
    2009-01-17 22:14:08 UTC (rev 18556)
+++ 
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_select.c 
    2009-01-18 01:26:20 UTC (rev 18557)
@@ -1477,7 +1477,7 @@
                }
                MEM_freeN(vbuffer);
        }
-       
+       ED_undo_push(C,"Border Select");
        return OPERATOR_FINISHED;
 } 
 
@@ -1542,6 +1542,7 @@
        else 
                mouse_select(C, mval, extend, 0);
        
+       ED_undo_push(C,"Mouse Select");
        /* allowing tweaks */
        return OPERATOR_PASS_THROUGH;
 }
@@ -1770,6 +1771,7 @@
                WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, 
CTX_data_scene(C));
        }
        
+       ED_undo_push(C,"Circle Select");
        return OPERATOR_FINISHED;
 }
 


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to