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

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Westmount Technology    1994
  4. #
  5. #      File:           @(#)cbfeaturet.tcl    1.5
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)cbfeaturet.tcl    1.5   08 Mar 1996 Copyright 1994 Westmount Technology
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14. require "cbclassinf.tcl"
  15.  
  16. Class CBFeatureTextlist : {CBClassInfoTextList} {
  17.     constructor
  18.     method destructor
  19.     method updateView
  20.     method collectFeatures
  21.     method collectInheritedFeatures
  22.     method browser
  23.     attribute _browser
  24. }
  25.  
  26. constructor CBFeatureTextlist {class this name} {
  27.     set this [CBClassInfoTextList::constructor $class $this $name]
  28.     # Start constructor user section
  29.     # End constructor user section
  30.     return $this
  31. }
  32.  
  33. method CBFeatureTextlist::destructor {this} {
  34.     set ref [$this _browser]
  35.     if {$ref != ""} {
  36.         $ref _featureTL ""
  37.     }
  38.     # Start destructor user section
  39.     # End destructor user section
  40.     $this CBClassInfoTextList::destructor
  41. }
  42.  
  43. method CBFeatureTextlist::updateView {this currentClass} {
  44.     $this removeTextListEntries
  45.     $this removeEntries
  46.  
  47.     if {[[$this browser] isInFlatViewMode]} {
  48.         set inFlatViewList [List new]
  49.         $inFlatViewList insert $currentClass
  50.         $this collectInheritedFeatures $currentClass $inFlatViewList
  51.     }
  52.     $this collectFeatures $currentClass
  53.  
  54.     $this fillEntries
  55.     $this deselectEntries
  56. }
  57.  
  58. method CBFeatureTextlist::collectFeatures {this aClass} {
  59.     [$aClass featureSet] foreach feat {
  60.         if {[[$feat getFilter] letsPass $feat]} {
  61.             $this addTextListEntry $feat
  62.         }
  63.     }
  64. }
  65.  
  66. method CBFeatureTextlist::collectInheritedFeatures {this aClass inFlatViewList} {
  67.     foreach superClass [$aClass getSuperClasses] {
  68.         if {[lsearch [$inFlatViewList contents] $superClass] != -1} {
  69.             continue
  70.         }
  71.         $inFlatViewList insert $superClass
  72.         $this collectInheritedFeatures $superClass $inFlatViewList
  73.         $this collectFeatures $superClass
  74.     }
  75. }
  76.  
  77. # Do not delete this line -- regeneration end marker
  78.  
  79. method CBFeatureTextlist::browser {this args} {
  80.     if {$args == ""} {
  81.         return [$this _browser]
  82.     }
  83.     set ref [$this _browser]
  84.     if {$ref != ""} {
  85.         $ref _featureTL ""
  86.     }
  87.     set obj [lindex $args 0]
  88.     if {$obj != ""} {
  89.         $obj _featureTL $this
  90.     }
  91.     $this _browser $obj
  92. }
  93.  
  94.