home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
reptool.tcl
< prev
next >
Wrap
Text File
|
1997-11-10
|
7KB
|
256 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1996
#
# File: @(#)reptool.tcl /main/titanic/15
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)reptool.tcl /main/titanic/15 10 Nov 1997 Copyright 1996 Cayenne Software Inc.
# Start user added include file section
require showversio.tcl
require reptoolfon.tcl
require reptoolurl.tcl
# End user added include file section
require "wmttool.tcl"
Class RepTool : {MainWindow WmtTool} {
method destructor
constructor
method viewTitle
method viewIconTitle
method viewFile
method viewName
method viewIcon
method error
method warning
method message
method startView
method setFont
method getFont
method selectionChanged
method selectedObjSet
method fileOpen
method fileExit
method optionsFont
method helpOnContext
method helpOnName
attribute levelPath
attribute levelPathIds
attribute menuHandler
attribute moduleHandler
attribute viewInfo
attribute fontChooser
}
method RepTool::destructor {this} {
# Start destructor user section
$this saveWindowGeometry reptool
$this saveMessageAreaPresence reptool
# End destructor user section
$this WmtTool::destructor
}
constructor RepTool {class this name} {
set this [MainWindow::constructor $class $this $name]
set this [WmtTool::constructor $class $this $name]
global classCount
set classCount 0
# Configure the main window.
#
$this config \
-title "Cayenne Repository Tool" \
-closed {%this fileExit} \
-exitButton $this.bar.file.menu.exit \
-iconTitle "Repository Tool" \
-icon rep_tool_64
$this setWindowGeometry reptool
# Define views.
#
set list [List new]
$list contents {
{corp "Corporate Management" corpmanvie CorpManView rep_corp_32}
{uenv "User Environment" userenvvie UserEnvView rep_uenv_32}
{lock "Lock Management" lockmanvie LockManView rep_lock_32}
{conf "Client/Server Configuration" csconfigvi CSConfigView rep_conf_32}
}
# Create component user interface parts.
#
MenuBar new $this.bar
interface DlgColumn $this.gui {
BrowsView views {
mode ICON
}
}
$this.gui.views selectionChanged "$this selectionChanged"
$this.gui.views font [$this getFont]
# Default row and column counts are based on default fonts
# Arial-normal-12-0 (Windows) and helvetica-normal-12-0 (Unix).
#
if $win95 {
$this.gui.views columnCount 78
$this.gui.views rowCount 3
} else {
$this.gui.views columnCount 30
$this.gui.views rowCount 3
}
# Make a dictionary for fast view lookup.
#
$this viewInfo [Dictionary new]
# Create view browser objects.
#
$list foreach view {
set key [lindex $view 0]
[$this viewInfo] set $key [lrange $view 1 end]
BrowsObject new $this.gui.views.$key \
-activated "busy \{ $this startView $key \}" \
-smallIcon [$this viewIcon $key] \
-largeIcon [$this viewIcon $key] \
-label [$this viewIconTitle $key]
}
# Create module handler.
#
$this moduleHandler [ModuleHandler new]
# Install menu handler.
#
$this menuHandler [CustBrMenuHandler new reptool [$this moduleHandler]]
catch {[$this menuHandler] setCurrentContext}
catch {[$this menuHandler] selectionChanged}
$this setMessageAreaPresence reptool
ViewPopUpMenu new $this.gui.views.pop -poppedUp {
.main.gui.views.pop entrySet [[.main menuHandler] validPopUpEntrySet]
}
return $this
}
method RepTool::viewTitle {this name} {
return [lindex [[$this viewInfo] set $name] 0]
}
method RepTool::viewIconTitle {this name} {
set title [lindex [[$this viewInfo] set $name] 0]
regsub -all " " $title "\n" title
return $title
}
method RepTool::viewFile {this name} {
return [lindex [[$this viewInfo] set $name] 1].tcl
}
method RepTool::viewName {this name} {
return [lindex [[$this viewInfo] set $name] 2]
}
method RepTool::viewIcon {this name} {
return [lindex [[$this viewInfo] set $name] 3]
}
method RepTool::error {this msg} {
global errorCode
set errorCode 0
wmtkerror $msg
}
method RepTool::warning {this msg} {
wmtkwarning $msg
}
method RepTool::message {this msg} {
wmtkmessage $msg
}
method RepTool::startView {this name} {
$this message "Starting '[$this viewTitle $name]' tool..."
SystemUtilities::fork otk reptoolpop \
-caller [get_comm_name] \
-levelPath [$this levelPath] \
-levelPathIds [$this levelPathIds] \
[$this viewFile $name]
}
method RepTool::setFont {this font} {
if [catch {m4_var set M4_font $font -context reptool}] {
$this error "Unable to set font for Repository Tool."
}
$this.gui.views font $font
}
method RepTool::getFont {this} {
return [m4_var get M4_font -context reptool]
}
method RepTool::selectionChanged {this} {
set handler [$this menuHandler]
if {$handler != ""} {
$handler selectionChanged
}
}
method RepTool::selectedObjSet {this} {
return [$this.gui.views selectedSet]
}
method RepTool::fileOpen {this} {
set names [split [$this.gui.views selectedSet] .]
set end [llength $names]
incr end -1
$this startView [lindex $names $end]
}
method RepTool::fileExit {this} {
$this message "Exiting..."
$this stop
}
method RepTool::optionsFont {this} {
if {[$this fontChooser] == ""} {
$this fontChooser [RepToolFontChooser new $this.fontdlg $this]
}
[$this fontChooser] popUp
}
method RepTool::helpOnContext {this} {
set obj [$this selectedObjSet]
if ![lempty $obj] {
set names [split $obj .]
set end [llength $names]
incr end -1
set name [lindex $names $end]
$this helpOnName "repTool[$this viewName $name]"
} else {
$this helpOnName "repToolMain"
}
}
method RepTool::helpOnName {this name} {
global short2url
if [catch {set url $short2url($name)}] {
$this error "Sorry, no help available for '$name'"
} else {
showHelp $url
}
}
# Do not delete this line -- regeneration end marker