Revision: 16029
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16029
Author:   quorn
Date:     2008-08-08 18:49:14 +0200 (Fri, 08 Aug 2008)

Log Message:
-----------
Clipboard operations added to text editor RMB menu.

Modified Paths:
--------------
    branches/soc-2008-quorn/source/blender/src/drawtext.c

Modified: branches/soc-2008-quorn/source/blender/src/drawtext.c
===================================================================
--- branches/soc-2008-quorn/source/blender/src/drawtext.c       2008-08-08 
16:40:41 UTC (rev 16028)
+++ branches/soc-2008-quorn/source/blender/src/drawtext.c       2008-08-08 
16:49:14 UTC (rev 16029)
@@ -2643,7 +2643,10 @@
                }
        } else if (event==RIGHTMOUSE) {
                if (val) {
-                       p= pupmenu("File %t|New %x0|Open... %x1|Save %x2|Save 
As...%x3|Execute Script%x4");
+                       if (txt_has_sel(text))
+                               p= pupmenu("Text 
%t|Cut%x10|Copy%x11|Paste%x12|New %x0|Open... %x1|Save %x2|Save 
As...%x3|Execute Script%x4");
+                       else
+                               p= pupmenu("Text %t|Paste%x12|New %x0|Open... 
%x1|Save %x2|Save As...%x3|Execute Script%x4");
 
                        switch(p) {
                                case 0:
@@ -2669,8 +2672,29 @@
                                        run_python_script(st);
                                        do_draw= 1;
                                        break;
-                               default:
+                               case 10:
+                                       if (text && text->id.lib) {
+                                               error_libdata();
+                                               break;
+                                       }
+                                       txt_copy_clipboard(text);
+                                       txt_cut_sel(text);
+                                       pop_space_text(st);
+                                       do_draw= 1;
                                        break;
+                               case 11:
+                                       //txt_copy_sel(text);
+                                       txt_copy_clipboard(text);
+                                       break;
+                               case 12:
+                                       if (text && text->id.lib) {
+                                               error_libdata();
+                                               break;
+                                       }
+                                       txt_paste_clipboard(text);
+                                       if (st->showsyntax) txt_format_text(st);
+                                       do_draw= 1;
+                                       break;
                        }
                }
        } else if (ascii) {


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to