home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)uce.tcl /main/titanic/5
- # Author: voyager
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)uce.tcl /main/titanic/5 16 Jul 1997 Copyright 1997 Cayenne Software Inc.
-
- OtkRegister::extGui
-
- source [m4_path_name tcl libocl.tcl]
-
- require platform.tcl
- require procs.tcl
- require messagehdl.tcl
-
- global classCount
- set classCount 0
-
- proc usage {} {
- error "Usage: otk uce.tcl -- \
- \[-c caller\] \
- \[-r\] \
- \[-fi level file.editorType\] \
- \[-id customFileVersionId\]"
- }
-
- proc editorReadOnly {menuEntry} {
- if [.main currentlyReadOnly] {
- $menuEntry sensitive 0
- return 1
- } else {
- $menuEntry sensitive 1
- return 0
- }
- }
-
- proc objectReadOnly {menuEntry} {
-
- if {[editorReadOnly $menuEntry]} {
- return
- }
-
- $menuEntry sensitive 1
- foreach obj [[.main editorArea] selectedSet] {
- if {![$obj editable]} {
- $menuEntry sensitive 0
- }
- }
- }
-
- set argc 0
- set status INITIAL
- set type ""
- set readOnly 0
- set caller ""
- foreach arg $argv {
- case $arg in {
- {-c} {
- if {$status != "INITIAL"} {
- usage
- }
- set status CALLER
- }
- {-r} {
- if {$status != "INITIAL"} {
- usage
- }
- set readOnly 1
- }
- {-fi} {
- if {$status != "INITIAL"} {
- usage
- }
- set type "fi"
- set status FILE
- }
- {-id} {
- if {$status != "INITIAL"} {
- usage
- }
- set type "id"
- set status ID
- }
- {default} {
- case $status in {
- {CALLER} {
- set caller $arg
- set status INITIAL
- }
- {FILE} {
- set level $arg
- set status FILE_1
- }
- {FILE_1} {
- set fileName [path_name base $arg]
- set fileType [path_name type $arg]
- set fv $fileName.$fileType
- set editorType $fileType
- set status END
- }
- {ID} {
- if [catch {set fv [CustomFileVersion new $arg]}] {
- usage
- }
- set editorType [[$fv customFile] type]
- set fileName [[$fv customFile] name]
- set level ""
- set status END
- }
- {default} {
- usage
- }
- }
- }
- }
- incr argc 1
- }
- if {$status != "END"} {
- usage
- }
-
- set iconTitle $fileName.$editorType
- case $editorType in {
- {mnu} {
- require "menueditor.tcl"
- MenuEditor new .main \
- -permanentReadOnly $readOnly \
- -title "$fileName - Menu Customization Editor" \
- -icon ctool_64 \
- -iconTitle $iconTitle
- set graphTypes [BrowserProcs::graphTypes]
- if {[lsearch -exact $graphTypes $fileName] != -1} {
- [.main editorArea] genericCurName diagram
- } else {
- [.main editorArea] genericCurName ""
- }
- lappend graphTypes "diagram"
- if {[lsearch -exact $graphTypes $fileName] != -1} {
- [.main editorArea] toolType editor
- } elseif {$fileName == "class"} {
- [.main editorArea] toolType class
- }
- }
- {vie} {
- require "vieweditor.tcl"
- ViewEditor new .main \
- -permanentReadOnly $readOnly \
- -title "View Customization Editor" \
- -icon ctool_64 \
- -iconTitle $iconTitle
- }
- {objtype} {
- require "objtypeedi.tcl"
- ObjTypeEditor new .main \
- -permanentReadOnly $readOnly \
- -title "Object Type Customization Editor" \
- -icon ctool_64 \
- -iconTitle $iconTitle
- }
- {opendefs} {
- require "opendefedi.tcl"
- OpenDefEditor new .main \
- -permanentReadOnly $readOnly \
- -title "Open Strategy Definition Editor" \
- -icon ctool_64 \
- -iconTitle $iconTitle
- }
- {openlocs} {
- require "openlocedi.tcl"
- OpenLocEditor new .main \
- -permanentReadOnly $readOnly \
- -title "Open Strategy Availability Editor" \
- -icon ctool_64 \
- -iconTitle $iconTitle
- }
- {propdefs} {
- require "propdefedi.tcl"
- PropDefEditor new .main \
- -permanentReadOnly $readOnly \
- -title "Property Definition Editor" \
- -icon ctool_64 \
- -iconTitle $iconTitle
- }
- {proplocs} {
- require "proplocedi.tcl"
- PropLocEditor new .main \
- -permanentReadOnly $readOnly \
- -title "Property Availability Editor" \
- -icon ctool_64 \
- -iconTitle $iconTitle
- }
- {modules} {
- require "moduleedit.tcl"
- ModuleEditor new .main \
- -permanentReadOnly $readOnly \
- -title "Module Availability Editor" \
- -icon ctool_64 \
- -iconTitle $iconTitle
- }
- {copyspecs} {
- require "copyspecse.tcl"
- CopySpecsEditor new .main \
- -permanentReadOnly $readOnly \
- -title "Copy Specifications Editor" \
- -icon ctool_64 \
- -iconTitle $iconTitle
- }
- {default} {
- wmtkfatal "Unknown customization file type specified"
- }
- }
-
- sourceOptional u_uce
-
- global icaseLevelInt
- set icaseLevelInt(corporate) 0
- set icaseLevelInt(project) 1
- set icaseLevelInt(configuration) 2
- set icaseLevelInt(phase) 3
- set icaseLevelInt(system) 4
-
- global icaseLevel
- set icaseLevel(0) corporate
- set icaseLevel(1) project
- set icaseLevel(2) configuration
- set icaseLevel(3) phase
- set icaseLevel(4) system
-
- .main setContext
- [.main menuHdlr] levelChanged
- if {"$level" != ""} {
- [.main editorArea] _level $level
- }
- .main config -caller "$caller" -firstExposed ".main edit $fv"
- .main popUp
- .main ready
-
-