[PD-cvs] SF.net SVN: pure-data: [9701] branches/pd-extended/v0-40/pd/src/u_main.tk

eighthave at users.sourceforge.net eighthave at users.sourceforge.net
Tue Apr 15 23:24:28 CEST 2008


Revision: 9701
          http://pure-data.svn.sourceforge.net/pure-data/?rev=9701&view=rev
Author:   eighthave
Date:     2008-04-15 14:24:27 -0700 (Tue, 15 Apr 2008)

Log Message:
-----------

Cleaned up menus and key bindings.

- added all elements to Pd window's File menu

- added "Raise Pd window" option

- switched up console clear and toggle key bindings

- removed key binding for Text Editor on Mac OS X, since it conflicts with the
  standard fontpanel binding, plus the text editor is no longer needed since
  direct copy-n-paste works now.

Modified Paths:
--------------
    branches/pd-extended/v0-40/pd/src/u_main.tk

Modified: branches/pd-extended/v0-40/pd/src/u_main.tk
===================================================================
--- branches/pd-extended/v0-40/pd/src/u_main.tk	2008-04-15 19:23:12 UTC (rev 9700)
+++ branches/pd-extended/v0-40/pd/src/u_main.tk	2008-04-15 21:24:27 UTC (rev 9701)
@@ -436,7 +436,7 @@
     pack .sendpanel.entry -side bottom -fill both -ipadx 100
     .sendpanel.entry select from 0
     .sendpanel.entry select adjust end
-    if {$pd_nt == 2} {
+    if{$pd_nt == 2} {
         bind .sendpanel <Mod1-Key-w> {destroy .sendpanel}
     } else {
         bind .sendpanel <Control-Key-w> {destroy .sendpanel}
@@ -449,10 +449,21 @@
 }
 
 ################## menu commands for console #########################
-proc menu_clear_console {} {.printout.text delete 0.0 end}
 
+proc menu_raise_console {} {
+	set pd_window [winfo toplevel .printout]
+	set top_window [lindex [wm stackorder $pd_window] end]
+	if {$pd_window eq $top_window} {
+		lower $pd_window
+	} else {
+		raise $pd_window
+	}
+}
+
 proc menu_toggle_console {} {.controls.switches.console invoke}
 
+proc menu_clear_console {} {.printout.text delete 0.0 end}
+
 ################## the "Quit" menu command #########################
 proc menu_really_quit {} {pd {pd quit;}}
 
@@ -711,6 +722,15 @@
         -command {pd pd start-startup-dialog \;}
 }
 .mbar.file add  separator
+.mbar.file add command -label Close -accelerator [accel_munge "Ctrl+w"] \
+	-state disabled
+.mbar.file add command -label Save -accelerator [accel_munge "Ctrl+s"] \
+	-state disabled
+.mbar.file add command -label "Save as..." -accelerator [accel_munge "Ctrl+S"] \
+	-state disabled
+.mbar.file add command -label Print -accelerator [accel_munge "Ctrl+p"] \
+	-state disabled
+.mbar.file add  separator
 .mbar.file add command -label Quit -command {menu_quit} \
     -accelerator [accel_munge "Ctrl+q"]
 
@@ -736,14 +756,20 @@
 .mbar.edit add command -label {Select all} -accelerator [accel_munge "Ctrl+a"] \
     -state disabled 
 .mbar.edit add separator
-.mbar.edit add command -label {Text Editor} \
-    -accelerator "Ctrl-T" -state disabled
+if {$pd_nt == 2} { # no key command for Mac OS X
+	.mbar.edit add command -label {Text Editor} -state disabled
+} else {
+	.mbar.edit add command -label {Text Editor} -accelerator "Ctrl+t" \
+	-state disabled
+}
 .mbar.edit add command -label Font -state disabled
 .mbar.edit add command -label {Tidy Up} -state disabled
-.mbar.edit add command -label "Toggle console" -accelerator [accel_munge "Ctrl+l"]\
-        -command menu_toggle_console
+.mbar.edit add command -label "Raise Pd window" -accelerator [accel_munge "Ctrl+r"]\
+	-command menu_raise_console
+.mbar.edit add command -label "Toggle console" -accelerator [accel_munge "Shift+Ctrl+r"]\
+	-command menu_toggle_console
 .mbar.edit add command -label "Clear console" \
-    -accelerator [accel_munge "Ctrl+r"] -command menu_clear_console
+    -accelerator [accel_munge "Shift+Ctrl+l"] -command menu_clear_console
 .mbar.edit add separator
 # this should apply to .printout.text
 .mbar.edit add command -label {Find...} -accelerator [accel_munge "Ctrl+f"] \
@@ -1166,23 +1192,31 @@
         -accelerator [accel_munge "Ctrl+a"]
 
     $name.m.edit add separator
+	if {$pd_nt == 2} { # no key command on Mac OS X, conflicts with standard
+		$name.m.edit add command -label {Text Editor} \
+			-command [concat menu_texteditor $name]
+	} else {
+		$name.m.edit add command -label {Text Editor} \
+			-accelerator [accel_munge "Ctrl+t"] \
+			-command [concat menu_texteditor $name]
+	}
 
-    $name.m.edit add command -label {Text Editor} \
-        -command [concat menu_texteditor $name] \
-        -accelerator "Ctrl-T"
-
     $name.m.edit add command -label Font \
         -command [concat menu_font $name] 
 
     $name.m.edit add command -label {Tidy Up} \
         -command [concat menu_tidyup $name]
 
+    $name.m.edit add command -label "Raise Pd window" \
+        -accelerator [accel_munge "Ctrl+r"] \
+        -command [concat menu_raise_console]
+
     $name.m.edit add command -label "Toggle console" \
-        -accelerator [accel_munge "Ctrl+l"] \
+        -accelerator [accel_munge "Shift+Ctrl+r"] \
         -command [concat .controls.switches.console invoke]
 
     $name.m.edit add command -label "Clear console" \
-        -accelerator [accel_munge "Ctrl+r"] \
+        -accelerator [accel_munge "Shift+Ctrl+l"] \
         -command [concat menu_clear_console]
 
     $name.m.edit add separator
@@ -1861,6 +1895,8 @@
         if {$key == "d" || $key == "D"} {menu_vradio $topname 1}
         if {$key == "u" || $key == "U"} {menu_vumeter $topname 1}
         if {$key == "c" || $key == "C"} {menu_mycnv $topname 1}
+        if {$key == "l" || $key == "L"} {menu_clear_console}
+        if {$key == "r" || $key == "R"} {menu_toggle_console}
     } else {
         if {$key == "e" || $key == "E"} {menu_editmode $topname}
         if {$key == "q" || $key == "Q"} {menu_quit}
@@ -1872,8 +1908,7 @@
         if {$key == "m" || $key == "M"} {menu_send}
         if {$key == "w" || $key == "W"} {menu_close $topname}
         if {$key == "p" || $key == "P"} {menu_print $topname}
-        if {$key == "l" || $key == "L"} {menu_toggle_console}
-        if {$key == "r" || $key == "R"} {menu_clear_console}
+        if {$key == "r" || $key == "R"} {menu_raise_console}
         if {$key == "x" || $key == "X"} {menu_cut $topname}
         if {$key == "c" || $key == "C"} {menu_copy $topname}
         if {$key == "v" || $key == "V"} {menu_paste $topname}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Pd-cvs mailing list