home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Westmount Technology 1994
- #
- # File: @(#)docstructt.tcl /main/hindenburg/1
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)docstructt.tcl /main/hindenburg/1 29 Aug 1996 Copyright 1994 Westmount Technology
-
- # Start user added include file section
- # End user added include file section
-
-
- Class DocStructTree : {BrowsTree} {
- constructor
- method destructor
- method dropEvent
- method dialog
- attribute _dialog
- }
-
- constructor DocStructTree {class this name} {
- set this [BrowsTree::constructor $class $this $name]
- # Start constructor user section
-
- $this config \
- -selectionChanged {[%this dialog] selectionChanged} \
- -destinationSet "SECTION dropEvent" \
- -font "[m4_var get M4_font -context desk]"
-
- # End constructor user section
- return $this
- }
-
- method DocStructTree::destructor {this} {
- set ref [$this _dialog]
- if {$ref != ""} {
- $ref _structure ""
- }
- # Start destructor user section
- # End destructor user section
- }
-
- method DocStructTree::dropEvent {this section srcIsDst droppedAfterObj droppedBeforeObj} {
- # Skip if dragged from other tool
- if {! $srcIsDst} {
- return
- }
-
- # The root node can not be dragged
- if {"[$section parent]" == ""} {
- return
- }
-
- # Cannot drop before the root node
- if {"$droppedAfterObj" == ""} {
- return
- }
-
- # Update the section's parent and index
- set newParent [$droppedAfterObj parent]
- if {("$newParent" == "") ||
- ("$droppedBeforeObj" != "" &&
- "[$droppedBeforeObj parent]" != "$newParent")} {
- set newParent $droppedAfterObj
- set index 0
- } else {
- set index [expr [$droppedAfterObj index] + 1]
- }
- if {! [$section setParent $newParent]} {
- return
- }
- if {[$section index] != $index} {
- $section index $index
- }
- }
-
- # Do not delete this line -- regeneration end marker
-
- method DocStructTree::dialog {this args} {
- if {$args == ""} {
- return [$this _dialog]
- }
- set ref [$this _dialog]
- if {$ref != ""} {
- $ref _structure ""
- }
- set obj [lindex $args 0]
- if {$obj != ""} {
- $obj _structure $this
- }
- $this _dialog $obj
- }
-
-