[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28733] trunk/blender: Add a little RMB context menu to text editor

Matt Ebb matt at mke3.net
Wed May 12 10:03:37 CEST 2010


Revision: 28733
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28733
Author:   broken
Date:     2010-05-12 10:03:36 +0200 (Wed, 12 May 2010)

Log Message:
-----------
Add a little RMB context menu to text editor

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/space_text.py
    trunk/blender/source/blender/editors/space_text/space_text.c

Modified: trunk/blender/release/scripts/ui/space_text.py
===================================================================
--- trunk/blender/release/scripts/ui/space_text.py	2010-05-12 04:25:33 UTC (rev 28732)
+++ trunk/blender/release/scripts/ui/space_text.py	2010-05-12 08:03:36 UTC (rev 28733)
@@ -274,6 +274,21 @@
         layout.menu("TEXT_MT_edit_to3d")
 
 
+class TEXT_MT_toolbox(bpy.types.Menu):
+    bl_label = ""
+
+    def draw(self, context):
+        layout = self.layout
+
+        layout.operator("text.cut")
+        layout.operator("text.copy")
+        layout.operator("text.paste")
+
+        layout.separator()
+        
+        layout.operator("text.run_script")
+
+
 classes = [
     TEXT_HT_header,
     TEXT_PT_properties,
@@ -285,7 +300,8 @@
     TEXT_MT_edit_view,
     TEXT_MT_edit_select,
     TEXT_MT_edit_markers,
-    TEXT_MT_edit_to3d]
+    TEXT_MT_edit_to3d,
+    TEXT_MT_toolbox]
 
 
 def register():

Modified: trunk/blender/source/blender/editors/space_text/space_text.c
===================================================================
--- trunk/blender/source/blender/editors/space_text/space_text.c	2010-05-12 04:25:33 UTC (rev 28732)
+++ trunk/blender/source/blender/editors/space_text/space_text.c	2010-05-12 08:03:36 UTC (rev 28733)
@@ -307,6 +307,8 @@
 	WM_keymap_add_item(keymap, "TEXT_OT_line_break", RETKEY, KM_PRESS, 0, 0);
 	WM_keymap_add_item(keymap, "TEXT_OT_line_break", PADENTER, KM_PRESS, 0, 0);
 
+	WM_keymap_add_menu(keymap, "TEXT_MT_toolbox", RIGHTMOUSE, KM_PRESS, KM_ANY, 0);
+	
 	WM_keymap_add_item(keymap, "TEXT_OT_line_number", KM_TEXTINPUT, KM_ANY, KM_ANY, 0);
 	WM_keymap_add_item(keymap, "TEXT_OT_insert", KM_TEXTINPUT, KM_ANY, KM_ANY, 0); // last!
 }





More information about the Bf-blender-cvs mailing list