Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3036
Modified Files: Tag: devel_0_39 desire.tk Log Message: fixing menu stuff
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.36 retrieving revision 1.1.2.37 diff -C2 -d -r1.1.2.36 -r1.1.2.37 *** desire.tk 10 Sep 2005 08:26:46 -0000 1.1.2.36 --- desire.tk 10 Sep 2005 09:50:14 -0000 1.1.2.37 *************** *** 25,30 **** }
! rename unknown _original_unknown ! proc unknown {args} { global _ if {[catch { --- 25,30 ---- }
! #rename unknown _original_unknown ! proc unknownBLEH {args} { global _ if {[catch { *************** *** 195,207 **** menu .mbar.find -tearoff $pd_tearoff; .mbar add cascade -label "Find" -menu .mbar.find menu .mbar.windows -postcommand pdtk_fixwindowmenu -tearoff $pd_tearoff ! menu .mbar.audio -tearoff $pd_tearoff ! if {$pd_nt != 2} { ! .mbar add cascade -label "Windows" -menu .mbar.windows ! .mbar add cascade -label "Media" -menu .mbar.audio ! } else { ! # Mac HIG want "Window Help" as the last menus ! .mbar add cascade -label "Media" -menu .mbar.audio ! .mbar add cascade -label "Windows" -menu .mbar.windows ! } menu .mbar.help -tearoff $pd_tearoff .mbar add cascade -label "Help" -menu .mbar.help --- 195,202 ---- menu .mbar.find -tearoff $pd_tearoff; .mbar add cascade -label "Find" -menu .mbar.find menu .mbar.windows -postcommand pdtk_fixwindowmenu -tearoff $pd_tearoff ! menu .mbar.media -tearoff $pd_tearoff ! # Mac HIG want "Window Help" as the last menus ! .mbar add cascade -label "Media" -menu .mbar.media ! .mbar add cascade -label "Window" -menu .mbar.windows menu .mbar.help -tearoff $pd_tearoff .mbar add cascade -label "Help" -menu .mbar.help *************** *** 220,223 **** --- 215,226 ---- }
+ proc pdtk_pd_startup {version apilist midiapilist fontname} { + global pd_myversion pd_apilist pd_midiapilist + set pd_myversion $version + set pd_apilist $apilist + set pd_midiapilist $midiapilist + menu_addstd .mbar + } + foreach z {in out} { set f .controls.$z *************** *** 671,678 **** {"Open" {menu_open} "Ctrl+o"} {} ! {"Class List" {foo class_browser} ""} ! {".pdrc Editor" {foo pdrc_editor_new} ""} ! {"Message" {foo menu_send} "Ctrl+m"} ! {"Path..." {foo "pd start-path-dialog ;"} ""} {} {"Quit" {menu_quit} "Ctrl+q"} --- 674,681 ---- {"Open" {menu_open} "Ctrl+o"} {} ! {"Class List" {class_browser} ""} ! {".pdrc Editor" {pdrc_editor_new} ""} ! {"Message" {menu_send} "Ctrl+m"} ! {"Path..." {pd "pd start-path-dialog ;"} ""} {} {"Quit" {menu_quit} "Ctrl+q"} *************** *** 748,833 **** }
- proc menu_addstd {mbar} { - puts "menu_addstd::: $mbar" - - global pd_apilist - populate_menu $mbar.audio {} { - {"audio ON" {menu_audio 1} "Ctrl+/"} - {"audio OFF" {menu_audio 0} "Ctrl+."} - } - for {set x 0} {$x<[llength $pd_apilist]} {incr x} { - $mbar.audio add radiobutton -label [lindex [lindex $pd_apilist $x] 0] \ - -command {menu_audio 0} -variable pd_whichapi \ - -value [lindex [lindex $pd_apilist $x] 1] - #-command {pd "pd audio-setapi $pd_whichapi ;"} - } - populate_menu $mbar.audio {} { - {"Audio settings..." {foo pd "pd audio-properties"} ""} - {"MIDI settings..." {foo pd "pd midi-properties"} ""} - {"Test Audio and MIDI" {foo pd "menu_doc_open doc/7.stuff/tools testtone.pd"} ""} - {"Load Meter" {foo pd "menu_doc_open doc/7.stuff/tools load-meter.pd"} ""} - } - populate_menu $mbar.help {} { - {"About Pd" {foo pd "menu_about"} ""} - {"Pure Documentation..." {foo pd "menu_documentation"} ""} - } - - } - #-----------------------------------------------------------------------------------# set canvasmenu(file) { {New {menu_new} "Ctrl+n"} ! {Open {foo menu_open} "Ctrl+o"} {} ! {Message {foo menu_send} "Ctrl+m"} ! {Path... {foo pd "pd start-path-dialog"} {}} {} ! {Close {foo menu_close} "Ctrl+w"} {Save {menu_save} "Ctrl+s"} {"Save as..." {menu_saveas} "Ctrl+S"} {Print {menu_print} "Ctrl+p"} {} ! {Quit {foo menu_quit} "Ctrl+q"} }
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"} {}} {} }
- #-----------------------------------------------------------------------------------# - # only "put object" worx for now, the error proof the rest set canvasmenu(put) { {Object {textobj_new} "Ctrl+1"} ! {Message {foo pd "%W msg 0"} "Ctrl+2"} ! {Number {foo pd "%W floatatom 0"} "Ctrl+3"} ! {Symbol {foo pd "%W symbolatom 0"} "Ctrl+4"} ! {Comment {foo pd "%W text 0"} "Ctrl+5"} {} {Bang {bang_new} "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 ;"} {}} } #-----------------------------------------------------------------------------------#
--- 751,848 ---- }
#-----------------------------------------------------------------------------------# 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} "Ctrl+w"} {Save {menu_save} "Ctrl+s"} {"Save as..." {menu_saveas} "Ctrl+S"} {Print {menu_print} "Ctrl+p"} {} ! {Quit {menu_quit} "Ctrl+q"} }
set canvasmenu(edit) { ! {Undo {menu_undo} "Ctrl+z"} ! {Redo {menu_redo} "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) { {Object {textobj_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 {bang_new} "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(media) { ! {{audio ON} {menu_audio 1} "Ctrl+/"} ! {{audio OFF} {menu_audio 0} "Ctrl+."} ! {} ! } ! ! if {$pd_nt != 2} { ! lappend canvasmenu(media) {{Audio settings...} {pd pd audio-properties ;} {}} ! lappend canvasmenu(media) {{MIDI settings...} {pd pd midi-properties ;} {}} ! } ! ! lappend canvasmenu(media) {} \ ! {"Test Audio and MIDI" {pd "menu_doc_open doc/7.stuff/tools testtone.pd"} ""} \ ! {"Load Meter" {pd "menu_doc_open doc/7.stuff/tools load-meter.pd"} ""} ! ! proc menu_addstd {mbar} { ! global pd_apilist pd_midiapilist canvasmenu ! populate_menu $mbar.media {} $canvasmenu(media) ! set x 0 ! populate_menu $mbar.media {} {{}} ! foreach a $pd_apilist { ! $mbar.media add radiobutton -label [lindex $a 0] \ ! -command {menu_audio 0} -variable pd_whichapi -value [lindex $a 1] \ ! -command {pd "pd audio-setapi $pd_whichapi ;"} ! incr x ! } ! populate_menu $mbar.media {} {{}} ! foreach a $pd_midiapilist { ! $mbar.media add radiobutton -label [lindex $a 0] \ ! -command {menu_midi 0} -variable pd_whichmidiapi -value [lindex $a 1] \ ! -command {pd "pd midi-setapi $pd_whichmidiapi ;"} ! incr x ! } ! populate_menu $mbar.help {} { ! {"About Pd" {pd "menu_about"} ""} ! {"Pure Documentation..." {pd "menu_documentation"} ""} ! } ! } + #-----------------------------------------------------------------------------------#
*************** *** 924,935 **** {} } ! menu $name.m.audio -tearoff $pd_tearoff ! if {$pd_nt != 2} { ! $name.m add cascade -label Windows -menu $name.m.windows ! $name.m add cascade -label Media -menu $name.m.audio ! } else { ! $name.m add cascade -label Media -menu $name.m.audio ! $name.m add cascade -label Window -menu $name.m.windows ! } menu $name.m.help -tearoff $pd_tearoff $name.m add cascade -label Help -menu $name.m.help --- 939,945 ---- {} } ! menu $name.m.media -tearoff $pd_tearoff ! $name.m add cascade -label Media -menu $name.m.media ! $name.m add cascade -label Window -menu $name.m.windows menu $name.m.help -tearoff $pd_tearoff $name.m add cascade -label Help -menu $name.m.help *************** *** 1140,1151 **** proc get_font_size {} { global font ! set font(width) \ ! [font measure [format -*-courier-medium--normal--%d-* $font(size)] W] ! set font(height) \ ! [font metrics [format -*-courier-medium--normal--%d-* $font(size)] -linespace] ! puts "font width: $font(width) | font height: $font(height)" } - get_font_size #-----------------------------------------------------------------------------------# def object xy {canvas} { --- 1150,1160 ---- proc get_font_size {} { global font ! set fontstr [format -*-courier-medium--normal--%d-* $font(size)] ! set font(width) [font measure $fontstr W] ! set font(height) [font metrics $fontstr -linespace] ! # puts "font width: $font(width) | font height: $font(height)" } get_font_size + #-----------------------------------------------------------------------------------# def object xy {canvas} { *************** *** 1154,1160 **** return [list $@cx $@cy] } { - #set @cx [$canvas canvasx 30] - #set @cy [$canvas canvasy 30] - #don't delete these two lines set @cx 40; catch {set @cx $_($canvas_id:current_x)} --- 1163,1166 ---- *************** *** 1362,1371 **** #puts "$self:state -> $@state"
! set sx [expr ($font(width) * ($name_len+1) + $font(padx))] ! set sy [expr $font(height) + $font(pady)] if {[expr $_($self:isnew) == 1]} { ! brokenbox_draw $self $canvas $sx $sy 0 0 } { ! objectbox_draw $self $canvas $sx $sy 1 3 } } --- 1368,1377 ---- #puts "$self:state -> $@state"
! set _($self:sx) [expr ($font(width) * ($name_len+1) + $font(padx))] ! set _($self:sy) [expr $font(height) + $font(pady)] if {[expr $_($self:isnew) == 1]} { ! brokenbox_draw $self $canvas } { ! objectbox_draw $self $canvas } } *************** *** 1414,1420 **** puts "self:selection: [lindex $_($canvas_id:selection) 0]" #puts "set $self:isnew -> $@isnew" ! ! brokenbox_draw $self $canvas [expr $font(width) + $font(padx)] \ ! [expr $font(height) + $font(pady)] 0 0 text_create $self $canvas $font(size) "" } --- 1420,1426 ---- puts "self:selection: [lindex $_($canvas_id:selection) 0]" #puts "set $self:isnew -> $@isnew" ! set @sx [expr $font(width) + $font(padx)] ! set @sy [expr $font(height) + $font(pady)] ! brokenbox_draw $self $canvas text_create $self $canvas $font(size) "" } *************** *** 1950,1955 ****
proc pdtk_canvas_mouseup {canvas x y b} { - puts "pdtk_canvas_mouseup::: $canvas $x $y $b" - pdtk_canvas_mouseup2 $canvas $x $y $b statusbar_update [canvastosym $canvas] $x $y --- 1956,1959 ---- *************** *** 1958,1962 **** proc pdtk_canvas_mouseup2 {name x y b} { puts "pdtk_canvas_mouseup2::: $name $x $y $b" - global pdtk_canvas_mouseup wire_from wire_to _ font look offset_wire set canvas $name --- 1962,1965 ----