Diff for /capa/capa51/GUITools/common.tcl between versions 1.4 and 1.7

version 1.4, 1999/12/16 22:18:35 version 1.7, 2000/01/31 18:34:13
Line 1428  proc pickSections { sectionsToPickFrom { Line 1428  proc pickSections { sectionsToPickFrom {
 }  }
   
 ###########################################################  ###########################################################
   # pickSets
   ###########################################################
   ###########################################################
   ###########################################################
   proc pickSets { setsToPickFrom mode {title "Select Sets"} {window ""}} {
       global gPromptPSets
       
       if { $setsToPickFrom == "" } { 
    displayMessage "No available sets."
    return "Cancel" 
       }
       set dialog [toplevel $window.pickSets -borderwidth 10]
       wm title $dialog "Which Sets"
   
       set infoFrame [frame $dialog.info ]
       set setListFrame [frame $dialog.list  -relief groove -borderwidth 5]
       set buttonFrame [frame $dialog.buttons -bd 10]
       pack $infoFrame $setListFrame $buttonFrame -side top -fill x
       
       message $infoFrame.msg -text $title -aspect 5000
       pack $infoFrame.msg
   
       set headerFrame [frame $setListFrame.head ]
       set listboxFrame [frame $setListFrame.listboxframe]
       pack $headerFrame $listboxFrame -side top 
       pack configure $headerFrame -anchor w
   
       message $headerFrame.msg -text "Set #" -aspect 5000
       pack $headerFrame.msg
   
       set setList [ listbox $listboxFrame.list \
                  -yscrollcommand "$listboxFrame.scroll set" \
                  -width 30 -height 10 -selectmode $mode ]
       scrollbar $listboxFrame.scroll \
                   -command "$listboxFrame.list yview" \
                   -orient v
       pack $setList $listboxFrame.scroll -side left
       pack configure $listboxFrame.scroll -fill y      
   
       foreach set $setsToPickFrom {
    $setList insert end [format "%3d" $set]
       }
   
       button $buttonFrame.yes -text Continue -command {set gPromptPSets(yes) 1} \
       -underline 0
       frame $buttonFrame.spacer -width 10
       button $buttonFrame.selectall -text "SelectAll" -command \
    "$setList selection set 0 end"
       button $buttonFrame.cancel -text Cancel -command { set gPromptPSets(yes) 0 } \
       -underline 0
       bind $dialog <Destroy> "set gPromptPSets(yes) 0"
       bind $dialog <Double-1> "set gPromptPSets(yes) 1"
   
       if { $mode == "single" } {
    pack $buttonFrame.yes $buttonFrame.cancel -side left
       } else {
    pack $buttonFrame.yes $buttonFrame.spacer \
       $buttonFrame.selectall $buttonFrame.cancel -side left
       }
       
       bind $dialog <Alt-Key> break
       
       Centre_Dialog $dialog default
       update
       
       focus $dialog
       capaRaise $dialog
       capaGrab $dialog
       vwait gPromptPSets(yes)
       capaGrab release $dialog
       bind $dialog <Destroy> ""
       if {$gPromptPSets(yes)} {
    set selectionList [ $setList curselection ]
    set setsToDo ""
    foreach selection $selectionList {
       lappend setsToDo [string trim [lindex [$setList get $selection] 0]]
    }
    destroy $dialog
    return $setsToDo
       } else {
    destroy $dialog
    return Cancel
       }
   }
   
   ###########################################################
 # getSet  # getSet
 ###########################################################  ###########################################################
 ###########################################################  ###########################################################
Line 1554  proc lunique __LIST { Line 1640  proc lunique __LIST {
     }      }
 }  }
   
   ###########################################################
   # lreverse
   ###########################################################
   proc lreverse list { 
       set result ""
       foreach element $list { set result [linsert $result 0 $element] } 
       return [concat $result]
   }
   
 proc splitline { line maxLength } {  proc splitline { line maxLength } {
     set length [string length $line]      set length [string length $line]
     set lines [expr $length/$maxLength + 1]      set lines [expr $length/$maxLength + 1]

Removed from v.1.4  
changed lines
  Added in v.1.7


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>