diff --git a/CHANGELOG b/CHANGELOG index b536d3d..aefc51e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,9 @@ - Fixed Add to project procedure - Fixed hot key Cntrl+S saved prosedure when saved opened file from File Browser - Refactoring all Tree procedures +- Added GoTo line into toolbar +- Fixed fileinfo update when tree one click +- Fixed bug with opened files have extention is a upper case 22.02.2018 - Refactoring Settigs procedure source code @@ -398,3 +401,4 @@ characters to the right of the insertion cursor. + diff --git a/errors b/errors index e69de29..3db057a 100644 --- a/errors +++ b/errors @@ -0,0 +1,4 @@ +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) diff --git a/lib/editor.tcl b/lib/editor.tcl index 353af36..2b82a0f 100644 --- a/lib/editor.tcl +++ b/lib/editor.tcl @@ -1,7 +1,7 @@ ########################################################### # Tcl/Tk Project Manager # # 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 # ########################################################### @@ -142,6 +142,18 @@ proc GoToLineNumber {text w} { Position $text .frmStatus.frmLine.lblLine } } +#.frmBody.frmWork.noteBook.f_home_svk_projects_tcl_projman_projman_conf.text +proc ToolBarGoToLineNumber {w} { + global noteBook + set lineNumber [$w.entGoTo get] + append text $noteBook .f [$noteBook raise] ".text" + catch { + focus $text + $text mark set insert $lineNumber.0 + $text see $lineNumber.0 + } + #Position ;#$text .frmStatus.frmLine.lblLine +} ## SEARCH DIALOG FORM ## set findHistory "" set findString "" @@ -579,13 +591,13 @@ proc EditFile {tree node fileName} { set replace 0 set file [file tail $fileName] set name [file rootname $file] - set fileExt [string range [file extension $fileName] 1 end] + set fileExt [string tolower [string range [file extension $fileName] 1 end]] set parentNode [$tree parent $node] set project [$tree itemcget $parentNode -data] # set w [$noteBook insert end $node -text "$file" -image [Bitmap::get [file join $imgDir [GetImage $fileName].gif]] \ #-background $editor(bg) -foreground $editor(fg)] set w [$noteBook insert end $node -text "$file" -image [Bitmap::get [file join $imgDir [GetImage $fileName].gif]]] - puts $w + #puts $w # create array with file names # if {[info exists fileList($node)] != 1} { set fileList($node) [list $fileName 0] @@ -641,7 +653,8 @@ proc EditFile {tree node fileName} { break } bind $text GoToLine - bind $text GoToLine + #bind $text GoToLine + bind $text {focus .frmTool.frmGoto.entGoTo} bind $text Find bind $text Find bind $text {FindNext $w.text 1} @@ -928,7 +941,7 @@ proc ReadFileStructure {mod line lineNumber tree node} { if {[regexp -nocase -all -line -- {proc (::|)(\w+)(::|)(\w+) \{(.*)\} \{} $line match v1 v2 v3 v4 params]} { set procName "$v1$v2$v3$v4" lappend procList($activeProject) [list $procName [string trim $params]] - puts "proc $procName $params" + #puts "proc $procName $params" } if {$keyWord == "proc" || $keyWord == "let" || $keyWord == "class" || $keyWord == "sub" || $keyWord == "function" || $keyWord == "fun" } { set dot "_" @@ -954,3 +967,4 @@ GetOp + diff --git a/lib/highlight/tcl.tcl b/lib/highlight/tcl.tcl index 0e027b2..753f220 100644 --- a/lib/highlight/tcl.tcl +++ b/lib/highlight/tcl.tcl @@ -67,12 +67,12 @@ proc HighLightTCL {text line lineNumber node} { #puts $workLine if {[regexp -nocase -all -line -- {proc (::|)(\w+)(::|-|_|)(\w+)(.+) \{(.*)\} \{} $workLine match v1 v2 v3 v4 v5 params]} { set word "$v1$v2$v3$v4$v5" - puts $word + #puts $word set length [string length $word] set startPos [string first [string trim $word] $line] #set endPos [expr $startPos + $length] set workLine [string range $workLine $length end] - puts "$length $startPos $endPos\n$workLine" + #puts "$length $startPos $endPos\n$workLine" $text tag add procName $lineNumber.$startPos $lineNumber.$endPos set startPos [expr $endPos + 1] } else { @@ -234,4 +234,3 @@ proc HighLightTCL {text line lineNumber node} { } } - diff --git a/lib/projects.tcl b/lib/projects.tcl index 5474567..a8a3e55 100644 --- a/lib/projects.tcl +++ b/lib/projects.tcl @@ -515,7 +515,7 @@ proc AddToProj {fileName mode workingTree} { set dir [file dirname $fullPath] set parentNode [$workingTree parent $node] } - #puts "$node $parentNode $workingTree $fullPath" + #puts ">>>>$node $parentNode $workingTree $fullPath" if {$type == "tcl"} { set img "tcl" @@ -549,12 +549,12 @@ proc AddToProj {fileName mode workingTree} { set dot "_" set name [file rootname $fileName] set ext [string range [file extension $fileName] 1 end] - set subNode "$name$dot$ext" - if {[$workingTree exists $subNode] == 1} { - puts $count - append subNode "_$count" - incr count + if {$ext ne "" } { + set subNode "$parentNode$dot$name$dot$ext" + } else { + set subNode "$parentNode$dot$name" } + #puts ">>>>$subNode" $workingTree insert end $parentNode $subNode -text $fileName \ -data [file join $dir $fileName] -open 1\ -image [Bitmap::get [file join $imgDir $img.gif]]\ @@ -1008,3 +1008,4 @@ proc InsertTitle {newFile type} { + diff --git a/lib/toolbar.tcl b/lib/toolbar.tcl index 4be0d74..1597d6a 100644 --- a/lib/toolbar.tcl +++ b/lib/toolbar.tcl @@ -46,8 +46,10 @@ proc CreateToolBar {} { set bboxHelp [ButtonBox .frmTool.bboxHelp -spacing 0 -padx 1 -pady 1 -bg $editor(bg)] add_toolbar_button $bboxHelp help.png {ShowHelp} [::msgcat::mc "Help"] - - pack $bboxFile [Separator] $bboxEdit [Separator] $bboxProj [Separator] $bboxHelp -side left -anchor w + # GoTo field + set frm [frame .frmTool.frmGoto -bg $editor(bg)] + GoToLineButton $frm + pack $bboxFile [Separator] $bboxEdit [Separator] $bboxProj [Separator] $bboxHelp [Separator] $frm -side left -anchor w } } @@ -60,5 +62,15 @@ proc add_toolbar_button {path icon command helptext} { -padx 1 -pady 1 -command $command -helptext $helptext } # Separator for toolbar +proc GoToLineButton {w} { + global noteBook fontNormal editor + label $w.text -text [::msgcat::mc "Line number"] -font $fontNormal \ + -bg $editor(bg) -fg $editor(fg) + entry $w.entGoTo -width 6 -validate key -validatecommand "ValidNumber %W %P" \ + -bg $editor(bg) -fg $editor(fg) + pack $w.text $w.entGoTo -side left -anchor nw -padx 2 -pady 2 + bind $w.entGoTo "+ToolBarGoToLineNumber $w" +} + diff --git a/lib/tree.tcl b/lib/tree.tcl index ed636ff..8814cb8 100644 --- a/lib/tree.tcl +++ b/lib/tree.tcl @@ -219,10 +219,10 @@ proc TreeOneClick {tree node} { return } } elseif {[file isfile $item] == 1 } { + LabelUpdate .frmStatus.frmHelp.lblHelp [FileAttr $item] if {[$noteBook index $node] != -1} { + PageRaise $tree $node if {[file exists $item] == 1} { - LabelUpdate .frmStatus.frmHelp.lblHelp [FileAttr $item] - PageRaise $tree $node } } } elseif {[string range $item 0 2] == "prc"} { @@ -341,3 +341,4 @@ proc FileNotePageRaise {nb s} { +