home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
cadeditor.tcl
< prev
next >
Wrap
Text File
|
1997-10-17
|
3KB
|
114 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)cadeditor.tcl /main/titanic/13
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)cadeditor.tcl /main/titanic/13 17 Oct 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
require cadpanel.tcl
require dropcadare.tcl
# End user added include file section
require "diagramedi.tcl"
Class CADEditor : {DiagramEditor} {
constructor
method destructor
method reinit
method checkLocalModel
}
constructor CADEditor {class this name} {
set this [DiagramEditor::constructor $class $this $name]
# Start constructor user section
$this menuHdlr [CustEdMenuHandler new {diagram cad} [$this moduleHdlr]]
[$this options] syntaxEntries {class data process}
$this title "Class Diagram Editor"
set cadPanel [CADPanel new $this.c.r.panel]
$this panel [$cadPanel symbPanel]
[$this panel] initialize cad
$this panel $cadPanel
DropCADArea new $this.c.r.cad -panX 0 -panY 0 \
-currentSymbol Select \
-doubleClicked "$this open" \
-destinationSet "CADDRAGOBJECT drop STRING dummy"
$this.c.r.cad ed $this
$this editorArea $this.c.r.cad
[$this editorArea] setSize 600 400
[$this editorArea] possibleOperationsChanged \
"$this enDisableMenuEntries"
$cadPanel area [$this editorArea]
$this createEdAreaPopUpMenu
$this setWindowGeometry cad
# End constructor user section
return $this
}
method CADEditor::destructor {this} {
# Start destructor user section
# End destructor user section
$this DiagramEditor::destructor
}
method CADEditor::reinit {this} {
$this DiagramEditor::reinit
[$this editorArea] systemVersion [[ClientContext::global] currentSystem]
[$this editorArea] configVersion [[ClientContext::global] currentConfig]
[$this options] initLook
[$this options] initShowVisibility
set area [.main editorArea]
if {[m4_var get M4_font_bold -context ude] != [$area boldFontSpec]} {
$area boldFontSpec [m4_var get M4_font_bold -context ude]
}
}
method CADEditor::checkLocalModel {this} {
set area [$this editorArea]
# Get selected components. Throw away "hidden" components.
set args ""
global hiddenCompTypes
foreach comp [$area getSelectedComponents] {
if {![info exists hiddenCompTypes([$comp type])]} {
if {[$comp type] != "cad_class" &&
[$comp type] != "cad_container"} {
$area releaseSelectedComponents
$this DiagramEditor::checkLocalModel
return
}
set nameItem [$comp nameItem]
if {$nameItem != ""} {
append args "-S [$nameItem name].cdm "
}
}
}
$area releaseSelectedComponents
if {$args == ""} {
set cc [ClientContext::global]
set file [[$cc currentFile] file]
append args "-S [$file name].[$file type] "
}
append args "-f check.tcl"
set script "[quoteIf [m4_path_name bin otsh$EXE_EXT]] $args"
set cmd [list $this startCommand mtool \
$script "" {Starting 'Check'} {0 0} 0]
if [[$this editorArea] isChanged] {
$this popupNotSaved $cmd
} else {
eval $cmd
}
}
# Do not delete this line -- regeneration end marker