home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1996
- #
- # File: @(#)config_vb.tcl /main/hindenburg/8
- # Author:
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)config_vb.tcl /main/hindenburg/8 18 Mar 1997 Copyright 1996 Cayenne Software Inc.
-
- source [m4_path_name tcl cginit.tcl]
-
- require wmt_util.tcl
- require machdep.tcl
-
- proc m4copyfile {dir custName {fsName ""}} {
- if {$fsName == ""} {
- set fsName $custName
- }
-
- if [file exists $fsName] {
- set sourcefile $fsName
- } else {
- set sourcefile [m4_path_name $dir $fsName]
- }
-
- set customFileV [findCustomizationFile $custName 1]
-
- $customFileV lockForWrite "Configure VB Environment"
-
- $customFileV upLoad $sourcefile
-
- $customFileV unlock
- }
-
- proc m4basedir {} {
- set clientContext [ClientContext::global]
-
- set configV [$clientContext currentConfig]
-
- if {[$configV isNil]} {
- return [m4_var get M4_home]
- }
-
- return [$configV path]
- }
-
- proc findCustomizationFile {fullName {create 0}} {
- set name [lindex [split $fullName .] 0]
- set type [lindex [split $fullName .] 1]
- set clientContext [ClientContext::global]
-
- set configV [$clientContext currentConfig]
-
- set customFileV [$configV findCustomFileVersion $name $type]
-
- if {$create && [$customFileV isNil]} {
- puts "Creating customization file '$fullName' at configuration level"
- set customFileV [$configV createCustomFileVersion $name $type]
- }
-
- return $customFileV
- }
-
- proc m4copydir {dir} {
- set save_dir [pwd]
- set subdir [location config $dir]
- if [catch {set cddir [m4_path_name $subdir ClassSet.cls]}] {
- return
- }
-
- set PhaseV [[ClientContext::global] currentPhase]
-
- cd [path_name directory $cddir]
-
- set base [m4basedir]
- set files [glob -nocomplain *]
- set dest [location [$PhaseV path] src]
- if {! [file exist $dest]} {
- mkdir -path [list $dest]
- }
- foreach file $files {
- puts "copying $file to $dest"
- copy_text_file $file [location $dest $file]
- }
- cd $save_dir
- }
-
- set cc [ClientContext::global]
- if {[[[$cc currentPhase] phase] type] != "ObjectDesign"} {
- m4copydir [location src VB]
- } else {
- require VisualBasicGUI.tcl
- }
-
-