home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
noneuiobj.tcl
< prev
next >
Wrap
Text File
|
1996-11-22
|
7KB
|
241 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1996
#
# File: @(#)noneuiobj.tcl /main/hindenburg/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)noneuiobj.tcl /main/hindenburg/2 22 Nov 1996 Copyright 1996 Cadre Technologies Inc.
# Start user added include file section
# End user added include file section
require "browsuiobj.tcl"
Class NoneUiObj : {BrowsUiObj} {
constructor
method destructor
method defineFileSection
method definePropertySection
method defineLocalSection
method hasChildren
}
global NoneUiObj::uiClass
set NoneUiObj::uiClass "None"
constructor NoneUiObj {class this name} {
set this [BrowsUiObj::constructor $class $this $name]
# Start constructor user section
$this uiName ""
$this uiText "None"
# End constructor user section
return $this
}
method NoneUiObj::destructor {this} {
# Start destructor user section
# End destructor user section
$this BrowsUiObj::destructor
}
proc NoneUiObj::associations {} {
return ""
}
proc NoneUiObj::childTypes {assoc} {
if {[lsearch -exact "[NoneUiObj::associations]" "$assoc"] == -1} {
return ""
}
return "[BrowserProcs::childTypes $assoc]"
}
method NoneUiObj::defineFileSection {this} {
busy {
set docV [$this parent]
set docSys [$docV docSys]
set docSysName [$docV setGetProp doc_sys]
if {"$docSys" == "" || [$docSys isNil]} {
wmtkerror \
"Documented system '$docSysName' does not exist\
within the current PhaseVersion"
return
}
set headerSpecList {
{Name 25 ascii {increasing 2}}
{Version 25 ascii {increasing 3}}
{Type 18 ascii {increasing 1}}
}
set fileVList ""
set objectSpecList ""
foreach fileV [$docSys localFileVersions] {
set fileType [[$fileV file] type]
if {"$fileType" == "cdm"} continue
set typeSpec [getObjectSpec [.main objectHdlr] \
[$fileV uiClass] [$fileV browserType] \
]
if {"$typeSpec" != ""} {
set icon [$typeSpec smallIcon]
} else {
set icon ""
}
lappend fileVList $fileV
lappend objectSpecList [list $icon \
[$fileV name] \
[$fileV versionName] \
[$fileV browserType] \
]
}
if [lempty $fileVList] {
wmtkinfo \
"There are no files in system '$docSysName'\
to create a reference to"
return
}
set dsm [$docV findFileVersion "${DSysVDbObj::dsmName}" dsm]
if [$dsm isNil] {
$docV addDocStructure
set dsm [$docV findFileVersion "${DSysVDbObj::dsmName}" dsm]
}
if {"[$dsm getInfo Status]" != "working"} {
$docV derive -fileVersion $dsm [$docV getParent ConfigVersion]
}
require "browsviewd.tcl"
set box .main.defineFileSection
ClassMaker::extend BrowsViewDialog DefineFileSectionBrowsViewDialog \
{docV uiObj}
DefineFileSectionBrowsViewDialog new $box \
-title "Define File Section" \
-message "Select FileVersion to create a link to" \
-headerSpecList $headerSpecList \
-objectSpecList $objectSpecList \
-objectList $fileVList \
-docV $docV \
-uiObj $this \
-cancelPressed {%this delete} \
-okPressed {
set docV [%this docV]
set uiObj [%this uiObj]
set fileV [[lindex [[%this view] selectedSet] 0] object]
set file [$fileV file]
set sectionType "[$file type]"
set sectionName "[$file qualifiedName :]"
set componentName "${sectionName}_$sectionType"
set unstructName \
[$docV unstructuredName "$componentName" "$sectionType"]
# Create the file section
set script \
" DocStructPart new .docStrucPart \
-documentVersion $docV \
-sectionType \"$sectionType\" \
-fileVersion $fileV"
append script " ;"
if {"$unstructName" == ""} {
append script \
" .docStrucPart sectionName \"$componentName\""
append script " ;"
append script " DocGenerator::createSection .docStrucPart"
} else {
append script " .docStrucPart sectionName \"$unstructName\""
append script " ;"
append script " DocGenerator::createSection .docStrucPart 0"
}
# Update component name
append script " ;"
append script "set dsm \[\
$docV findFileVersion [list ${DSysVDbObj::dsmName}] dsm\]"
append script " ;"
append script \
" set fileInfo \[DocStructure new $docV.fileInfo\]"
append script " ;"
append script " \$fileInfo edit \$dsm"
append script " ;"
append script " set component \[\
\$fileInfo findComponent [list [$uiObj uiName]] \]"
append script " ;"
append script \
" \$component uiName \[.docStrucPart sectionName\]"
append script " ;"
append script " \$fileInfo save"
append script " ;"
append script " \$fileInfo quit"
append script " ;"
append script " \$fileInfo delete"
append script " ;"
append script " .docStrucPart delete"
require "docgenerat.tcl"
require "docstructp.tcl"
.main startCommand tcl \
"$script" "" \
"Creating file section '$componentName'..." \
{1 0} 1
%this delete
}
[$box view] selectionPolicy BROWSE
$box popUp
}
}
method NoneUiObj::definePropertySection {this} {
busy {
set docV [$this parent]
if [[$docV findFileVersion "${DSysVDbObj::dsmName}" dsm] isNil] {
$docV addDocStructure
}
if [[$docV documentedSystem] isNil] {
wmtkerror "Invalid documented system specified"
} else {
set uiName [$this uiName]
set dlg .main.definePropertySection
require "propsecdlg.tcl"
PropSecDlg new $dlg $docV $uiName
$dlg title "Define Property Section '$uiName'"
$dlg popUp
}
}
}
method NoneUiObj::defineLocalSection {this} {
busy {
set docV [$this parent]
if [[$docV findFileVersion "${DSysVDbObj::dsmName}" dsm] isNil] {
$docV addDocStructure
}
set box .main.defineLocalSection
if {! [isCommand $box]} {
require "newlocalse.tcl"
NewLocalSectionDlg new $box \
-title "Define Local Section"
$box.top.nameLab delete
$box.top.name delete
}
$box config \
-dbObj $docV \
-entry "[$this uiName]"
$box popUp
}
}
method NoneUiObj::hasChildren {this} {
return 0
}
proc NoneUiObj::infoProperties {} {
return [BrowserProcs::infoProperties]
}
# Do not delete this line -- regeneration end marker