home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / newvsfiled.tcl < prev    next >
Text File  |  1997-03-18  |  3KB  |  82 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cayenne Software Inc.    1997
  4. #
  5. #      File:           @(#)newvsfiled.tcl    /main/hindenburg/3
  6. #      Author:         <generated>
  7. #      Description:    VCM integration file
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)newvsfiled.tcl    /main/hindenburg/3   18 Mar 1997 Copyright 1997 Cayenne Software Inc.
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14. require "newextfvdi.tcl"
  15.  
  16. # General dialog for creation of vs files.
  17.  
  18. Class NewVSFileDialog : {NewExtFVDialog} {
  19.     constructor
  20.     method destructor
  21.     method checkcreateExtFile
  22.     attribute busy
  23. }
  24.  
  25. constructor NewVSFileDialog {class this name} {
  26.     set this [NewExtFVDialog::constructor $class $this $name]
  27.     # Start constructor user section
  28.     # End constructor user section
  29.     return $this
  30. }
  31.  
  32. method NewVSFileDialog::destructor {this} {
  33.     # Start destructor user section
  34.     # End destructor user section
  35.     $this NewExtFVDialog::destructor
  36. }
  37.  
  38.  
  39. # This method is redefined to check and create
  40. # vs Files.
  41. #
  42. method NewVSFileDialog::checkcreateExtFile {this} {
  43.     busy {
  44.         set type [$this.DC.ExtFVtypeTL selectedSet]
  45.         set name [$this.DC.ExtFVnameSLT text]
  46.  
  47.         # of type makefile, maketemplate, library/executable
  48.         # only one instance per system is allowed
  49.         case $type in {
  50.             {makefile maketemplate executable library} {
  51.                 set sysV [[ClientContext::global] currentSystem]
  52.                 foreach vsFile [$sysV vsFiles] {
  53.                         if {[$vsFile type] == $type} {
  54.                                 wmtkerror "$type already exists."
  55.                                 return ""
  56.                         }
  57.                 }
  58.  
  59.                 if {$type == "executable" || $type == "library"} {
  60.                         set tmpType executable
  61.                         if {$type == "executable"} {
  62.                                 set tmpType library
  63.                         }
  64.                         foreach vsFile [$sysV vsFiles] {
  65.                                 if {[$vsFile type] == $tmpType} {
  66.                                         wmtkerror "$tmpType already exists."
  67.                                         return ""
  68.                                 }
  69.                         }
  70.                 }
  71.                 if {$type == "makefile" || $type == "maketemplate"} {
  72.                         return [$this createVSFile $type $type]
  73.                 }
  74.             }
  75.         }
  76.     }
  77.     return [$this createVSFile $name $type]
  78. }
  79.  
  80. # Do not delete this line -- regeneration end marker
  81.  
  82.