home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
repprojbro.tcl
< prev
next >
Wrap
Text File
|
1997-11-14
|
3KB
|
128 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)repprojbro.tcl /main/titanic/3
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)repprojbro.tcl /main/titanic/3 14 Nov 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
require "repobjbrow.tcl"
Class RepProjBrowser : {RepObjBrowser} {
constructor
method destructor
method fillList
method selectionChanged
method changeStatus
method statusChanged
}
constructor RepProjBrowser {class this name view} {
set this [RepObjBrowser::constructor $class $this $name $view]
# Start constructor user section
$this config \
-title "Project Browser" \
-helpPressed { [%this view] helpOnName projectBrowser }
set corp [[[$this view] rep] currentCorporate]
[$this objLabel] text "Projects in corporate '[$corp name]'"
[$this statusLabel] text "Operable:"
[$this statusValue] text ""
[$this statusChange] label "Change"
[$this statusChange] activated "busy { $this changeStatus }"
$this selectionChanged
# End constructor user section
return $this
}
method RepProjBrowser::destructor {this} {
# Start destructor user section
# End destructor user section
$this RepObjBrowser::destructor
}
method RepProjBrowser::fillList {this} {
set corp [[[$this view] rep] currentCorporate]
[$this objList] setHeaderLabels { Name Operable }
foreach proj [$corp projects] {
set name [$proj name]
regsub -all {[\. ]} $name {___} name
if [$proj isOperable] {
set status "Yes"
} else {
set status "No"
}
[$this objMap] set $name $proj
BrowsObject new [$this objList].$name \
-smallIcon proj_16 \
-label $name \
-details $status \
-activated "$this doubleClicked"
}
}
method RepProjBrowser::selectionChanged {this} {
set proj [$this selectedObject]
if [$proj isNil] {
[$this dirField] text ""
[$this statusValue] text ""
[$this statusChange] sensitive 0
} else {
[$this dirField] text [$proj repositoryDirectory]
if [$proj isOperable] {
[$this statusValue] text "Yes"
} else {
[$this statusValue] text "No"
}
[$this statusChange] sensitive 1
}
}
method RepProjBrowser::changeStatus {this} {
set proj [$this selectedObject]
if [$proj isNil] {
return
}
if ![$proj isOperable] {
$proj online
} else {
$proj offline
}
$this statusChanged
}
method RepProjBrowser::statusChanged {this} {
set proj [$this selectedObject]
if [$proj isNil] {
return
}
if [$proj isOperable] {
[$this statusValue] text "Yes"
} else {
[$this statusValue] text "No"
}
set currSel [[$this objList] selectedSet]
$this update
[$this objList] selectedSet $currSel
}
# Do not delete this line -- regeneration end marker