Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10354
Modified Files: Tag: devel_0_39 desire.tk Log Message: wrap labels in Dialogs
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.561 retrieving revision 1.1.2.562 diff -C2 -d -r1.1.2.561 -r1.1.2.562 *** desire.tk 18 Nov 2006 23:12:22 -0000 1.1.2.561 --- desire.tk 19 Nov 2006 01:24:24 -0000 1.1.2.562 *************** *** 40,45 **** package require poe package require bgerror - #package require profiler - #catch {package require Tclx} #if {[catch {source profile_dd.tcl}]} {error_dump} --- 40,43 ---- *************** *** 393,396 **** --- 391,395 ---- # very small icons: foreach {name w h values} { + icon_empty 7 7 "0,0,0,0,0,0,0" icon_plus 7 7 "8,8,8,127,8,8,8" icon_minus 7 7 "0,0,0,127,0,0,0" *************** *** 4510,4517 **** } set @class $_($of:class) - foreach prop $fields($class) { - set label [say $prop] - if {[string length $label] > $@max_label} {set @max_label [string length $label]} - } foreach prop [lrange $fields($class) 5 end] { set d [concat $prop [switch $prop { --- 4509,4512 ---- *************** *** 4566,4573 **** set @xmargin 0; set @ymargin 0 } - foreach prop $@properties { - set label [say $prop] - if {[string length $label] > $@max_label} {set @max_label [string length $label]} - } $self add .$self [list gop toggle -command "$self gop_setting"] for {set i 1} {$i<[llength $@properties]} {incr i} { --- 4561,4564 ---- *************** *** 6156,6162 **** class_new Dialog {Thing}
! def Dialog add_side {f name label} { frame $f ! pack [label $f.label -text $label] -side left frame $f.side -relief ridge -borderwidth 2 foreach {i side} {0 left 1 right 2 top 3 bottom} { --- 6147,6162 ---- class_new Dialog {Thing}
! def Dialog add_stuff {f name label} { frame $f ! # frame $f.label -width $@label_width -borderwidth 2 ! # pack [button $f.label.0 -image "icon_empty" -width $@label_width] -side left ! # place [message $f.label.1 -text $label -width $@label_width] -x 0 -y 0 ! # puts [$f.label.1 cget -height] ! pack [label $f.label -text $label -width [expr $@label_width/7] -wraplength $@label_width] -side left ! balloon $f.label $name ! } ! ! def Dialog add_side {f name label} { ! $self add_stuff $f $name $label frame $f.side -relief ridge -borderwidth 2 foreach {i side} {0 left 1 right 2 top 3 bottom} { *************** *** 6171,6177 ****
def Dialog add_color {f name label} { set v $_($self:$name) ;# bug in poetcl - frame $f - label $f.label -text $label set text_color [complement $v] button $f.color -text $v -font {Courier 10} -width 10 -pady 2 -fg $text_color \ --- 6171,6176 ----
def Dialog add_color {f name label} { + $self add_stuff $f $name $label set v $_($self:$name) ;# bug in poetcl set text_color [complement $v] button $f.color -text $v -font {Courier 10} -width 10 -pady 2 -fg $text_color \ *************** *** 6181,6191 **** -command [list $self color_popup $f $name 10] bind $f.preset <Return> "$self color_popup $f $name 10" ! pack $f.label $f.color $f.preset -side left }
def Dialog add_choice {f name label choices options} { set v $_($self:$name) ;# bug in poetcl - frame $f - label $f.label -text $label menu $f.menu -tearoff 0 set i 0 --- 6180,6189 ---- -command [list $self color_popup $f $name 10] bind $f.preset <Return> "$self color_popup $f $name 10" ! pack $f.color $f.preset -side left }
def Dialog add_choice {f name label choices options} { + $self add_stuff $f $name $label set v $_($self:$name) ;# bug in poetcl menu $f.menu -tearoff 0 set i 0 *************** *** 6203,6207 ****
def Dialog add_key {f name label} { - frame $f set text "" set n 0 --- 6201,6204 ---- *************** *** 6210,6214 **** incr n } ! pack [label $f.label -text $text] -side left #balloon $f.label $name foreach item $name { --- 6207,6211 ---- incr n } ! $self add_stuff $f $name $text #balloon $f.label $name foreach item $name { *************** *** 6224,6232 ****
def Dialog add_folders {f name label} { set v $_($self:$name) ;# bug in poetcl - frame $f frame $f.a ! pack [label $f.label -text $label -width 20 -anchor e] -side left ! listbox $f.a.list -width 50 -height 8 -yscrollcommand "$f.a.yscroll set" \ -activestyle none -xscrollcommand "$f.a.xscroll set" foreach line $v {$f.a.list insert end $line} --- 6221,6228 ----
def Dialog add_folders {f name label} { + $self add_stuff $f $name $label set v $_($self:$name) ;# bug in poetcl frame $f.a ! listbox $f.a.list -width 40 -height 8 -yscrollcommand "$f.a.yscroll set" \ -activestyle none -xscrollcommand "$f.a.xscroll set" foreach line $v {$f.a.list insert end $line} *************** *** 6247,6255 ****
def Dialog add_libraries {f name label} { set v $_($self:$name) ;# bug in objtcl - frame $f frame $f.a ! pack [label $f.label -text $label -width 20 -anchor e] -side left ! listbox $f.a.list -width 33 -height 10 -yscrollcommand "$f.a.yscroll set" \ -activestyle none -xscrollcommand "$f.a.xscroll set" #foreach line $@$name {$f.a.list insert end $line} --- 6243,6250 ----
def Dialog add_libraries {f name label} { + $self add_stuff $f $name $label set v $_($self:$name) ;# bug in objtcl frame $f.a ! listbox $f.a.list -width 32 -height 10 -yscrollcommand "$f.a.yscroll set" \ -activestyle none -xscrollcommand "$f.a.xscroll set" #foreach line $@$name {$f.a.list insert end $line} *************** *** 6328,6332 ****
def Dialog add {w args} { - set no_max_label 0 foreach row $args { set name [lindex $row 0] --- 6323,6326 ---- *************** *** 6349,6368 **** key {set f $w.[string tolower [lindex $name 0]] $self add_key $f $name $label} ! folders {$self add_folders $f $name $label; set no_max_label 1} ! libraries {$self add_libraries $f $name $label; set no_max_label 1} section {label $f -text $label -bg "#0000aa" -fg "#ffff55" -font {helvetica -10 bold}} subsection {label $f -text $label -bg "#0000aa" -fg "#ffff55" -font {helvetica -10 bold}} toggle { ! frame $f ! label $f.label -text $label ! eval "checkbutton $f.toggle -variable @$name $options" ! pack $f.label -side left pack $f.toggle -side left } default { ! frame $f ! pack [label $f.label -text $label] -side left ! balloon $f.label $name ! eval "entry $f.entry -textvariable _($self:$name) $options" pack $f.entry -side left bind $f.entry <Return> "$self ok" --- 6343,6358 ---- key {set f $w.[string tolower [lindex $name 0]] $self add_key $f $name $label} ! folders {$self add_folders $f $name $label} ! libraries {$self add_libraries $f $name $label} section {label $f -text $label -bg "#0000aa" -fg "#ffff55" -font {helvetica -10 bold}} subsection {label $f -text $label -bg "#0000aa" -fg "#ffff55" -font {helvetica -10 bold}} toggle { ! $self add_stuff $f $name $label ! eval [concat [list checkbutton $f.toggle -variable @$name] $options] pack $f.toggle -side left } default { ! $self add_stuff $f $name $label ! eval [concat [list entry $f.entry -textvariable _($self:$name)] $options] pack $f.entry -side left bind $f.entry <Return> "$self ok" *************** *** 6386,6392 **** } pack $f -side top -fill x - if {!$no_max_label} { - catch {$f.label configure -width $@max_label -anchor e} - } } } --- 6376,6379 ---- *************** *** 6404,6408 **** global look if {[winfo exists $f.font]} {return} - set no_max_label 0 bind all <KeyPress-F1> help set font $look(View:font) --- 6391,6394 ---- *************** *** 6571,6575 **** super set f .$self ! set @max_label 0 toplevel $f frame $f.buttonsep -height 2 -borderwidth 1 -relief sunken --- 6557,6561 ---- super set f .$self ! set @label_width 160 ;# 20 toplevel $f frame $f.buttonsep -height 2 -borderwidth 1 -relief sunken *************** *** 6723,6735 **** }
- # warning: still unimplemented - set pdrc_trickier_aliases { - -audiodev|-sounddev {-soundindev %1 -soundoutdev %1} - -channels {-inchannels %1 -outchannels %1} - -noaudio|-nosound {-nodac -noadc} - -nomidi {-nomidiin -nomidiout} - -mididev {-midindev %1 -midioutdev %1} - } - class_new ServerPrefsDialog {PagedDialog} def ServerPrefsDialog apply {} {$self write} --- 6709,6712 ---- *************** *** 6744,6747 **** --- 6721,6738 ---- }
+ def ServerPrefsDialog read_one {type name contents i} { + global pdrc_options_h + switch -- $type { + folders {incr i; lappend @$name [lindex $contents $i]} + libraries {incr i; lappend @$name [lindex $contents $i]} + files {incr i; lappend @$name [lindex $contents $i]} + choice { set @$name [lsearch $name [lindex $contents $i]]} + void { set @$name 1} + default {incr i; set @$name [lindex $contents $i]} + } + incr i + return $i + } + def ServerPrefsDialog read {} { global pdrc_options pdrc_options_h cmdline *************** *** 6760,6774 **** if {![info exists pdrc_options_h($op)]} { post "unknown option: %s" $op } mset {type name} $pdrc_options_h($op) ! switch $type { ! folders {incr i; lappend @$name [lindex $contents $i]} ! libraries {incr i; lappend @$name [lindex $contents $i]} ! files {incr i; lappend @$name [lindex $contents $i]} ! choice { set @$name [lsearch $name [lindex $contents $i]]} ! void { set @$name 1} ! default {incr i; set @$name [lindex $contents $i]} ! } ! incr i } } --- 6751,6764 ---- if {![info exists pdrc_options_h($op)]} { post "unknown option: %s" $op + incr i + continue } + #{dual -soundindev -soundoutdev} -audiodev|-sounddev + #{dual -inchannels -outchannels} -channels + #{dual -nodac -noadc} -noaudio|-nosound + #{dual -nomidiin -nomidiout} -nomidi + #{dual -midindev -midioutdev} -mididev mset {type name} $pdrc_options_h($op) ! set i [$self read_one $type $name $contents $i] } } *************** *** 6806,6818 **** set section 0
! foreach {type names} $pdrc_options { ! set label "" ! if {[llength $names] > 1} { ! set label [say [lindex $names 0]] ! } else { ! set label [say [lindex [split $names |] 0]] ! } ! if {[string length $label] > $@max_label} {set @max_label [string length $label]} ! } foreach {type names} $pdrc_options { set name [lindex $names 0] --- 6796,6800 ---- set section 0
! set @label_width 200 ;# 24 foreach {type names} $pdrc_options { set name [lindex $names 0] *************** *** 6992,7005 **** set section 0 set subsection 0 ! ! foreach {type class names} $ddrc_options { ! set label "" ! if {[llength $names] > 1} { ! foreach name $names {set str [string tolower $class$name]; append label " [say $str]"} ! } else { ! set label [say [string tolower $class$names]] ! } ! if {[string length $label] > $@max_label} {set @max_label [expr [string length $label]+20]; puts "$label"} ! } foreach {type class names} $ddrc_options { --- 6974,6979 ---- set section 0 set subsection 0 ! ! set @label_width 200 ;# 24 foreach {type class names} $ddrc_options {