home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)custmodobj.tcl /main/titanic/12
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)custmodobj.tcl /main/titanic/12 3 Oct 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- require "moduledb.tcl"
- # End user added include file section
-
- require "custdefsob.tcl"
-
- Class CustModObject : {CustDefsObject} {
- constructor
- method destructor
- method updateInfo
- method getRequiredElements
- method getConflictingElements
- method updateView
- method writeObject
- method infoList
- method open
- attribute longName
- attribute select-state
- attribute location
- attribute properties
- }
-
- constructor CustModObject {class this name specification} {
- set this [CustDefsObject::constructor $class $this $name $specification]
- # Start constructor user section
- $this smallIcon folder_16
- $this largeIcon folder_32
- $this conversionSet "MODULE id"
- $this id $this
-
- while {![lempty $specification]} {
- set key [lvarpop specification]
- $this $key [lvarpop specification]
- }
-
- $this updateInfo
-
- # End constructor user section
- return $this
- }
-
- method CustModObject::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this CustDefsObject::destructor
- }
-
- method CustModObject::updateInfo {this} {
- if {[$this select-state] == ""} {
- $this select-state on
- }
-
- if {[$this location] == ""} {
- set dir [path_name concat [m4_var get M4_home] modules]
- $this location [path_name concat $dir [$this name]]
- }
-
- set propDict [[ModuleDB::global] getModulePropDict [$this location]]
- $this properties $propDict
- if {[$propDict size] == 0} {
- $propDict set "Property File" "Empty or not found"
- } else {
- $this longName [$propDict set "longName"]
- $this type [$propDict set "type"]
- }
-
- if {[$this longName] == ""} {
- $this longName [$this name]
- }
-
- $this updateView
- }
-
- method CustModObject::getRequiredElements {this} {
-
- set requiredModules [[$this properties] set "requiredModules"]
- set requiredModuleTypes [[$this properties] set "requiredModuleTypes"]
-
- return [list $requiredModules $requiredModuleTypes]
- }
-
- method CustModObject::getConflictingElements {this} {
-
- set conflictingModules [[$this properties] set "conflictingModules"]
- set conflictingModuleTypes \
- [[$this properties] set "conflictingModuleTypes"]
-
- return [list $conflictingModules $conflictingModuleTypes]
- }
-
- method CustModObject::updateView {this} {
-
- if [$this editable] {
- set level "[$this specLevel] *"
- } else {
- set level [$this specLevel]
- }
-
- $this label "[$this longName]"
- set dt ""
- lappend dt [$this type]
- lappend dt [$this select-state]
- lappend dt $level
- lappend dt [$this location]
- $this details $dt
- }
-
- method CustModObject::writeObject {this fid} {
- set defaultDir [location [m4_var get M4_home] modules]
- set curDir [path_name directory [$this location]]
- if $win95 {
- set defaultDir [string tolower $defaultDir]
- set curDir [string tolower $curDir]
- }
- if {$defaultDir == $curDir} {
- set format "%-25s | %-15s"
- puts $fid [format $format "[$this name]" "[$this select-state]"]
- } else {
- set format "%-25s | %-15s | %s"
- set location [$this location]
- if $win95 {
- regsub -all {\\} $location {\\\\} location
- }
- puts $fid [format $format "[$this name]" \
- "[$this select-state]" "$location"]
- }
- }
-
- method CustModObject::infoList {this} {
-
- set props ""
- set propDict [$this properties]
- set propNames [[ModuleDB::global] getModulePropNames [$this location]]
- $propNames foreach name {
- if {$name == "longName"} {
- # Skip: this one is standard in the list already
- continue
- }
- lappend props [cap $name]
- lappend props [$propDict set $name]
- }
-
- return "{Long Name} \{[$this longName]\} \
- {Select State} \{[$this select-state]\} \
- Level \{[$this specLevel]\} \
- Location \{[$this location]\} \
- {} {} $props"
- }
-
- method CustModObject::open {this} {
- if {![$this editable]} {
- return
- }
-
- busy {
- [.main editorArea] addRequiredModules $this
- }
- }
-
- # Do not delete this line -- regeneration end marker
-
-