home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / readdiagra.tcl < prev    next >
Text File  |  1996-09-17  |  2KB  |  74 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Westmount Technology    1994
  4. #
  5. #      File:           @(#)readdiagra.tcl    /main/hindenburg/1
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)readdiagra.tcl    /main/hindenburg/1   17 Sep 1996 Copyright 1994 Westmount Technology
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14.  
  15. Class ReadDiagram : {ListDialog} {
  16.     constructor
  17.     method destructor
  18.     method popUp
  19.     method handleOk
  20.     attribute filevList
  21.     attribute fileNameList
  22.     attribute editor
  23. }
  24.  
  25. constructor ReadDiagram {class this name} {
  26.     set this [ListDialog::constructor $class $this $name]
  27.     # Start constructor user section
  28.     $this config -okPressed {%this handleOk} \
  29.              -helpPressed {.main helpOnName selectOne} \
  30.              -selectionPolicy BROWSE \
  31.              -rowCount 10 \
  32.              -message "Select diagram to read:" \
  33.              -title "Read Diagram"
  34.     # End constructor user section
  35.     return $this
  36. }
  37.  
  38. method ReadDiagram::destructor {this} {
  39.     # Start destructor user section
  40.     # End destructor user section
  41. }
  42.  
  43. method ReadDiagram::popUp {this} {
  44.     set ed [$this editor]
  45.     set sysV [$ed systemVersion]
  46.     set type [$ed diagramType]
  47.     set fileVersions [$sysV localFileVersions]
  48.     set myTypeFileList ""
  49.     set myTypeNameList ""
  50.     foreach fv $fileVersions {
  51.         if {[[$fv file] type] == "$type"} {
  52.             lappend myTypeFileList $fv
  53.             lappend myTypeNameList [[$fv file] qualifiedName :]
  54.         }
  55.     }
  56.     $this filevList $myTypeFileList
  57.     $this fileNameList $myTypeNameList
  58.     $this entrySet [lsort $myTypeNameList]
  59.     $this ListDialog::popUp
  60. }
  61.  
  62. method ReadDiagram::handleOk {this} {
  63.     set index [lsearch -exact \
  64.         [$this fileNameList] [lindex [$this selectedSet] 0]]
  65.     if {$index == -1} {
  66.         return
  67.     } else {
  68.         [$this editor] doRead [lindex [$this filevList] $index]
  69.     }
  70. }
  71.  
  72. # Do not delete this line -- regeneration end marker
  73.  
  74.