home *** CD-ROM | disk | FTP | other *** search
/ PC World 1998 October / PCWorld_1998-10_cd.bin / software / prehled / komix / DATA.Z / newvsfiled.tcl < prev    next >
Text File  |  1997-11-18  |  3KB  |  83 lines

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