home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
viewedarea.tcl
< prev
next >
Wrap
Text File
|
1997-03-14
|
4KB
|
186 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1996
#
# File: @(#)viewedarea.tcl /main/titanic/3
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)viewedarea.tcl /main/titanic/3 14 Mar 1997 Copyright 1996 Cadre Technologies Inc.
# Start user added include file section
require custobjvie.tcl
require viewobject.tcl
require viewdefine.tcl
# End user added include file section
require "custedarea.tcl"
Class ViewEdArea : {CustEdArea BrowsView} {
method destructor
constructor
method newObject
method createObject
method redefineObject
method writeObject
method sortArea
method getObjects
method clearArea
attribute viewDefiner
}
method ViewEdArea::destructor {this} {
# Start destructor user section
# End destructor user section
$this CustEdArea::destructor
}
constructor ViewEdArea {class this name} {
set this [BrowsView::constructor $class $this $name]
set this [CustEdArea::constructor $class $this $name]
$this rowCount 12
$this columnCount 80
$this font "[m4_var get M4_font -context uce]"
$this mode DETAIL
BrowsHeader new $this.repType -label "Repository type" -width 25
BrowsHeader new $this.broType -label "Browser type" -width 25
BrowsHeader new $this.name -label "View name" -width 17
BrowsHeader new $this.specLevel -label Level -width 25
BrowsHeader new $this.scope -label Scope -width 75
global classCount
$this filter [CustObjViewFilter new CustObjViewFilter$classCount $this]
incr classCount
return $this
}
method ViewEdArea::newObject {this repositoryType browserType name {edit 0}} {
$this isChanged 1
if {$browserType == "all"} {
set browserType ""
}
set user 0
if {[$this _level] == "user"} {
set user 1
}
set level 0
set validLevel 0
if {![isCommand .main.viewDefiner]} {
$this viewDefiner [ViewDefineDialog new .main.viewDefiner]
}
set repScope [[$this viewDefiner] getRepTypeScope $repositoryType]
foreach elm $repScope {
if $elm {
set validLevel $level
}
incr level
}
# adjust the scope to the repositoryType
set scope [$this _scope]
for {set i [llength $scope]} {$i < $validLevel} {incr i} {
lappend scope "*"
}
set obj [$this createObject [list displayName $name \
scope $scope \
specLevel [$this _level] \
userDefined $user \
repositoryType $repositoryType \
browserType $browserType \
name $name] \
[$this _level]]
$this sortArea
if $edit {
$obj open
}
}
method ViewEdArea::createObject {this objSpec level} {
global classCount
set object [ViewObject new $this.Object$classCount $objSpec]
incr classCount
# if invalid scope (level) specified, set scope to corporate
if {$icaseLevel([llength [$object scope]]) == ""} {
$object scope ""
}
$this adjustCreatedObject $object $level
# update the object-details in the view
# if the objectname already exists, it is automatically placed
# under the existing one (sorted)
$object updateView
return $object
}
method ViewEdArea::redefineObject {this obj} {
set object [$this CustEdArea::redefineObject $obj]
if [isCommand $object] {
$object repositoryType [$obj repositoryType]
$object browserType [$obj browserType]
$object updateView
$this sortArea
}
return $object
}
method ViewEdArea::writeObject {this obj fid} {
set list ""
if [$obj readOnly] {
lappend list readOnly [$obj readOnly]
}
if { [$obj scope] != "" } {
lappend list scope [$obj scope]
}
lappend list name [$obj displayName]
lappend list repositoryType [$obj repositoryType]
if { [$obj browserType] != "" } {
lappend list browserType [$obj browserType]
}
# Don't use lappend here to prevent confusion of indentList
set list "$list objSpec [CustEdArea::indentList [$obj objSpec] 1 1]"
puts $fid "registerObject [CustEdArea::indentList $list 0 1]"
}
method ViewEdArea::sortArea {this} {
$this sort -command "sortView"
}
method ViewEdArea::getObjects {this} {
return [$this objectSet]
}
method ViewEdArea::clearArea {this} {
foreach obj [$this objectSet] {
$obj delete
}
.main selectionChanged
}
# Do not delete this line -- regeneration end marker