home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
repsubdirb.tcl
< prev
next >
Wrap
Text File
|
1997-11-21
|
4KB
|
145 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)repsubdirb.tcl /main/titanic/5
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)repsubdirb.tcl /main/titanic/5 21 Nov 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
require browstable.tcl
# End user added include file section
Class RepSubDirBrowser : {TemplateDialog} {
constructor
method destructor
method message
method popUp
method checkOk
method doubleClicked
method handleOk
method showDumpInfo
attribute directory
attribute selectedSet
}
constructor RepSubDirBrowser {class this name} {
set this [TemplateDialog::constructor $class $this $name]
# Start constructor user section
$this config \
-modal 1 \
-title "Repository Directory Browser" \
-okPressed "$this handleOk"
interface DlgColumn $this.c {
Label message {
text "Select a directory from the repository directory:"
}
BrowsTable list {
verStretchFactor 100
verShrinkFactor 100
mode DETAIL
selectionPolicy BROWSE
columnCount 36
rowCount 10
}
}
if $win95 {
set widths {24 32}
} else {
set widths {20 32}
}
$this.c.list setHeaderLabels {Subdirectory "Modification Date"} $widths
$this.c.list selectionChanged "$this checkOk"
PushButton new $this.info \
-label "Info" \
-activated "$this showDumpInfo"
$this delHelpButton
# End constructor user section
return $this
}
method RepSubDirBrowser::destructor {this} {
# Start destructor user section
# End destructor user section
}
method RepSubDirBrowser::message {this msg} {
$this.c.message text $msg
}
method RepSubDirBrowser::popUp {this} {
$this.c.list removeAllObjects
set selectedSet {}
set count 0
foreach subDir [BasicFS::readDir [$this directory]] {
set full [location [$this directory] $subDir]
if ![file isdir $full] {
continue
}
set date [clock format [file mtime $full] -format %c]
incr count
set obj $this.c.list.entry$count
BrowsObject new $obj \
-label $subDir \
-details [list $date] \
-activated "$this doubleClicked"
if {[lsearch [$this selectedSet] $subDir] != -1} {
lappend selectedSet $obj
}
}
$this.c.list selectedSet $selectedSet
$this checkOk
$this TemplateDialog::popUp
}
method RepSubDirBrowser::checkOk {this} {
set set [$this.c.list selectedSet]
if [lempty $set] {
$this.info sensitive 0
$this okSensitive 0
} else {
$this.info sensitive 1
$this okSensitive 1
}
}
method RepSubDirBrowser::handleOk {this} {
set set {}
foreach obj [$this.c.list selectedSet] {
lappend set [$obj label]
}
$this selectedSet $set
}
method RepSubDirBrowser::doubleClicked {this} {
$this checkOk
if [$this okSensitive] {
eval [$this okPressed]
}
$this popDown
}
method RepSubDirBrowser::showDumpInfo {this} {
set subDir [[lindex [$this.c.list selectedSet] 0] label]
set full [location [$this directory] $subDir]
Repository::showDumpInfo $full
}
# Do not delete this line -- regeneration end marker