Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23440
Modified Files: Tag: devel_0_39 desire.c desire.tk Log Message: fixed titlebars. removed canvas(file), canvas(directory).
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.445 retrieving revision 1.1.2.446 diff -C2 -d -r1.1.2.445 -r1.1.2.446 *** desire.tk 1 Sep 2006 14:39:53 -0000 1.1.2.445 --- desire.tk 1 Sep 2006 18:42:46 -0000 1.1.2.446 *************** *** 315,319 **** set err [catch {uplevel 2 $code}] if {$err} {set err $errorInfo} ! set atom $undo_q set @undo_q $ubackup set @redo_q $rbackup --- 315,319 ---- set err [catch {uplevel 2 $code}] if {$err} {set err $errorInfo} ! set atom $@undo_q set @undo_q $ubackup set @redo_q $rbackup *************** *** 672,677 **** post "f='$f' ff='$ff' ffl='$ffl'" pd pd open $file $dir - set canvas(file) $file - set canvas(directory) $dir } } { --- 672,675 ---- *************** *** 749,757 ****
set untitled_number 1 ! set untitled_directory [pwd]
def Client new_file {} { ! global untitled_number untitled_directory ! pd pd filename Untitled-$untitled_number $untitled_directory pd {#N canvas; #X pop 1} incr untitled_number --- 747,755 ----
set untitled_number 1 ! set untitled_folder [pwd]
def Client new_file {} { ! global untitled_number untitled_folder ! pd pd filename Untitled-$untitled_number $untitled_folder pd {#N canvas; #X pop 1} incr untitled_number *************** *** 774,784 **** global pd_opendir font canvas set i [string last / $filename] ! set directory [string range $filename 0 [expr $i-1]] ! set pd_opendir $directory set basename [string range $filename [expr $i+1] end] if {[string last .pd $filename] >= 0} { ! pd pd open [enquote $basename] [enquote $directory] ! set canvas(file) [enquote $basename] ! set canvas(directory) [enquote $directory] } } --- 772,780 ---- global pd_opendir font canvas set i [string last / $filename] ! set folder [string range $filename 0 [expr $i-1]] ! set pd_opendir $folder set basename [string range $filename [expr $i+1] end] if {[string last .pd $filename] >= 0} { ! pd pd open [enquote $basename] [enquote $folder] } } *************** *** 1127,1133 ****
def Canvas save {} { $self checkgeometry ! if {[string length $@file]} { ! pd .$self savetofile $@file $@directory } else { $self save_as --- 1123,1130 ----
def Canvas save {} { + if {$@subpatch} {return [$@canvas save]} $self checkgeometry ! if {$@file != ""} { ! pd .$self savetofile $@name $@folder } else { $self save_as *************** *** 1140,1147 **** set filename [tk_getSaveFile -filetypes $patch_filetypes] if {$filename != ""} { ! set @file [string range $filename [expr [string last / $filename]+1] end] ! set @directory [string range $filename 0 [expr [string last / $filename]-1]] ! puts "save $@file dir to $@directory" ! pd .$self savetofile $@file $@directory } } --- 1137,1144 ---- set filename [tk_getSaveFile -filetypes $patch_filetypes] if {$filename != ""} { ! set @file [string range $filename [expr [string last / $filename]+1] end] ! set @folder [string range $filename 0 [expr [string last / $filename]-1]] ! puts "save $@file dir to $@folder" ! pd .$self savetofile $@file $@folder } } *************** *** 1256,1259 **** --- 1253,1258 ---- lappend window_list $self set @mapped 0 + set @name "" + set @folder "???" super {#X obj 666 666 pd} ;# bogus $self reinit $mess *************** *** 1277,1288 **** #set @wire_hilite {} set @history $history - if {[info exists canvas(file)]} { - set @file $canvas(file) - unset canvas(file) - } else {set @file ""} - if {[info exists canvas(directory)]} { - set @directory $canvas(directory) - unset canvas(directory) - } else {set @directory ""} $self update_title $self subscribe $manager --- 1276,1279 ---- *************** *** 1810,1818 ****
#-----------------------------------------------------------------------------------# ! def Canvas title= {title} {wm title .$self $title} ! def Canvas update_title {} { ! set t "$@directory/$@file" if {[$self modified?]} {append t "(*)"} ! $self title= $t }
--- 1801,1823 ----
#-----------------------------------------------------------------------------------# ! def Canvas name= {name} {set @name $name ; $self update_title} ! def Canvas folder= {folder} {set @folder $folder; $self update_title} ! def Canvas make_title {} { ! if {$@subpatch} { ! if {$@canvas == "" || 0==[string compare $@canvas $self]} { ! set t "(uh)" ! } else { ! set t [$@canvas make_title] ! } ! set t "subpatch '$@name' of $t" ! } else { ! set t "$@name in $@folder" ! } if {[$self modified?]} {append t "(*)"} ! return $t ! } ! ! def Canvas update_title {} { ! wm title .$self [$self make_title] }
*************** *** 2234,2238 ****
def Canvas cut {} { ! $@history atomically { $self copy $self delete_selection --- 2239,2243 ----
def Canvas cut {} { ! $@history atomically "Cut" { $self copy $self delete_selection *************** *** 2294,2299 ****
def Canvas end_action {} { ! $@action delete ! set @action "none" }
--- 2299,2306 ----
def Canvas end_action {} { ! switch -- $@action { ! none {post "ending action 'none' makes no sense"} ! default {$@action delete; set @action "none"} ! } }
*************** *** 3474,3481 **** pack [checkbutton .$self.graphme -text "graph on parent" \ -variable @graphme -anchor w] -side top ! #bind .$self.yscale.entry <KeyPress-Return> "canvas_ok $id" ! .$self.xscale.entry select from 0 ! .$self.xscale.entry select adjust end ! focus .$self.xscale.entry }
--- 3481,3489 ---- pack [checkbutton .$self.graphme -text "graph on parent" \ -variable @graphme -anchor w] -side top ! set e .$self.xscale.entry ! #bind $e <KeyPress-Return> "canvas_ok $id" ! $e select from 0 ! $e select adjust end ! focus $e }
*************** *** 4499,4503 **** pack [spinbox $bb.scale -width 6 -command "$canvas zooming %d" -state readonly] -side right $bb.scale set [format %d%% [expr int(100*[$@canvas zoom])]] ! $bb.name insert 0 .$@canvas }
--- 4507,4511 ---- pack [spinbox $bb.scale -width 6 -command "$canvas zooming %d" -state readonly] -side right $bb.scale set [format %d%% [expr int(100*[$@canvas zoom])]] ! $bb.name insert 0 $@canvas }
*************** *** 5122,5126 **** # frame $f.b -borderwidth 0 # button $f.b.3 -command "$self dir_select $f.entry" -text "open" ! # balloon $f.b.3 "click to select directory" # pack $f.b.3 -side top # pack $f.b -side left --- 5130,5134 ---- # frame $f.b -borderwidth 0 # button $f.b.3 -command "$self dir_select $f.entry" -text "open" ! # balloon $f.b.3 "click to select folder" # pack $f.b.3 -side top # pack $f.b -side left *************** *** 5427,5431 ****
def PagedDialog dir_select {listbox} { ! set dir [tk_chooseDirectory -initialdir ~ -title "Choose a directory" -parent .$self] if {$dir == ""} {return} $listbox insert end $dir --- 5435,5439 ----
def PagedDialog dir_select {listbox} { ! set dir [tk_chooseDirectory -initialdir ~ -title "Choose a folder" -parent .$self] if {$dir == ""} {return} $listbox insert end $dir *************** *** 6173,6177 **** pack [listbox .$self.list -yscrollcommand ".$self.scroll set" -width 72 ] -side left -fill both -expand yes ! pack [scrollbar .$self.scroll -command ".$self.text yview"] -side right -fill y $@history subscribe $self $self notice --- 6181,6185 ---- pack [listbox .$self.list -yscrollcommand ".$self.scroll set" -width 72 ] -side left -fill both -expand yes ! pack [scrollbar .$self.scroll -command ".$self.list yview"] -side right -fill y $@history subscribe $self $self notice
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.128 retrieving revision 1.1.2.129 diff -C2 -d -r1.1.2.128 -r1.1.2.129 *** desire.c 1 Sep 2006 17:55:58 -0000 1.1.2.128 --- desire.c 1 Sep 2006 18:42:45 -0000 1.1.2.129 *************** *** 412,416 ****
void canvas_rename(t_canvas *x, t_symbol *s, t_symbol *dir) { - post("canvas_rename"); if (strcmp(x->gl_name->s_name, "Pd")) pd_unbind(&x->gl_pd, canvas_makebindsym(x->gl_name)); x->gl_name = s; --- 412,415 ---- *************** *** 4505,4522 **** void canvas_reload(t_symbol *name, t_symbol *dir, t_gobj *except);
! /* save a "root" canvas to a file; cf. canvas_saveto() which saves the ! body (and which is called recursively.) */ ! static void canvas_savetofile(t_canvas *x, t_symbol *filename, t_symbol *dir) ! { t_binbuf *b = binbuf_new(); ! int dsp_status = canvas_suspend_dsp(); canvas_savetemplatesto(x, b, 1); canvas_saveto(x, b); ! if (binbuf_write(b, filename->s_name, dir->s_name, 0)) sys_ouch(); ! else ! { ! /* if not an abstraction, reset title bar and directory */ ! if (!x->gl_owner) ! canvas_rename(x, filename, dir); post("saved to: %s/%s", dir->s_name, filename->s_name); canvas_dirty(x, 0); --- 4504,4519 ---- void canvas_reload(t_symbol *name, t_symbol *dir, t_gobj *except);
! /* save a "root" canvas to a file; cf. canvas_saveto() which saves the ! body (and which is called recursively.) */ ! static void canvas_savetofile(t_canvas *x, t_symbol *filename, t_symbol *dir) { t_binbuf *b = binbuf_new(); ! int dsp_status = canvas_suspend_dsp(); canvas_savetemplatesto(x, b, 1); canvas_saveto(x, b); ! if (binbuf_write(b, filename->s_name, dir->s_name, 0)) { ! sys_ouch(); ! } else { ! /* if not an abstraction, reset title bar and directory */ ! if (!x->gl_owner) canvas_rename(x, filename, dir); post("saved to: %s/%s", dir->s_name, filename->s_name); canvas_dirty(x, 0); *************** *** 4524,4528 **** } binbuf_free(b); ! canvas_resume_dsp(dsp_status); }
--- 4521,4525 ---- } binbuf_free(b); ! canvas_resume_dsp(dsp_status); }
*************** *** 9271,9286 **** char foo[4096]; char *bar; t_linetraverser t; t_outconnect *oc; t_gobj *y; bar=foo; *foo=0; ! linetraverser_start(&t,(t_canvas *)self); ! glist_each(y,(t_canvas *)self) bar+=sprintf(bar,"x%lx ",(long)y); sys_mgui((t_gobj *)self,"children=","S",foo); bar=foo; *foo=0; while((oc = linetraverser_next(&t))) bar+=sprintf(bar,"{%ld %ld %ld %ld} ", ! (long)canvas_getindex((t_canvas *)self,(t_gobj *)t.tr_ob), (long)t.tr_outno, ! (long)canvas_getindex((t_canvas *)self,(t_gobj *)t.tr_ob2), (long)t.tr_inno); sys_mgui((t_gobj *)self,"wires=","S",foo); } } --- 9268,9286 ---- char foo[4096]; char *bar; + t_canvas *can = (t_canvas *)self; t_linetraverser t; t_outconnect *oc; t_gobj *y; bar=foo; *foo=0; ! linetraverser_start(&t,can); ! glist_each(y,can) bar+=sprintf(bar,"x%lx ",(long)y); sys_mgui((t_gobj *)self,"children=","S",foo); bar=foo; *foo=0; while((oc = linetraverser_next(&t))) bar+=sprintf(bar,"{%ld %ld %ld %ld} ", ! (long)canvas_getindex(can,(t_gobj *)t.tr_ob), (long)t.tr_outno, ! (long)canvas_getindex(can,(t_gobj *)t.tr_ob2), (long)t.tr_inno); sys_mgui((t_gobj *)self,"wires=","S",foo); + sys_mgui(self,"name=","s",can->gl_name); + sys_mgui(self,"folder=","s",canvas_getenv(can)->ce_dir); } }