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

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cayenne Software Inc.    1996
  4. #
  5. #      File:           @(#)editselall.tcl    /main/hindenburg/2
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)editselall.tcl    /main/hindenburg/2   15 Oct 1996 Copyright 1996 Cayenne Software Inc.
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14. require "undocomman.tcl"
  15.  
  16. Class EditSelAllCmd : {UndoCommand} {
  17.     constructor
  18.     method destructor
  19.     method do
  20.     method redo
  21.     method undo
  22. }
  23.  
  24. constructor EditSelAllCmd {class this name} {
  25.     set this [UndoCommand::constructor $class $this $name]
  26.     # Start constructor user section
  27.     # End constructor user section
  28.     return $this
  29. }
  30.  
  31. method EditSelAllCmd::destructor {this} {
  32.     # Start destructor user section
  33.     # End destructor user section
  34.     $this UndoCommand::destructor
  35. }
  36.  
  37. method EditSelAllCmd::do {this} {
  38.     [$this objectSet] contents [[.main flatView] selectedSet]
  39.     $this redo
  40.     $this busy 0
  41. }
  42.  
  43. method EditSelAllCmd::redo {this} {
  44.     busy {
  45.     set selectedSet ""
  46.     foreach flatObj [[.main flatView] objectSet] {
  47.         if {(! [$flatObj filteredOutState]) &&
  48.         "[$flatObj browsUiObj]" != ""} {
  49.         lappend selectedSet $flatObj
  50.         }
  51.     }
  52.     [.main flatView] selectedSet $selectedSet
  53.     .main selectionChanged
  54.     }
  55. }
  56.  
  57. method EditSelAllCmd::undo {this} {
  58.     busy {
  59.     set selectedSet ""
  60.     [$this objectSet] foreach flatObj {
  61.         if {! [$flatObj filteredOutState]} {
  62.         lappend selectedSet $flatObj
  63.         }
  64.     }
  65.     [.main flatView] selectedSet $selectedSet
  66.     .main selectionChanged
  67.     }
  68. }
  69.  
  70. # Do not delete this line -- regeneration end marker
  71.  
  72.