home *** CD-ROM | disk | FTP | other *** search
/ PC World 1998 October / PCWorld_1998-10_cd.bin / software / prehled / komix / DATA.Z / editselall.tcl < prev    next >
Text File  |  1997-08-29  |  2KB  |  79 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cayenne Software Inc.    1996
  4. #
  5. #      File:           @(#)editselall.tcl    /main/titanic/4
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)editselall.tcl    /main/titanic/4   29 Aug 1997 Copyright 1996 Cadre Technologies 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.         set selectEntry [$this editMenu].selectall
  28.         if [isCommand $selectEntry] {
  29.         $this commandName [$selectEntry label]
  30.     } else {
  31.         $this commandName "Select All"
  32.     }
  33.         $this setUndoLabel undo
  34.     # End constructor user section
  35.     return $this
  36. }
  37.  
  38. method EditSelAllCmd::destructor {this} {
  39.     # Start destructor user section
  40.     # End destructor user section
  41.     $this UndoCommand::destructor
  42. }
  43.  
  44. method EditSelAllCmd::do {this} {
  45.     [$this objectSet] contents [[.main flatView] selectedSet]
  46.     $this redo
  47.     $this busy 0
  48. }
  49.  
  50. method EditSelAllCmd::redo {this} {
  51.     busy {
  52.     set selectedSet ""
  53.     foreach flatObj [[.main flatView] objectSet] {
  54.         if {(! [$flatObj filteredOutState]) &&
  55.         "[$flatObj browsUiObj]" != ""} {
  56.         lappend selectedSet $flatObj
  57.         }
  58.     }
  59.     [.main flatView] selectedSet $selectedSet
  60.     .main selectionChanged
  61.     }
  62. }
  63.  
  64. method EditSelAllCmd::undo {this} {
  65.     busy {
  66.     set selectedSet ""
  67.     [$this objectSet] foreach flatObj {
  68.         if {[isCommand $flatObj] && (! [$flatObj filteredOutState])} {
  69.         lappend selectedSet $flatObj
  70.         }
  71.     }
  72.     [.main flatView] selectedSet $selectedSet
  73.     .main selectionChanged
  74.     }
  75. }
  76.  
  77. # Do not delete this line -- regeneration end marker
  78.  
  79.