home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1996
- #
- # File: @(#)reptool.tcl /main/hindenburg/11
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)reptool.tcl /main/hindenburg/11 21 Mar 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 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]
-
- # Configure the main window.
- #
- $this config \
- -title "ObjectTeam 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.
- # Default row and column counts are based on default font
- # courier-normal-12.
- #
- MenuBar new $this.bar
- interface DlgColumn $this.gui {
- BrowsView views {
- mode ICON
- selectionPolicy SINGLE
- columnCount 69
- rowCount 3
- }
- }
- $this.gui.views selectionChanged "$this selectionChanged"
- $this.gui.views font [m4_var get M4_font -context reptool]
-
- # 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 "$this startView $key" \
- -smallIcon [$this viewIcon $key] \
- -largeIcon [$this viewIcon $key] \
- -label [$this viewIconTitle $key]
- }
-
- # Install menu handler.
- #
- $this menuHandler [CustBrMenuHandler new reptool]
- catch {[$this menuHandler] setCurrentContext}
- catch {[$this menuHandler] selectionChanged}
-
- $this setMessageAreaPresence reptool
-
- 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 [$this.gui.views font]
- }
-
- 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
-
-