home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
propview.tcl
< prev
next >
Wrap
Text File
|
1996-09-12
|
2KB
|
103 lines
#---------------------------------------------------------------------------
#
# (c) Westmount Technology 1994
#
# File: @(#)propview.tcl /main/titanic/1
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)propview.tcl /main/titanic/1 12 Sep 1996 Copyright 1994 Westmount Technology
# Start user added include file section
require propviewob.tcl
# End user added include file section
Class PropView : {BrowsView} {
constructor
method destructor
method dropEvent
method reIndex
}
constructor PropView {class this name} {
set this [BrowsView::constructor $class $this $name]
# Start constructor user section
$this config \
-destinationSet "BROWSERVIEWPROP dropEvent" \
-selectionPolicy BROWSE
# End constructor user section
return $this
}
method PropView::destructor {this} {
# Start destructor user section
# End destructor user section
}
method PropView::dropEvent {this droppedObject srcIsDst droppedAfterObject droppedForObject} {
set fromView [$droppedObject view]
if {$fromView != $this} {
set woObjSet [$this objectSet]
set droppedObject [$droppedObject reParent $this]
} else {
# remove the dropped object from the list
foreach obj [$this objectSet] {
if {$obj != $droppedObject} {
lappend woObjSet $obj
}
}
}
# set on the right place
# replace the dropped object in the list
if { $droppedAfterObject == ""} {
set wObjSet "$droppedObject $woObjSet"
} else {
foreach obj $woObjSet {
lappend wObjSet $obj
if {$obj == $droppedAfterObject} {
lappend wObjSet $droppedObject
}
}
}
set index 0
foreach obj $wObjSet {
$obj index $index
incr index
}
$this sort -command "PropView::sort"
}
method PropView::reIndex {this} {
set index 0
foreach obj [$this objectSet] {
$obj index $index
incr index
}
}
proc PropView::sort {objA objB} {
set idxA [$objA index]
set idxB [$objB index]
if {$idxA > $idxB} {
return 1
} elseif {$idxB > $idxA} {
return -1
} else {
return 0
}
}
# Do not delete this line -- regeneration end marker