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

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cayenne Software Inc.    1997
  4. #
  5. #      File:           @(#)edcontrolp.tcl    /main/titanic/4
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)edcontrolp.tcl    /main/titanic/4   12 Sep 1997 Copyright 1997 Cayenne Software Inc.
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14. require "duallook.tcl"
  15.  
  16. Class EdControlPanel : {DualLook VerControlPanel} {
  17.     method destructor
  18.     constructor
  19.     method entrySet
  20.     method selected
  21.     method initialize
  22.     method initPanel
  23.     attribute edType
  24.     attribute area
  25. }
  26.  
  27. method EdControlPanel::destructor {this} {
  28.     # Start destructor user section
  29.     # End destructor user section
  30.     $this DualLook::destructor
  31. }
  32.  
  33. constructor EdControlPanel {class this name} {
  34.     set this [VerControlPanel::constructor $class $this $name]
  35.     $this selectionChanged {[%this area] currentSymbol [%this selected]}
  36.     return $this
  37. }
  38.  
  39. method EdControlPanel::entrySet {this {symbolSet ""}} {
  40.     if { $symbolSet == "" } {
  41.     return [$this VerControlPanel::entrySet]
  42.     }
  43.     $this VerControlPanel::entrySet \
  44.         [$this convertSymbolSet [$this edType] $symbolSet] 
  45. }
  46.  
  47. method EdControlPanel::selected {this {value ""}} {
  48.     if { $value == "" } {
  49.     return [$this convertSymbol [$this VerControlPanel::selected]]
  50.     }
  51.     $this VerControlPanel::selected $value
  52. }
  53.  
  54. method EdControlPanel::initialize {this edType} {
  55.     $this DualLook::initialize
  56.  
  57.     eval "proc registerObject {spec} {$this initPanel \$spec}"
  58.         $this edType $edType
  59.  
  60.     set userPath [path_name concat [path_name concat ~ icase] $edType.pnl]
  61.     if [file exists $userPath] {
  62.         source $userPath
  63.     } else {
  64.         set tmpFile [args_file {}]
  65.         [ClientContext::global] downLoadCustomFile $edType pnl \
  66.             etc $tmpFile
  67.         source $tmpFile
  68.         unlink $tmpFile
  69.     }
  70.  
  71.     # check long names for the tips
  72.     set tipSet {}
  73.     foreach entry [$this entrySet] {
  74.         set name [ShortLongName::longName [$this convertSymbol $entry]]
  75.         if {$name == ""} {
  76.             set name $entry
  77.         }
  78.         lappend tipSet "$name"
  79.     }
  80.     $this tipSet $tipSet
  81.     $this selected Select
  82.     if [isCommand [$this area]] {
  83.         [$this area] currentSymbol Select
  84.     }
  85. }
  86.  
  87. method EdControlPanel::initPanel {this spec} {
  88.  
  89.     while {![lempty $spec]} {
  90.         set key [lvarpop spec]
  91.         set value [lvarpop spec]
  92.         $this $key $value
  93.     }
  94. }
  95.  
  96. # Do not delete this line -- regeneration end marker
  97.  
  98.