- report header buttons were not drawing.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 24 Jul 2009 23:07:18 +0000 (23:07 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 24 Jul 2009 23:07:18 +0000 (23:07 +0000)
- shift+b in the console would do border zoom (rather then upper case B), fixed by making v2d's border zoom check if the v2d's zoom is locked.
- blender in debug mode registers all operators, useful for testing.

release/ui/space_console.py
source/blender/editors/interface/view2d_ops.c
source/blender/editors/space_console/space_console.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/windowmanager/intern/wm_event_system.c

index 38358e9..0869556 100644 (file)
@@ -18,7 +18,7 @@ class CONSOLE_HT_header(bpy.types.Header):
                row = layout.row()
                row.itemR(sc, "console_type", expand=True)
 
-               if sc.type == 'REPORT':
+               if sc.console_type == 'REPORT':
                        
                        if context.area.show_menus:
                                row = layout.row()
index f0745eb..44b7f1d 100644 (file)
@@ -464,7 +464,7 @@ void VIEW2D_OT_scroll_up(wmOperatorType *ot)
 /* ------------------ 'Shared' stuff ------------------------ */
  
 /* check if step-zoom can be applied */
-static short view_zoomstep_ok(bContext *C)
+static int view_zoom_poll(bContext *C)
 {
        ARegion *ar= CTX_wm_region(C);
        View2D *v2d;
@@ -527,7 +527,7 @@ static void view_zoomstep_apply(bContext *C, wmOperator *op)
 static int view_zoomin_exec(bContext *C, wmOperator *op)
 {
        /* check that there's an active region, as View2D data resides there */
-       if (!view_zoomstep_ok(C))
+       if (!view_zoom_poll(C))
                return OPERATOR_PASS_THROUGH;
        
        /* set RNA-Props - zooming in by uniform factor */
@@ -563,7 +563,7 @@ void VIEW2D_OT_zoom_in(wmOperatorType *ot)
 static int view_zoomout_exec(bContext *C, wmOperator *op)
 {
        /* check that there's an active region, as View2D data resides there */
-       if (!view_zoomstep_ok(C))
+       if (!view_zoom_poll(C))
                return OPERATOR_PASS_THROUGH;
        
        /* set RNA-Props - zooming in by uniform factor */
@@ -831,6 +831,8 @@ void VIEW2D_OT_zoom(wmOperatorType *ot)
        ot->invoke= view_zoomdrag_invoke;
        ot->modal= view_zoomdrag_modal;
        
+       ot->poll= view_zoom_poll;
+       
        /* operator is repeatable */
        // ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING;
        
@@ -929,7 +931,7 @@ void VIEW2D_OT_zoom_border(wmOperatorType *ot)
        ot->exec= view_borderzoom_exec;
        ot->modal= WM_border_select_modal;
        
-       ot->poll= ED_operator_areaactive;
+       ot->poll= view_zoom_poll;
        
        /* rna */
        RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX);
index 763be03..db70eff 100644 (file)
@@ -277,6 +277,8 @@ void console_keymap(struct wmWindowManager *wm)
 
 #ifndef DISABLE_PYTHON
        WM_keymap_add_item(keymap, "CONSOLE_OT_exec", RETKEY, KM_PRESS, 0, 0); /* python operator - space_text.py */
+       WM_keymap_add_item(keymap, "CONSOLE_OT_exec", PADENTER, KM_PRESS, 0, 0);
+       
        //WM_keymap_add_item(keymap, "CONSOLE_OT_autocomplete", TABKEY, KM_PRESS, 0, 0); /* python operator - space_text.py */
        WM_keymap_add_item(keymap, "CONSOLE_OT_autocomplete", RETKEY, KM_PRESS, KM_CTRL, 0); /* python operator - space_text.py */
 #endif
@@ -291,13 +293,8 @@ void console_keymap(struct wmWindowManager *wm)
        WM_keymap_add_item(keymap, "CONSOLE_OT_report_delete", DELKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "CONSOLE_OT_report_copy", CKEY, KM_PRESS, KM_CTRL, 0);
 
-
-
-
-
-
        RNA_string_set(WM_keymap_add_item(keymap, "CONSOLE_OT_insert", TABKEY, KM_PRESS, 0, 0)->ptr, "text", "    "); /* fake tabs */
-       WM_keymap_add_item(keymap, "CONSOLE_OT_insert", KM_TEXTINPUT, KM_PRESS, KM_ANY, 0); // last!
+       WM_keymap_add_item(keymap, "CONSOLE_OT_insert", KM_TEXTINPUT, KM_ANY, KM_ANY, 0); // last!
 }
 
 /****************** header region ******************/
index 3c80b65..f278b71 100644 (file)
@@ -1149,7 +1149,7 @@ void VIEW3D_OT_render_border(wmOperatorType *ot)
 }
 /* ********************* Border Zoom operator ****************** */
 
-static int view3d_border_zoom_exec(bContext *C, wmOperator *op)
+static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
 {
        ARegion *ar= CTX_wm_region(C);
        View3D *v3d = CTX_wm_view3d(C);
@@ -1285,7 +1285,7 @@ static int view3d_border_zoom_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
-static int view3d_border_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int view3d_zoom_border_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
        RegionView3D *rv3d= CTX_wm_region_view3d(C);
 
@@ -1305,8 +1305,8 @@ void VIEW3D_OT_zoom_border(wmOperatorType *ot)
        ot->idname= "VIEW3D_OT_zoom_border";
 
        /* api callbacks */
-       ot->invoke= view3d_border_zoom_invoke;
-       ot->exec= view3d_border_zoom_exec;
+       ot->invoke= view3d_zoom_border_invoke;
+       ot->exec= view3d_zoom_border_exec;
        ot->modal= WM_border_select_modal;
 
        ot->poll= ED_operator_view3d_active;
index e9affba..7f40ec4 100644 (file)
@@ -267,7 +267,7 @@ static int wm_operator_exec(bContext *C, wmOperator *op, int repeat)
                        ED_undo_push_op(C, op);
                
                if(repeat==0) {
-                       if(op->type->flag & OPTYPE_REGISTER)
+                       if((op->type->flag & OPTYPE_REGISTER) || (G.f & G_DEBUG))
                                wm_operator_register(C, op);
                        else
                                WM_operator_free(op);
@@ -373,7 +373,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P
                        if(ot->flag & OPTYPE_UNDO)
                                ED_undo_push_op(C, op);
                        
-                       if(ot->flag & OPTYPE_REGISTER)
+                       if((ot->flag & OPTYPE_REGISTER) || (G.f & G_DEBUG))
                                wm_operator_register(C, op);
                        else
                                WM_operator_free(op);
@@ -717,7 +717,7 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
                                if(ot->flag & OPTYPE_UNDO)
                                        ED_undo_push_op(C, op);
                                
-                               if(ot->flag & OPTYPE_REGISTER)
+                               if((ot->flag & OPTYPE_REGISTER) || (G.f & G_DEBUG))
                                        wm_operator_register(C, op);
                                else
                                        WM_operator_free(op);