home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / mtrxvdbobj.tcl < prev    next >
Text File  |  1996-11-22  |  4KB  |  156 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cadre Technologies Inc.    1996
  4. #
  5. #      File:           @(#)mtrxvdbobj.tcl    /main/hindenburg/2
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)mtrxvdbobj.tcl    /main/hindenburg/2   22 Nov 1996 Copyright 1996 Cadre Technologies Inc.
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14. require "filevobj.tcl"
  15.  
  16. Class MtrxVDbObj : {Matrix FileVObj} {
  17.     method destructor
  18.     constructor
  19.     method browserObjType
  20.     method canBeDragged
  21.     method editFile
  22.     method showFile
  23. }
  24.  
  25. method MtrxVDbObj::destructor {this} {
  26.     # Start destructor user section
  27.     # End destructor user section
  28.     $this FileVObj::destructor
  29. }
  30.  
  31. constructor MtrxVDbObj {class this name} {
  32.     set this [Matrix::constructor $class $this $name]
  33.     set this [FileVObj::constructor $class $this $name]
  34.     return $this
  35. }
  36.  
  37. selfPromoter Matrix {this} {
  38.     MtrxVDbObj promote $this
  39. }
  40.  
  41. proc MtrxVDbObj::associations {} {
  42.     return "[FileVObj::associations]"
  43. }
  44.  
  45. method MtrxVDbObj::browserObjType {this} {
  46.     return "MtrxVDbObj"
  47. }
  48.  
  49. method MtrxVDbObj::canBeDragged {this} {
  50.     if {"[$this getInfo Type]" == "dsm"} {
  51.     return 0
  52.     }
  53.     return [$this FileVObj::canBeDragged]
  54. }
  55.  
  56. proc MtrxVDbObj::childTypes {assoc} {
  57.     if {[lsearch -exact "[MtrxVDbObj::associations]" "$assoc"] == -1} {
  58.     return ""
  59.     }
  60.     return "[BrowserProcs::childTypes $assoc]"
  61. }
  62.  
  63. proc MtrxVDbObj::controlledLists {} {
  64.     return "[FileVObj::controlledLists]"
  65. }
  66.  
  67. proc MtrxVDbObj::infoProperties {} {
  68.     return "[FileVObj::infoProperties]"
  69. }
  70.  
  71. method MtrxVDbObj::editFile {this {confV ""} {phaseV ""} {sysV ""}} {
  72.     busy {
  73.     set file [$this file]
  74.     case "[$file type]" in {
  75.         {dsm} {
  76.         require "docstructd.tcl"
  77.         global classCount
  78.         incr classCount
  79.         set box .main.documentStructureDialog$classCount
  80.         DocStructDlg new $box $this \
  81.             -modal 1 \
  82.             -editable 1 \
  83.             -title "Edit Document Structure" \
  84.             -helpPressed {.main helpOnName documentStructureDialog}
  85.         $box popUp
  86.         }
  87.         {cdm} {
  88.         require "opencdmdlg.tcl"
  89.         set box .main.openCdm
  90.         OpenCdmDlg new $box \
  91.             -editable 1 \
  92.             -confV $confV \
  93.             -phaseV $phaseV \
  94.             -sysV $sysV \
  95.             -cdm $this
  96.         set popUpState [$box popUp]
  97.         if {! [lindex $popUpState 0]} {
  98.             $box delete
  99.             set message [lindex $popUpState 1]
  100.             if {"$message" != ""} {
  101.             wmtkerror $message
  102.             }
  103.         }
  104.         }
  105.         {default} {
  106.         set obj "[$file qualifiedName :].[$file type]"
  107.         wmtkerror "Don't know how to edit '$obj'"
  108.         }
  109.     }
  110.     }
  111. }
  112.  
  113. method MtrxVDbObj::showFile {this {confV ""} {phaseV ""} {sysV ""}} {
  114.     busy {
  115.     set file [$this file]
  116.     case "[$file type]" in {
  117.         {dsm} {
  118.         require "docstructd.tcl"
  119.         global classCount
  120.         incr classCount
  121.         set box .main.documentStructureDialog$classCount
  122.         DocStructDlg new $box $this \
  123.             -editable 0 \
  124.             -title "Show Document Structure" \
  125.             -helpPressed {.main helpOnName documentStructureDialog}
  126.         $box popUp
  127.         }
  128.         {cdm} {
  129.         require "opencdmdlg.tcl"
  130.         set box .main.openCdm
  131.         OpenCdmDlg new $box \
  132.             -editable 0 \
  133.             -confV $confV \
  134.             -phaseV $phaseV \
  135.             -sysV $sysV \
  136.             -cdm $this
  137.         set popUpState [$box popUp]
  138.         if {! [lindex $popUpState 0]} {
  139.             $box delete
  140.             set message [lindex $popUpState 1]
  141.             if {"$message" != ""} {
  142.             wmtkerror $message
  143.             }
  144.         }
  145.         }
  146.         {default} {
  147.         set obj "[$file qualifiedName :].[$file type]"
  148.         wmtkerror "Don't know how to show '$obj'"
  149.         }
  150.     }
  151.     }
  152. }
  153.  
  154. # Do not delete this line -- regeneration end marker
  155.  
  156.