$widgetinsert end "[::msgcat::mc"Programfailed"]:$msg\n";
}else{
puts$msg
$widgetinsert end "\n-------------------------------------------------\n"
$widgetinsert end "[::msgcat::mc"Programfinishedsuccessfully"]\n"
}
}else{
$widgetinsert end [read$file]
}
while{[gets$f line]>=0}{
$widgetinsert end "$line\n"
puts$line
}
$widgetsee end
$widgettag add error 0.00.end
$widgetconfigure-state disabled
}
## INSERT TITLE INTO NEW FILE ##
proc InsertTitle {newFile type}{
global activeProject projDir workDir ver
puts"$newFile$type"
set year [clock format [clock scan "now"-base [clock seconds]]-format %Y]
if{$activeProject==""}{
set answer [tk_messageBox\
-message"[::msgcat::mc"Notfoundactiveproject"]"\
-type ok -icon warning\
-title[::msgcat::mc "Warning"]]
case$answer{
ok{return0}
}
}
set file [open[file join $workDir$activeProject.proj] r]
while{[gets$file line]>=0}{
scan$line"%s" keyWord
set string [string range $line[string first "\""$line][string last "\""$line]]
set string [string trim $string"\""]
if{$keyWord=="ProjectName"}{
set txtProjName "$string"
}
if{$keyWord=="ProjectFileName"}{
set txtProjFileName "$string"
}
if{$keyWord=="ProjectDirName"}{
set txtProjDirName "$string"
}
if{$keyWord=="ProjectInterp"}{
set txtProjInterp "$string"
}
if{$keyWord=="ProjectVersion"}{
set txtProjVersion "$string"
}
if{$keyWord=="ProjectRelease"}{
set txtProjRelease "$string"
}
if{$keyWord=="ProjectAuthor"}{
set txtProjAuthor "$string"
}
if{$keyWord=="ProjectEmail"}{
set txtProjEmail "$string"
}
if{$keyWord=="ProjectCompany"}{
set txtProjCompany "$string"
}
if{$keyWord=="ProjectHome"}{
set txtProjHome "$string"
}
}
if{$type=="html"}{
set fileTitle "<HTML>\n<HEAD>\n<METAhttp-equiv=Content-Typecontent=\"text/html;charset=koi8-r\">\n<METANAME=\"Author\"CONTENT=\"$txtProjAuthor\">\n<METANAME=\"GENERATOR\"CONTENT=\"CreatedbyTcl/TkProjectManager-$ver\">\n<TITLE></TITLE>\n</HEAD>\n<BODY>\n\n</BODY>\n</HTML>"
}elseif{$type=="tcl"}{
set fileTitle "#!$txtProjInterp\n######################################################\n#\t\t$txtProjName\n#\tDistributedunderGNUPublicLicense\n#Author:$txtProjAuthor$txtProjEmail\n#Copyright(c)\"$txtProjCompany\",$year,$txtProjHome\n######################################################\n"
}elseif{$type=="perl"||$type=="pl"}{
set fileTitle "######################################################\n#\t\t$txtProjName\n#\tDistributedunderGNUPublicLicense\n#Author:$txtProjAuthor$txtProjEmail\n#Copyright(c)\"$txtProjCompany\",$year,$txtProjHome\n######################################################\n"
}elseif{$type=="txt"}{
set fileTitle "#######################################################\n#\t\t$txtProjName\n#\tDistributedunderGNUPublicLicense\n#Author:$txtProjAuthor$txtProjEmail\n#Copyright(c)\"$txtProjCompany\",$year,$txtProjHome\n######################################################\n"
}elseif{$type=="rb"}{
set fileTitle "#!$txtProjInterp\n######################################################\n#\t\t$txtProjName\n#\tDistributedunderGNUPublicLicense\n#Author:$txtProjAuthor$txtProjEmail\n#Copyright(c)\"$txtProjCompany\",$year,$txtProjHome\n######################################################\n"
}elseif{$type=="java"}{
set fileTitle "/*\n*****************************************************\n*\t$txtProjName\n*\tDistributedunderGNUPublicLicense\n*Author:$txtProjAuthor$txtProjEmail\n*Homepage:$txtProjHome\n*****************************************************\n*/\n"
}elseif{$type=="for"}{
set fileTitle "*****************************************************\n*\t$txtProjName\n*\tDistributedunderGNUPublicLicense\n*Author:$txtProjAuthor$txtProjEmail\n*Homepage:$txtProjHome\n*****************************************************\n"
}elseif{$type=="ml"||$type=="mli"}{
set fileTitle "\(*****************************************************\n*\t$txtProjName\n*\tDistributedunderGNUPublicLicense\n*Author:$txtProjAuthor$txtProjEmail\n*Homepage:$txtProjHome\n*****************************************************\)\n"
}elseif{$type=="php"||$type=="phtml"}{
set fileTitle "<?\n////////////////////////////////////////////////////////////\n//\t$txtProjName\n//\tDistributedunderGNUPublicLicense\n//Author:$txtProjAuthor$txtProjEmail\n//Homepage:$txtProjHome\n////////////////////////////////////////////////////////////\n\n\n\n\n?>"
}elseif{$type=="tml"}{
set fileTitle "<!--\n######################################################\n#\t\t$txtProjName\n#\tDistributedunderGNUPublicLicense\n#Author:$txtProjAuthor$txtProjEmail\n#Copyright(c)\"$txtProjCompany\",$year,$txtProjHome\n######################################################\n-->\n"
}elseif{$type=="erl"}{
set fileTitle "%*****************************************************\n%\t$txtProjName\n%\tDistributedunderGNUPublicLicense\n%Author:$txtProjAuthor$txtProjEmail\n%Homepage:$txtProjHome\n%****************************************************\n"
}else{
set fileTitle "######################################################\n#\t\t$txtProjName\n#\tDistributedunderGNUPublicLicense\n#Author:$txtProjAuthor$txtProjEmail\n#Copyright(c)\"$txtProjCompany\",$year,$txtProjHome\n######################################################\n"