home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / objectobje.tcl < prev    next >
Text File  |  1996-06-12  |  2KB  |  101 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cadre Technologies Inc.    1996
  4. #
  5. #      File:           @(#)objectobje.tcl    /main/3
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)objectobje.tcl    /main/3   12 Jun 1996 Copyright 1996 Cadre Technologies Inc.
  10.  
  11. # Start user added include file section
  12. require "custsort.tcl"
  13. # End user added include file section
  14.  
  15. require "custbrowso.tcl"
  16.  
  17. Class ObjectObject : {BrowsObject CustBrowsObject} {
  18.     method destructor
  19.     constructor
  20.     method updateView
  21.     method open
  22.     attribute browserType
  23.     attribute redefined
  24. }
  25.  
  26. method ObjectObject::destructor {this} {
  27.     # Start destructor user section
  28.     # End destructor user section
  29.     $this CustBrowsObject::destructor
  30. }
  31.  
  32. constructor ObjectObject {class this name specification} {
  33.  
  34.     set this [BrowsObject::constructor $class $this $name]
  35.     set this [CustBrowsObject::constructor $class $this $name]
  36.  
  37.     $this activated {%this open}
  38.  
  39.     $this smallIcon undef_16
  40.     $this largeIcon undef_32
  41.  
  42.     while {![lempty $specification]} {
  43.         set key [lvarpop specification]
  44.         $this $key [lvarpop specification]
  45.     }
  46.  
  47.     $this displayName [$this name]
  48.     # type is always ObjectObject
  49.     $this type ObjectObject
  50.  
  51.     return $this
  52. }
  53.  
  54. method ObjectObject::updateView {this} {
  55.  
  56.     #give the name of the object the name of the view
  57.     set specification [$this objSpec]
  58.     # get the icon from the spec to use in the view
  59.     while {![lempty $specification]} {
  60.         set key [lvarpop specification]
  61.         set value [lvarpop specification]
  62.         if {$key == "largeIcon"} {
  63.             $this largeIcon $value
  64.         }    
  65.         if {$key == "smallIcon"} {
  66.             $this smallIcon $value
  67.         }    
  68.     }
  69.  
  70.     if [$this editable] {
  71.         set level "[$this specLevel] *"
  72.     } else {
  73.         set level [$this specLevel]
  74.     }
  75.  
  76.     $this label [$this _displayName]
  77.     $this details " \"[$this browserType]\" \
  78.             \"$level\" \
  79.                 \"[$this scope]\""
  80. }
  81.  
  82. method ObjectObject::open {this} {
  83.  
  84.     if {![$this editable]} {
  85.         return
  86.     }
  87.  
  88.     .main busy TRUE
  89.     set definer [[.main editorArea] objectDefiner]
  90.  
  91.     if {[catch {$definer load $this}]} {
  92.         set definer [ObjectDefineDialog new .main.objectDefiner]
  93.         [.main editorArea] objectDefiner $definer
  94.         $definer load $this
  95.     }
  96.     .main busy FALSE
  97. }
  98.  
  99. # Do not delete this line -- regeneration end marker
  100.  
  101.