home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / csconfigvi.tcl < prev    next >
Encoding:
Text File  |  1997-05-15  |  5.6 KB  |  228 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cayenne Software Inc.    1996
  4. #
  5. #      File:           @(#)csconfigvi.tcl    /main/hindenburg/17
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)csconfigvi.tcl    /main/hindenburg/17   15 May 1997 Copyright 1996 Cayenne Software Inc.
  10.  
  11. # Start user added include file section
  12. require "cstree.tcl"
  13. # End user added include file section
  14.  
  15. require "reptoolvie.tcl"
  16.  
  17. Class CSConfigView : {RepToolView} {
  18.     method destructor
  19.     constructor
  20.     method initialize
  21.     method selectedObjSet
  22.     method selectionChanged
  23.     method update
  24.     method canDelete
  25.     method canReload
  26.     method canChangeServerEntry
  27.     method canChangeParameters
  28.     method canShutdown
  29.     method changeParamMode
  30.     method setFont
  31.     method getFont
  32.     method fileDelete
  33.     method fileReload
  34.     method fileChangeServerEntry
  35.     method fileChangeParameters
  36.     method fileShutdown
  37.     method viewRefreshSelected
  38.     method optionsParamMode
  39.     method helpOnContext
  40.     attribute paramMode
  41.     attribute tree
  42.     attribute info
  43. }
  44.  
  45. method CSConfigView::destructor {this} {
  46.     # Start destructor user section
  47.     # End destructor user section
  48.     $this RepToolView::destructor
  49. }
  50.  
  51. constructor CSConfigView {class this name} {
  52.     set this [RepToolView::constructor $class $this $name repconf]
  53.  
  54.         $this setTitle "Client/Server Configuration" rep_conf_64
  55.         $this firstExposed "$this initialize"
  56.  
  57.         $this paramMode [m4_var get M4_csconfig_parammode]
  58.         if {[$this paramMode] == ""} {
  59.             $this paramMode "Normal"
  60.         }
  61.  
  62.         # Set a small ORB timeout to have little delays caused by trying to
  63.         # access objects serviced by exited brokers or servers.
  64.         #
  65.         [$this rep] quickTimeOut
  66.  
  67.         # Create main interface part.
  68.         #
  69.         interface VerSplitter $this.gui.row {
  70.             CSTree tree {
  71.                 columnCount 30
  72.             }
  73.             MultiLineText info {
  74.         editable 0
  75.         columnCount 40
  76.         rowCount 20
  77.             }
  78.         }
  79.  
  80.         $this tree $this.gui.row.tree
  81.         [$this tree] view $this
  82.         [$this tree] selectionChanged "$this selectionChanged"
  83.         [$this tree] font [m4_var get M4_font -context repconf]
  84.  
  85.         $this info $this.gui.row.info
  86.         [$this info] font [m4_var get M4_font -context repconf]
  87.  
  88.     return $this
  89. }
  90.  
  91. proc CSConfigView::repToolClass {} {
  92.     return "CSConfigView"
  93. }
  94.  
  95. method CSConfigView::initialize {this} {
  96.     busy {
  97.     $this viewRefresh
  98.  
  99.         set root [$this tree].root
  100.         [$this tree] selected $root
  101.         $this selectionChanged
  102.         $root display
  103.     }
  104. }
  105.  
  106. method CSConfigView::selectedObjSet {this} {
  107.     return [[$this tree] selected]
  108. }
  109.  
  110. method CSConfigView::selectionChanged {this} {
  111.     if [lempty [$this selectedObjSet]] {
  112.     [$this info] text ""
  113.     }
  114.     $this RepToolView::selectionChanged
  115. }
  116.  
  117. method CSConfigView::update {this} {
  118.     [$this tree] update
  119. }
  120.  
  121. method CSConfigView::canDelete {this} {
  122.     set obj [[$this tree] selected]
  123.     return [$obj canDelete]
  124. }
  125.  
  126. method CSConfigView::canReload {this} {
  127.     set obj [[$this tree] selected]
  128.     return [$obj canReload]
  129. }
  130.  
  131. method CSConfigView::canChangeServerEntry {this} {
  132.     set obj [[$this tree] selected]
  133.     return [$obj canChangeEntry]
  134. }
  135.  
  136. method CSConfigView::canChangeParameters {this} {
  137.     set obj [[$this tree] selected]
  138.     return [$obj canChangeParams]
  139. }
  140.  
  141. method CSConfigView::canShutdown {this} {
  142.     set obj [[$this tree] selected]
  143.     return [$obj canShutdown]
  144. }
  145.  
  146. method CSConfigView::changeParamMode {this newMode} {
  147.     $this paramMode $newMode
  148.     m4_var set M4_csconfig_parammode $newMode
  149.     [$this tree] update 0
  150.  
  151.     set obj [[$this tree] selected]
  152.     if ![lempty $obj] {
  153.         $obj display
  154.     }
  155. }
  156.  
  157. method CSConfigView::setFont {this font} {
  158.     [$this tree] font $font
  159.     [$this info] font $font
  160.  
  161.     $this RepToolView::setFont $font
  162. }
  163.  
  164. method CSConfigView::getFont {this} {
  165.     return [[$this tree] font]
  166. }
  167.  
  168. method CSConfigView::fileDelete {this} {
  169.     [[$this tree] selected] removeEntry
  170. }
  171.  
  172. method CSConfigView::fileReload {this} {
  173.     [[$this tree] selected] reload
  174. }
  175.  
  176. method CSConfigView::fileChangeServerEntry {this} {
  177.     [[$this tree] selected] changeEntry
  178. }
  179.  
  180. method CSConfigView::fileChangeParameters {this} {
  181.     [[$this tree] selected] changeParameters
  182. }
  183.  
  184. method CSConfigView::fileShutdown {this} {
  185.     [[$this tree] selected] shutdown
  186. }
  187.  
  188. method CSConfigView::viewRefreshSelected {this} {
  189.     set obj [[$this tree] selected]
  190.     $obj update 0
  191.     $obj display
  192. }
  193.  
  194. method CSConfigView::optionsParamMode {this} {
  195.     set dlg [ListDialog new $this.optionsparammode \
  196.         -title "Parameter Display Mode" \
  197.     -message "Change Parameter Display Mode" \
  198.         -selectionPolicy "BROWSE" \
  199.         -modal 1]
  200.  
  201.     if $win95 {
  202.         $dlg entrySet { "Normal" "Meta4" }
  203.     } else {
  204.         $dlg entrySet { "Normal" "Meta4" "Sh" "Csh" }
  205.     }
  206.     $dlg rowCount [llength [$dlg entrySet]]
  207.     $dlg selectedSet [$this paramMode]
  208.  
  209.     $dlg okPressed "
  210.         $this changeParamMode \[%this selectedSet]
  211.         %this delete
  212.     "
  213.     $dlg helpPressed "$this helpOnName changeParamMode"
  214.     $dlg popUp
  215. }
  216.  
  217. method CSConfigView::helpOnContext {this} {
  218.     set selected [[$this tree] selected]
  219.     if {$selected != ""} {
  220.         $this helpOnName "selected[$selected objType]"
  221.     } else {
  222.         $this helpOnName repToolCSConfigView
  223.     }
  224. }
  225.  
  226. # Do not delete this line -- regeneration end marker
  227.  
  228.