[PD-cvs] pd/src desire.tk,1.1.2.1,1.1.2.2

chunlee chunlee at users.sourceforge.net
Fri Jul 29 03:49:59 CEST 2005


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21581

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
started to do error proof for things that are not yet implemented. so at 
least the current code will run without any unwanted errors


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** desire.tk	28 Jul 2005 01:36:32 -0000	1.1.2.1
--- desire.tk	29 Jul 2005 01:49:57 -0000	1.1.2.2
***************
*** 23,26 ****
--- 23,27 ----
  #
  #oh, these codes are not clean, i mean, there are codes that are left over from before, sorry:/
+ 
  #26072005, chun at goto10.org
  #-----------------------------------------------------------------------------------#
***************
*** 173,249 ****
  
  #-----------------------------------------------------------------------------------#
  set canvasmenu(file) {
! 	{New {menu_new} "Ctrl+n"}
! 	{Open {menu_open} "Ctrl+o"}
  	{}
! 	{Message {menu_send} "Ctrl+m"}
! 	{Path... {pd "pd start-path-dialog ;"} {}}
  	{}
! 	{Close {menu_close %W} "Ctrl+w"}
! 	{Save  {menu_save %W} "Ctrl+s"}
! 	{"Save as..." {menu_saveas %W} "Ctrl+S"}
! 	{Print {menu_print %W} "Ctrl+p"}
  	{}
! 	{Quit {menu_quit} "Ctrl+q"}
  }
  #-----------------------------------------------------------------------------------#
  set canvasmenu(edit) {
! 	{Undo {menu_undo %W} "Ctrl+z"}
! 	{Redo {menu_redo %W} "Ctrl+Z"}
  	{}
! 	{Cut   {pd "%W cut ;"}   "Ctrl+x"}
! 	{Copy  {pd "%W copy ;"}  "Ctrl+c"}
! 	{Paste {pd "%W paste ;"} "Ctrl+v"}
! 	{Duplicate {pd "%W duplicate ;"} "Ctrl+d"}
! 	{"Select all" {pd "%W selectall ;"} "Ctrl+a"}
  	{}
! 	{"Text Editor" {pd "%W texteditor ;"} "Ctrl+t"}
! 	{Font {pd "%W menufont ;"} {}}
! 	{"Tidy Up" {pd "%W tidy ;"} {}}
  	{}
  }
  #-----------------------------------------------------------------------------------#
! set canvasmenu(put_original) {
! 	{Object  {pd "%W obj 0 ;"} "Ctrl+1"}
! 	{Message {pd "%W msg 0 ;"} "Ctrl+2"}
! 	{Number  {pd "%W floatatom 0 ;"} "Ctrl+3"}
! 	{Symbol  {pd "%W symbolatom 0 ;"} "Ctrl+4"}
! 	{Comment {pd "%W text 0 ;"} "Ctrl+5"}
! 	{}
! 	{Bang    {pd "%W bng 0 ;"} "Alt+b"}
!         {Toggle  {pd "%W toggle 0 ;"} "Alt+t"}
!         {Number2 {pd "%W numbox 0 ;"} "Alt+n"}
!         {Vslider {pd "%W vslider 0 ;"} "Alt+v"}
!         {Hslider {pd "%W hslider 0 ;"} "Alt+h"}
!         {Vradio  {pd "%W vradio 0 ;"} "Alt+d"}
!         {Hradio  {pd "%W hradio 0 ;"} "Alt+i"}
! 	{VU      {pd "%W vumeter 0 ;"} "Alt+u"}
! 	{dropper      {pd "%W dropper 0 ;"} "Alt+x"}
!         {Canvas  {pd "%W mycnv 0 ;"} "Alt+c"}
! 	{}
! 	{Graph   {pd "%W graph ;"} {}}
! 	{Array   {pd "%W menuarray ;"} {}}
! }
  #-----------------------------------------------------------------------------------#
  set canvasmenu(put) {
  	{Object  {object_new} "Ctrl+1"}
! 	{Message {pd "%W msg 0 ;"} "Ctrl+2"}
! 	{Number  {pd "%W floatatom 0 ;"} "Ctrl+3"}
! 	{Symbol  {pd "%W symbolatom 0 ;"} "Ctrl+4"}
! 	{Comment {pd "%W text 0 ;"} "Ctrl+5"}
  	{}
! 	{Bang    {pd "%W bng 0 ;"} "Alt+b"}
!         {Toggle  {pd "%W toggle 0 ;"} "Alt+t"}
!         {Number2 {pd "%W numbox 0 ;"} "Alt+n"}
!         {Vslider {pd "%W vslider 0 ;"} "Alt+v"}
!         {Hslider {pd "%W hslider 0 ;"} "Alt+h"}
!         {Vradio  {pd "%W vradio 0 ;"} "Alt+d"}
!         {Hradio  {pd "%W hradio 0 ;"} "Alt+i"}
! 	{VU      {pd "%W vumeter 0 ;"} "Alt+u"}
! 	{dropper      {pd "%W dropper 0 ;"} "Alt+x"}
!         {Canvas  {pd "%W mycnv 0 ;"} "Alt+c"}
  	{}
! 	{Graph   {pd "%W graph ;"} {}}
! 	{Array   {pd "%W menuarray ;"} {}}
  }
  #-----------------------------------------------------------------------------------#
--- 174,288 ----
  
  #-----------------------------------------------------------------------------------#
+ #the original:
+ #set canvasmenu(file) {
+ #	{New {menu_new} "Ctrl+n"}
+ #	{Open {menu_open} "Ctrl+o"}
+ #	{}
+ #	{Message {menu_send} "Ctrl+m"}
+ #	{Path... {pd "pd start-path-dialog ;"} {}}
+ #	{}
+ #	{Close {menu_close %W} "Ctrl+w"}
+ #	{Save  {menu_save %W} "Ctrl+s"}
+ #	{"Save as..." {menu_saveas %W} "Ctrl+S"}
+ #	{Print {menu_print %W} "Ctrl+p"}
+ #	{}
+ #	{Quit {menu_quit} "Ctrl+q"}
+ #}
+ 
+ #error proof with foo
  set canvasmenu(file) {
! 	{New {foo menu_new} "Ctrl+n"}
! 	{Open {foo menu_open} "Ctrl+o"}
  	{}
! 	{Message {foo menu_send} "Ctrl+m"}
! 	{Path... {foo "pd start-path-dialog"} {}}
  	{}
! 	{Close {foo menu_close} "Ctrl+w"}
! 	{Save  {foo menu_save} "Ctrl+s"}
! 	{"Save as..." {foo menu_saveas} "Ctrl+S"}
! 	{Print {foo menu_print} "Ctrl+p"}
  	{}
! 	{Quit {foo menu_quit} "Ctrl+q"}
  }
  #-----------------------------------------------------------------------------------#
+ # the original
+ #set canvasmenu(edit) {
+ #	{Undo {menu_undo %W} "Ctrl+z"}
+ #	{Redo {menu_redo %W} "Ctrl+Z"}
+ #	{}
+ #	{Cut   {pd "%W cut ;"}   "Ctrl+x"}
+ #	{Copy  {pd "%W copy ;"}  "Ctrl+c"}
+ #	{Paste {pd "%W paste ;"} "Ctrl+v"}
+ #	{Duplicate {pd "%W duplicate ;"} "Ctrl+d"}
+ #	{"Select all" {pd "%W selectall ;"} "Ctrl+a"}
+ #	{}
+ #	{"Text Editor" {pd "%W texteditor ;"} "Ctrl+t"}
+ #	{Font {pd "%W menufont ;"} {}}
+ #	{"Tidy Up" {pd "%W tidy ;"} {}}
+ #	{}
+ #}
+ 
+ #error proof with foo
  set canvasmenu(edit) {
! 	{Undo {foo menu_undo} "Ctrl+z"}
! 	{Redo {foo menu_redo} "Ctrl+Z"}
  	{}
! 	{Cut   {foo "pd %W cut"}   "Ctrl+x"}
! 	{Copy  {foo "pd %W copy"}  "Ctrl+c"}
! 	{Paste {foo "pd %W paste"} "Ctrl+v"}
! 	{Duplicate {foo "pd %W duplicate"} "Ctrl+d"}
! 	{"Select all" {foo "pd %W selectall"} "Ctrl+a"}
  	{}
! 	{"Text Editor" {foo "pd %W texteditor"} "Ctrl+t"}
! 	{Font {foo "pd %W menufont "} {}}
! 	{"Tidy Up" {foo "pd %W tidy "} {}}
  	{}
  }
+ 
  #-----------------------------------------------------------------------------------#
! # the original
! #set canvasmenu(put_original) {
! #	{Object  {pd "%W obj 0 ;"} "Ctrl+1"}
! #	{Message {pd "%W msg 0 ;"} "Ctrl+2"}
! #	{Number  {pd "%W floatatom 0 ;"} "Ctrl+3"}
! #	{Symbol  {pd "%W symbolatom 0 ;"} "Ctrl+4"}
! #	{Comment {pd "%W text 0 ;"} "Ctrl+5"}
! #	{}
! #	{Bang    {pd "%W bng 0 ;"} "Alt+b"}
! #       {Toggle  {pd "%W toggle 0 ;"} "Alt+t"}
! #       {Number2 {pd "%W numbox 0 ;"} "Alt+n"}
! #        {Vslider {pd "%W vslider 0 ;"} "Alt+v"}
! #        {Hslider {pd "%W hslider 0 ;"} "Alt+h"}
! #        {Vradio  {pd "%W vradio 0 ;"} "Alt+d"}
! #        {Hradio  {pd "%W hradio 0 ;"} "Alt+i"}
! #	{VU      {pd "%W vumeter 0 ;"} "Alt+u"}
! #	{dropper      {pd "%W dropper 0 ;"} "Alt+x"}
! #        {Canvas  {pd "%W mycnv 0 ;"} "Alt+c"}
! #	{}
! #	{Graph   {pd "%W graph ;"} {}}
! #	{Array   {pd "%W menuarray ;"} {}}
! #}
  #-----------------------------------------------------------------------------------#
+ # only "put object" worx for now, the error proof the rest
  set canvasmenu(put) {
  	{Object  {object_new} "Ctrl+1"}
! 	{Message {foo "pd %W msg 0"} "Ctrl+2"}
! 	{Number  {foo "pd %W floatatom 0"} "Ctrl+3"}
! 	{Symbol  {foo "%W symbolatom 0"} "Ctrl+4"}
! 	{Comment {foo "pd %W text 0 ;"} "Ctrl+5"}
  	{}
! 	{Bang    {foo "pd %W bng 0 ;"} "Alt+b"}
!         {Toggle  {foo "pd %W toggle 0 ;"} "Alt+t"}
!         {Number2 {foo "pd %W numbox 0 ;"} "Alt+n"}
!         {Vslider {foo "pd %W vslider 0 ;"} "Alt+v"}
!         {Hslider {foo "pd %W hslider 0 ;"} "Alt+h"}
!         {Vradio  {foo "pd %W vradio 0 ;"} "Alt+d"}
!         {Hradio  {foo "pd %W hradio 0 ;"} "Alt+i"}
! 	{VU      {foo "pd %W vumeter 0 ;"} "Alt+u"}
! 	{dropper      {foo "pd %W dropper 0 ;"} "Alt+x"}
!         {Canvas  {foo "pd %W mycnv 0 ;"} "Alt+c"}
  	{}
! 	{Graph   {foo "pd %W graph ;"} {}}
! 	{Array   {foo "pd %W menuarray ;"} {}}
  }
  #-----------------------------------------------------------------------------------#
***************
*** 461,468 ****
  }
  
- #pdtk_canvas_new::: .x80f1d50 450 300 +0+0 1
  
  pdtk_canvas_new $canvas 300 300 +700+0 1
  
  
  #-----------------------------------------------------------------------------------#
--- 500,545 ----
  }
  
  
+ 
+ # 1 canvas
  pdtk_canvas_new $canvas 300 300 +700+0 1
  
+ #-----------------------------------------------------------------------------------#
+ proc menu_editmode {name} {
+ 	puts "menu_editmode::: $name"
+ 
+ 	#pd "$name editmode 0 ;"
+ }
+ #-----------------------------------------------------------------------------------#
+ # correct edit menu, enabling or disabling undo/redo
+ # LATER also cut/copy/paste
+ proc menu_fixeditmenu {name} {
+     puts "menu_fixeeditmenu::: $name"
+ 
+     #global pd_undoaction pd_redoaction pd_undocanvas
+     #if {$name == $pd_undocanvas && $pd_undoaction != "no"} {
+ 	#$name.m.edit entryconfigure "Undo*" -state normal -label "Undo $pd_undoaction"
+     #} else {
+ 	#$name.m.edit entryconfigure "Undo*" -state disabled -label "Undo"
+     #}
+     #if {$name == $pd_undocanvas && $pd_redoaction != "no"} {
+ 	#$name.m.edit entryconfigure "Redo*" -state normal -label "Redo $pd_redoaction"
+     #} else {
+ 	#$name.m.edit entryconfigure "Redo*" -state disabled
+     #}
+ }
+ 
+ #-----------------------------------------------------------------------------------#
+ 
+ # message from Pd to update the currently available undo/redo action
+ proc pdtk_undomenu {name undoaction redoaction} {
+     puts "pdtk_undomenu::: $name $undoaction $redoaction"
+ 
+     #global pd_undoaction pd_redoaction pd_undocanvas
+     #set pd_undocanvas $name
+     #set pd_undoaction $undoaction
+     #set pd_redoaction $redoaction
+     #if {$name != "nobody"} {menu_fixeditmenu $name}
+ }
  
  #-----------------------------------------------------------------------------------#
***************
*** 505,508 ****
--- 582,592 ----
      #}
  }
+ #-----------------------------------------------------------------------------------#
+ 
+ proc foo {foo} {
+ 
+ puts " $foo not there yet...."
+ 
+ }
  
  #-----------------------------------------------------------------------------------#





More information about the Pd-cvs mailing list