Added procedure arguments into tree

Change read config procedure (error fixed)
Fixed error when project running
0.4.6
Sergey Kalinin 2018-03-06 12:55:04 +03:00
parent 53672ad0f3
commit 0c58139974
10 changed files with 61 additions and 34 deletions

View File

@ -6,6 +6,11 @@
########################################################## ##########################################################
0.4.5 0.4.5
06.03.2018
- Added procedure arguments into tree
- Change read config procedure (error fixed)
- Fixed error when project running
05.03.2018 05.03.2018
- Fixed "Add new file" toolbar button press - Fixed "Add new file" toolbar button press
- Fixed "Control+S" hotkey error - Fixed "Control+S" hotkey error
@ -412,3 +417,4 @@ characters to the right of the insertion cursor.

4
errors
View File

@ -1,4 +0,0 @@
Error in startup script: couldn't read file "/home/svk/projects/tcl/projman/lib/lib/main.tcl": no such file or directory
while executing
"source [file join $dataDir main.tcl]"
(file "/home/svk/projects/tcl/projman/projman.tcl" line 98)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 B

After

Width:  |  Height:  |  Size: 119 B

BIN
img/var.gif 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

View File

@ -2,7 +2,7 @@
# Tcl/Tk Project Manager # # Tcl/Tk Project Manager #
# all procedure file # # all procedure file #
# Copyright (c) "Sergey Kalinin", 2002, http://nuk-svk.ru # # Copyright (c) "Sergey Kalinin", 2002, http://nuk-svk.ru #
# Author: Sergey Kalinin banzaj28@yandex.ru # # Author: Sergey Kalinin banzaj28@yandex.ru #
########################################################### ###########################################################
## GETTING OPERATORS FOR COMPLITE PROCEDURE # ## GETTING OPERATORS FOR COMPLITE PROCEDURE #
proc GetOp {} { proc GetOp {} {
@ -610,8 +610,8 @@ proc EditFile {tree node fileName} {
#-background $editor(bg) -foreground $editor(fg)] #-background $editor(bg) -foreground $editor(fg)]
set w [$noteBook insert end $node -text "$file" -image [Bitmap::get [file join $imgDir [GetImage $fileName].gif]]] set w [$noteBook insert end $node -text "$file" -image [Bitmap::get [file join $imgDir [GetImage $fileName].gif]]]
#set lblEditFileFullPath [label $w.lblEditFileFullPath -text [regsub -all -- {/|\\} $fileName " > "] -anchor w] EditorFileNavigateMenu $w $fileName
#pack $lblEditFileFullPath -side top -fill x
#puts $w #puts $w
# create array with file names # # create array with file names #
if {[info exists fileList($node)] != 1} { if {[info exists fileList($node)] != 1} {
@ -932,7 +932,8 @@ proc ReadFileStructure {mod line lineNumber tree node} {
global projDir workDir imgDir noteBook fontNormal fontBold fileList replace nodeEdit procList global projDir workDir imgDir noteBook fontNormal fontBold fileList replace nodeEdit procList
global backUpFileCreate fileExt progress editor braceHighLightBG braceHighLightFG activeProject global backUpFileCreate fileExt progress editor braceHighLightBG braceHighLightFG activeProject
global varList global varList
set dot "_"
# Insert procedure names into tree # # Insert procedure names into tree #
regsub -all {\t} $line " " line regsub -all {\t} $line " " line
set w $noteBook.f$node set w $noteBook.f$node
@ -959,7 +960,6 @@ proc ReadFileStructure {mod line lineNumber tree node} {
#puts "proc $procName $params" #puts "proc $procName $params"
} }
if {$keyWord == "proc" || $keyWord == "let" || $keyWord == "class" || $keyWord == "sub" || $keyWord == "function" || $keyWord == "fun" } { if {$keyWord == "proc" || $keyWord == "let" || $keyWord == "class" || $keyWord == "sub" || $keyWord == "function" || $keyWord == "fun" } {
set dot "_"
set openBrace [string first "\{" $line] set openBrace [string first "\{" $line]
set closeBrace [expr [string first "\}" $line]-1] set closeBrace [expr [string first "\}" $line]-1]
set var [string range $line $openBrace end] set var [string range $line $openBrace end]
@ -971,15 +971,33 @@ proc ReadFileStructure {mod line lineNumber tree node} {
} }
if {[$tree exists $prcNode$dot$lineNumber] !=1} { if {[$tree exists $prcNode$dot$lineNumber] !=1} {
$tree insert end $node $prcNode$dot$lineNumber -text $procName \ $tree insert end $node $prcNode$dot$lineNumber -text $procName \
-data "prc_$procName"\ -data "prc_$procName" -font $fontNormal \
-image [Bitmap::get [file join $imgDir $img]] -font $fontNormal -image [Bitmap::get [file join $imgDir $img]]
#$tree insert end $prcNode$dot$lineNumber param_$prcNode$dot$lineNumber -text $params \ if {[info exists params] == 1 && $params ne ""} {
#-data "prc_$procName" \ foreach par $params {
#-image [Bitmap::get [file join $imgDir param.gif]] -font $fontNormal $tree insert end $prcNode$dot$lineNumber param_$prcNode$dot$lineNumber$dot$par \
-text $par -data "param_$procName$dot$par" -font $fontNormal \
-image [Bitmap::get [file join $imgDir param.gif]]
}
}
} }
} }
if {$keyWord == "set"} {
# set var $procName
# $tree insert end $node var$dot$lineNumber$dot$var \
# -text $var -data "var_$procName$dot$var" -font $fontNormal \
# -image [Bitmap::get [file join $imgDir var.gif]]
}
}
# View modern notebook tab header for edited file
# like as : "> dir1 > dir2 > file.tcl"
proc EditorFileNavigateMenu {w fullPathFile} {
set lblEditFileFullPath [label $w.lblEditFileFullPath -text [regsub -all -- {/|\\} $fullPathFile " > "] -anchor w]
pack $lblEditFileFullPath -side top -fill x -padx 2 -pady 3
} }
#################################### ####################################
GetOp GetOp

View File

@ -137,6 +137,17 @@ proc FileDialog {nbNode operation} {
# Progress start # Progress start
# LabelUpdate .frmStatus.frmProgress.lblProgress "[::msgcat::mc "Opened file in progress"]" # LabelUpdate .frmStatus.frmProgress.lblProgress "[::msgcat::mc "Opened file in progress"]"
set linesCount [$text count -lines $lineNumber.0 end] set linesCount [$text count -lines $lineNumber.0 end]
######## change the active tree if file opened from different tree ######
if {[$tree exists $node] == 0 && $tree eq ".frmBody.frmCat.noteBook.fprojects.frmTree.tree"} {
set tree .frmBody.frmCat.noteBook.ffiles.frmTreeFiles.treeFiles
} elseif {[$tree exists $node] == 0 && $tree eq ".frmBody.frmCat.noteBook.ffiles.frmTreeFiles.treeFiles" } {
set tree .frmBody.frmCat.noteBook.fprojects.frmTree.tree
} else {
return
}
########## end ########
foreach item [$tree nodes $node] { foreach item [$tree nodes $node] {
puts $item puts $item
$tree delete $item $tree delete $item
@ -611,12 +622,3 @@ proc FileOperation::FileDialog {tree operation} {
} }
} }

View File

@ -91,7 +91,3 @@ proc GetMenu {m} {
$me add command -label [::msgcat::mc "CP1251"] -command {TextEncode cp1251} -font $fontNormal $me add command -label [::msgcat::mc "CP1251"] -command {TextEncode cp1251} -font $fontNormal
$me add command -label [::msgcat::mc "CP866"] -command {TextEncode cp866} -font $fontNormal $me add command -label [::msgcat::mc "CP866"] -command {TextEncode cp866} -font $fontNormal
} }

View File

@ -885,6 +885,7 @@ proc MakeProj {action t} {
$w.frame.text tag add bold $lineNum.0 $lineNum.end $w.frame.text tag add bold $lineNum.0 $lineNum.end
# open and manipulate executed program chanel # # open and manipulate executed program chanel #
cd $projDirName
if {$action == "compile"} { if {$action == "compile"} {
set cmdCompile "" set cmdCompile ""
CompileOption "$projCompiler $prog" CompileOption "$projCompiler $prog"
@ -1010,3 +1011,4 @@ proc InsertTitle {newFile type} {

View File

@ -645,3 +645,4 @@ proc Settings {nBook} {
} }

View File

@ -64,7 +64,18 @@ if {[file exists [file join $workDir projman.conf]] == 0} {
file copy -force -- projman.conf [file join $workDir projman.conf] file copy -force -- projman.conf [file join $workDir projman.conf]
} }
source [file join $workDir projman.conf] #source [file join $workDir projman.conf]
# Read the projman.conf file and setting the variable
set config [open [file join $workDir projman.conf] RDONLY]
while {[gets $config line]>=0} {
if [regexp -nocase -all -line -- {(set)\s(.+)\s"(.+|)"} $line match op var data] {
regsub -all -- {\$env\(HOME\)} $data "$env(HOME)" data
regsub -all -- {\$workDir} $data "$workDir" data
set $var $data
}
}
## CREATE WORK DIR ## ## CREATE WORK DIR ##
if {[file exists $rpmDir] != 1} {file mkdir $rpmDir} if {[file exists $rpmDir] != 1} {file mkdir $rpmDir}
@ -160,8 +171,3 @@ option add *Dialog.msg.background $editor(bg)
# option add *Entry.highlightBackground $bg userDefault # option add *Entry.highlightBackground $bg userDefault
# option add *Text.HighlightThickness 2 userDefault # option add *Text.HighlightThickness 2 userDefault
# option add *Entry.HighlightThickness 1 userDefault # option add *Entry.HighlightThickness 1 userDefault