home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1996
- #
- # File: @(#)reptoolvie.tcl /main/hindenburg/17
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)reptoolvie.tcl /main/hindenburg/17 27 Nov 1996 Copyright 1996 Cayenne Software Inc.
-
- # Start user added include file section
- require showversio.tcl
- require tooloption.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} {
- method destructor
- constructor
- 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 levelPath
- attribute levelPathIds
- attribute contextError
- attribute varContext
- attribute toolId
- attribute rep
- attribute menuHandler
- 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
-
- # 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 component user interface parts.
- #
- MenuBar new $this.bar
- $this menuHandler [CustBrMenuHandler new $toolId]
- $this setToolBarPresence $toolId
-
- # Create column named 'gui'.
- # Subclasses should add further elements.
- #
- interface DlgColumn $this.gui {
- spaceType NONE
- }
-
- $this setContextAreaPresence $toolId
- $this setMessageAreaPresence $toolId
-
- catch {[$this menuHandler] setCurrentContext}
-
- return $this
- }
-
- 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 "ObjectTeam 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
-
-