[PD-cvs] pd/src desire.tk,1.1.2.280,1.1.2.281

chunlee chunlee at users.sourceforge.net
Wed Jul 5 12:02:05 CEST 2006


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

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
various fixes for messagebox, floatatom and pdrc_editor


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.280
retrieving revision 1.1.2.281
diff -C2 -d -r1.1.2.280 -r1.1.2.281
*** desire.tk	4 Jul 2006 16:25:35 -0000	1.1.2.280
--- desire.tk	5 Jul 2006 10:02:01 -0000	1.1.2.281
***************
*** 1419,1423 ****
  	#set @oldtext $@text
  	$self update_size
! 	$self changed
  	#--------------------------------------- label completion
  	#text $propose -height 1 -width [expr [string length $@text]+1] -relief flat \
--- 1419,1423 ----
  	#set @oldtext $@text
  	$self update_size
! 	#$self changed
  	#--------------------------------------- label completion
  	#text $propose -height 1 -width [expr [string length $@text]+1] -relief flat \
***************
*** 1937,1949 ****
  		set @selection {}
  		foreach item $dups {
! 		$item selected?= 0
! 		mset {x1 y1} [$item xy]
! 		if {$_($item:_class) == "Objectbox"} { 
! 		set name $_($item:text) } else {
! 		set name $_($item:class)
! 		}
! 		set @duplicating 1 
! 		pd .$self obj [expr $x1 + 15] [expr $y1 +15] $name
! 		#set dup_wires $_($item:wires)
  		}
  	
--- 1937,1959 ----
  		set @selection {}
  		foreach item $dups {
! 			$item selected?= 0
! 			mset {x1 y1} [$item xy]
! 			puts "dup class :::: $_($item:_class) :::: $_($item:class)"
! 			
! 			if {$_($item:_class) == "ObjectBox"} { 
! 			set name $_($item:text) 
! 			} else {
! 			set name $_($item:class)
! 			}
! 			set @duplicating 1 
! 			# not quite pretty, will rewrite when something better comes up
! 			switch $_($item:_class) {
! 			FloatAtom {pd .$self floatatom [expr $x1 + 15] [expr $y1 +15] $_($item:text)}
! 			SymbolAtom {pd .$self symbolatom [expr $x1 + 15] [expr $y1 +15]}
! 			MessageBox {pd .$self msg [expr $x1 + 15] [expr $y1 +15] $_($item:text)}
! 			default {pd .$self obj [expr $x1 + 15] [expr $y1 +15] $name}
! 			}
! 			
! 			#set dup_wires $_($item:wires)
  		}
  	
***************
*** 2703,2706 ****
--- 2713,2720 ----
  			set _($x:class) "msg"
  		}
+ 		if {$class == "floatatom"} {
+ 			set _($x:text) [lindex $d 4]
+ 			set _($x:class) "floatatom"
+ 		}
  		if {$class == "comment"} {
  			set _($x:text) [join [lrange $d 4 end]]
***************
*** 3245,3251 ****
  }
  
! def FloatAtom init {args} {
  	eval [concat [list super] $args]
! 	set @text 0
  }
  
--- 3259,3266 ----
  }
  
! def* FloatAtom init {args} {
  	eval [concat [list super] $args]
! 	#set @text 0
! 	pd .$self set $@text
  }
  
***************
*** 4522,4526 ****
--- 4537,4545 ----
  
  proc properties_dialog {self w ok struct} {
+     #puts "self::: $self"
+     #puts "w::: $w"
+     #puts "struct::: $struct"
      global _ key
+     set no_max_label 0
      foreach {name label type options} $struct {
  	set f $w.$name
***************
*** 4609,4612 ****
--- 4628,4667 ----
  		}
  	    }
+ 	    folders {
+ 	    	set no_max_label 1
+ 	    	frame $f
+ 		frame $f.a
+ 		pack [label $f.label -text $label -width 20 -anchor e] -side left
+ 		listbox $f.a.list -width 50 -height 5 -yscrollcommand "$f.a.yscroll set" \
+ 				-activestyle none -xscrollcommand "$f.a.xscroll set"
+ 		foreach line $_($self:$name) {$f.a.list insert end $line}
+ 		scrollbar $f.a.yscroll -command "$f.a.list yview"
+ 		scrollbar $f.a.xscroll -command "$f.a.list xview" -orient horizontal
+ 		
+ 		pack $f.a.xscroll -side bottom -fill x 
+ 		pack $f.a.list -side left -fill both -expand 1
+ 		pack $f.a.yscroll -side left -fill y
+ 		pack $f.a -side left
+ 				
+ 		frame $f.b -borderwidth 0
+ 		button $f.b.3 -command "$self dir_select $f.a.list" -text "add" -width 6
+ 		balloon $f.b.3 "click to select directory"
+ 		pack $f.b.3 -side top
+ 		
+ 		button $f.b.4 -command "$self dir_remove $f.a.list" -text "remove" -width 6
+ 		balloon $f.b.4 "click to select directory"
+ 		pack $f.b.4 -side top
+ 		
+ 		button $f.b.5 -command "$self dir_up $f.a.list" -text "up" -width 6
+ 		balloon $f.b.5 "click to select directory"
+ 		pack $f.b.5 -side top
+ 		
+ 		button $f.b.6 -command "$self dir_down $f.a.list" -text "down" -width 6
+ 		balloon $f.b.6 "click to select directory"
+ 		pack $f.b.6 -side top
+ 		
+ 		pack $f.b -side left
+ 		}
+ 	    
  	    default {
  		frame $f
***************
*** 4628,4638 ****
  			bind $f.entry <Button-5> "change_entry $f.entry -1"
  		    }
! 			folders {
! 			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
! 			}
  		    entry {}
  		    default {
--- 4683,4693 ----
  			bind $f.entry <Button-5> "change_entry $f.entry -1"
  		    }
! 		    #folders {
! 		#	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
! 		#	}	
  		    entry {}
  		    default {
***************
*** 4645,4649 ****
--- 4700,4706 ----
  	pack $f -side top -fill x
  	#catch {$f.label configure -width 45 -anchor e}
+ 	if {!$no_max_label} {
  	catch {$f.label configure -width $_($self:max_label) -anchor e}
+ 	}
      }
          
***************
*** 4809,4816 ****
  }
  
! def PagedDialog dir_select {entry} {
! 	set dir [tk_chooseDirectory -initialdir ~ -title "Choose a directory"]
! 	$entry delete 0 end
! 	$entry insert 0 $dir
  }
  
--- 4866,4902 ----
  }
  
! def PagedDialog dir_select {listbox} {
! 	set dir [tk_chooseDirectory -initialdir ~ -title "Choose a directory" -parent .$self]
! 	$listbox insert end $dir
! 	$listbox yview end
! 	focus .$self
! }
! 
! def PagedDialog dir_remove {listbox} {
! 	set sel [$listbox curselection]
! 	$listbox delete $sel
! 	$listbox selection set $sel
! }
! 
! def PagedDialog dir_up {listbox} {
! 	set sel [$listbox curselection]
! 	if {$sel > 0} {
! 	set line [$listbox get $sel]
! 	$listbox delete $sel
! 	$listbox insert [expr $sel - 1] $line
! 	$listbox selection set [expr $sel - 1]
! 	$listbox see [expr $sel - 1]
! 	}
! }
! 
! def PagedDialog dir_down {listbox} {
! 	set sel [$listbox curselection]
! 	if {$sel < [expr [$listbox size] - 1]} {
! 	set line [$listbox get $sel]
! 	$listbox delete $sel
! 	$listbox insert [expr $sel + 1] $line
! 	$listbox selection set [expr $sel + 1]
! 	$listbox see [expr $sel + 1]
! 	}
  }
  
***************
*** 4870,4882 ****
  
  section section_externals
-   folders -path
-   folders -helppath
    files -lib
  
  section section_gui
    void -nogui
    string -guicmd
    integer -console
-   folders -look
    void -statusbar
    integer -font
--- 4956,4970 ----
  
  section section_externals
    files -lib
  
+ section section_paths
+   folders -path
+   folders -helppath
+   folders -look
+   
  section section_gui
    void -nogui
    string -guicmd
    integer -console
    void -statusbar
    integer -font
***************
*** 4905,4909 ****
  def ServerPrefsDialog apply  {} {$self write}
  
! def ServerPrefsDialog read {} {
  	global pdrc_options pdrc_options_h cmdline
  	set fd [open $cmdline(rcfilename) "RDONLY CREAT"]
--- 4993,4997 ----
  def ServerPrefsDialog apply  {} {$self write}
  
! def* ServerPrefsDialog read {} {
  	global pdrc_options pdrc_options_h cmdline
  	set fd [open $cmdline(rcfilename) "RDONLY CREAT"]
***************
*** 4923,4927 ****
  	while {$i < [llength $contents]} {
  		set op [lindex $contents $i]
- 		puts "op=$op"
  		if {[string length $op]==0} {break}
  		if {![info exists pdrc_options_h($op)]} {
--- 5011,5014 ----
***************
*** 4989,4995 ****
  			[list [lindex $name 0] $babble choice {}]
  	    }
  	    default {
- 		#properties_dialog $self $f.main.$section ServerPrefsDialog_ok \
- 		#	[list $name "$name: [say $name]" $type {}]
  		properties_dialog $self $f.main.$section ServerPrefsDialog_ok \
  			[list $name [say $name] $type {}]
--- 5076,5084 ----
  			[list [lindex $name 0] $babble choice {}]
  	    }
+ 	    folders {
+ 	    	properties_dialog $self $f.main.$section ServerPrefsDialog_ok \
+ 			[list $name [say $name] $type {}]
+ 			}
  	    default {
  		properties_dialog $self $f.main.$section ServerPrefsDialog_ok \
  			[list $name [say $name] $type {}]





More information about the Pd-cvs mailing list