home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
reptoolvie.tcl
< prev
next >
Wrap
Text File
|
1997-11-10
|
6KB
|
235 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1996
#
# File: @(#)reptoolvie.tcl /main/titanic/13
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)reptoolvie.tcl /main/titanic/13 10 Nov 1997 Copyright 1996 Cayenne Software Inc.
# Start user added include file section
require showversio.tcl
require tooloption.tcl
require m4vardescr.tcl
require repository.tcl
require reptoolwmt.tcl
require reptoolfon.tcl
require reptoolurl.tcl
# End user added include file section
require "wmttool.tcl"
# Abstract base class for all RepTool views.
Class RepToolView : {MainWindow WmtTool ToolOptions} {
method destructor
constructor
method projectsEnabled
method modelsEnabled
method selectionChanged
method addContextArea
method updateToolBar
method setTitle
method setFont
method changePassword
method messageHandler
method error
method warning
method message
method fileExit
method viewRefresh
method optionsFont
method helpOnContext
method helpOnName
attribute m4VarDes
attribute levelPath
attribute levelPathIds
attribute contextError
attribute varContext
attribute toolId
attribute rep
attribute menuHandler
attribute moduleHandler
attribute wmtArea
attribute fontChooser
attribute passwordDialog
}
method RepToolView::destructor {this} {
# Start destructor user section
$this saveWindowGeometry [$this varContext]
$this saveContextAreaPresence [$this varContext]
$this saveToolBarPresence [$this varContext]
$this saveMessageAreaPresence [$this varContext]
# End destructor user section
$this WmtTool::destructor
}
constructor RepToolView {class this name toolId} {
set this [MainWindow::constructor $class $this $name]
set this [WmtTool::constructor $class $this $name]
$this toolId $toolId
global classCount
set classCount 0
# Create the Repository utility class used by all children.
#
$this rep [Repository new]
[$this rep] messageHandler "$this messageHandler"
# Set common attributes.
#
$this config \
-varContext $toolId \
-closed { %this fileExit } \
-exitButton $this.bar.file.menu.exit
# Create module handler.
#
$this moduleHandler [ModuleHandler new]
# Create component user interface parts.
#
MenuBar new $this.bar
$this menuHandler [CustBrMenuHandler new $toolId [$this moduleHandler]]
$this setToolBarPresence $toolId
# Create column named 'gui'.
# Subclasses should add further elements.
#
interface DlgColumn $this.gui {
spaceType NONE
}
$this m4VarDes [M4VarDescription new $this.m4VarDes]
$this setContextAreaPresence $toolId
$this setMessageAreaPresence $toolId
catch {[$this menuHandler] setCurrentContext}
return $this
}
method RepToolView::projectsEnabled {this} {
set spec [[$this moduleHandler] getModuleSpec "objectteam"]
if {$spec != "" && [$spec selectState] == "1"} {
return 1
}
return 0
}
method RepToolView::modelsEnabled {this} {
set spec [[$this moduleHandler] getModuleSpec "groundworks"]
if {$spec != "" && [$spec selectState] == "1"} {
return 1
}
return 0
}
method RepToolView::selectionChanged {this} {
set handler [$this menuHandler]
if {$handler != ""} {
$handler selectionChanged
}
}
method RepToolView::addContextArea {this} {
$this wmtArea [RepToolWmtArea new $this.gui.wmtArea reptool]
}
method RepToolView::updateToolBar {this} {
catch {[$this menuHandler] setCurrentContext}
}
method RepToolView::setTitle {this title {icon ""}} {
$this config \
-title "Cayenne Repository Tool - $title" \
-iconTitle $title
if {$icon != ""} {
$this icon $icon
$this setWindowGeometry [$this varContext]
}
}
method RepToolView::setFont {this font} {
if [catch {m4_var set M4_font $font -context [$this toolId]} error] {
$this error "Unable to set font for Repository Tool:\n$error" -add
}
}
method RepToolView::changePassword {this changed} {
if {[$this passwordDialog] == ""} {
$this passwordDialog [RepPasswordDialog new $this.changepwd]
}
[$this passwordDialog] changed $changed
[$this passwordDialog] entry ""
[$this passwordDialog] popUp
}
method RepToolView::messageHandler {this type msg {options ""}} {
switch $type {
ERROR { $this error $msg $options }
WARNING { $this warning $msg }
MESSAGE -
default { $this message $msg }
}
}
method RepToolView::error {this msg {options ""}} {
if {[lindex $options 0] == "-add"} {
catch {error $msg}
}
wmtkerror $msg
}
method RepToolView::warning {this msg} {
global errorCode
set errorCode 0
wmtkwarning $msg
}
method RepToolView::message {this msg} {
wmtkmessage $msg
}
method RepToolView::fileExit {this} {
$this message "Exiting..."
$this stop
}
method RepToolView::viewRefresh {this} {
$this update
$this selectionChanged
}
method RepToolView::optionsFont {this} {
if {[$this fontChooser] == ""} {
$this fontChooser [RepToolFontChooser new $this.fontdlg $this]
}
[$this fontChooser] popUp
}
method RepToolView::helpOnContext {this} {
$this error "Not implemented."
}
method RepToolView::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