home *** CD-ROM | disk | FTP | other *** search
/ PC World 1998 October / PCWorld_1998-10_cd.bin / software / prehled / komix / DATA.Z / menudefine.tcl < prev    next >
Text File  |  1997-10-23  |  4KB  |  149 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cayenne Software Inc.    1997
  4. #
  5. #      File:           @(#)menudefine.tcl    /main/titanic/2
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)menudefine.tcl    /main/titanic/2   23 Oct 1997 Copyright 1997 Cayenne Software Inc.
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14. require "defstoredi.tcl"
  15.  
  16. Class MenuDefineDialog : {DefStoreDialog} {
  17.     constructor
  18.     method destructor
  19.     method createInterface
  20.     method clearInterface
  21.     method sensitive
  22.     method save
  23.     method objVisible
  24. }
  25.  
  26. constructor MenuDefineDialog {class this name} {
  27.     set this [DefStoreDialog::constructor $class $this $name]
  28.     # Start constructor user section
  29.     $this helpPressed \
  30.         ".main helpOnName menuProp\[\[$this currentPage] label]Page"
  31.     # End constructor user section
  32.     return $this
  33. }
  34.  
  35. method MenuDefineDialog::destructor {this} {
  36.     # Start destructor user section
  37.     # End destructor user section
  38.     $this DefStoreDialog::destructor
  39. }
  40.  
  41. method MenuDefineDialog::createInterface {this} {
  42.  
  43.     $this DefStoreDialog::createInterface
  44.  
  45.     # add the visibility stuff
  46.  
  47.     interface NamedGroup [$this sPage].visibleNG {
  48.         verStretchFactor 0
  49.         label Visible
  50.         DlgColumn DC {
  51.             CheckButton corporateCB { label Corporate}
  52.             CheckButton projectCB { label Project}
  53.             CheckButton configCB { label Configuration}
  54.             CheckButton phaseCB { label Phase}
  55.             CheckButton systemCB { label System}
  56.         }
  57.     }
  58. }
  59.  
  60. method MenuDefineDialog::clearInterface {this} {
  61.  
  62.     $this DefStoreDialog::clearInterface
  63.  
  64.     [$this sPage].visibleNG.DC.corporateCB state 1
  65.     [$this sPage].visibleNG.DC.projectCB state 1
  66.     [$this sPage].visibleNG.DC.configCB state 1
  67.     [$this sPage].visibleNG.DC.phaseCB state 1
  68.     [$this sPage].visibleNG.DC.systemCB state 1
  69.  
  70. }
  71.  
  72. method MenuDefineDialog::sensitive {this args} {
  73.     
  74.     $this DefStoreDialog::sensitive $args
  75.  
  76.     if {[llength $args] == 0} {
  77.             return [[$this sPage].visibleNG.DC.corporateCB sensitive]
  78.     } else {
  79.         set sensitive [lindex $args 0]
  80.     }
  81.  
  82.     [$this sPage].visibleNG.DC.corporateCB sensitive $sensitive
  83.     [$this sPage].visibleNG.DC.projectCB sensitive $sensitive
  84.     [$this sPage].visibleNG.DC.configCB sensitive $sensitive
  85.     [$this sPage].visibleNG.DC.phaseCB sensitive $sensitive
  86.     [$this sPage].visibleNG.DC.systemCB sensitive $sensitive
  87.  
  88.     return $sensitive
  89. }
  90.  
  91. method MenuDefineDialog::save {this popDown} {
  92.  
  93.     if {![[$this curObject] editable]} {
  94.         if {$popDown == 1} {
  95.             $this popDown
  96.         }
  97.         return
  98.     }
  99.  
  100.     set newLevel [$this determineSpecLevel [$this objScope]]
  101.     
  102.     set error [[$this curObject] check [$this objScope] [$this objVisible]\
  103.                     $newLevel [[$this curObject] parent]]
  104.     if {$error != ""} {
  105.         wmtkerror "$error : object not saved"
  106.     } else {
  107.         if {[$this DefineDialog::save $popDown] == 1} {
  108.             # reset redefined attribute
  109.             [$this curObject] redefined 0
  110.         }
  111.     }
  112. }
  113.  
  114. method MenuDefineDialog::objVisible {this args} {
  115.     
  116.     if {$args == ""} {
  117.         set vis "[[$this sPage].visibleNG.DC.corporateCB state]"
  118.         set vis "$vis [[$this sPage].visibleNG.DC.projectCB state]"
  119.         set vis "$vis [[$this sPage].visibleNG.DC.configCB state]"
  120.         set vis "$vis [[$this sPage].visibleNG.DC.phaseCB state]"
  121.         set vis "$vis [[$this sPage].visibleNG.DC.systemCB state]"
  122.         return $vis
  123.     } else {
  124.         set count 0
  125.         set args [lvarpop args]
  126.         foreach i $args {
  127.             if {$count == 0} {
  128.                 [$this sPage].visibleNG.DC.corporateCB state $i
  129.             } 
  130.             if {$count == 1} {
  131.                 [$this sPage].visibleNG.DC.projectCB state $i
  132.             } 
  133.             if {$count == 2} {
  134.                 [$this sPage].visibleNG.DC.configCB state $i
  135.             } 
  136.             if {$count == 3} {
  137.                 [$this sPage].visibleNG.DC.phaseCB state $i
  138.             } 
  139.             if {$count == 4} {
  140.                 [$this sPage].visibleNG.DC.systemCB state $i
  141.             } 
  142.             incr count
  143.         }
  144.     }
  145. }
  146.  
  147. # Do not delete this line -- regeneration end marker
  148.  
  149.