Begining work with autocomplition procedure for variables
This commit is contained in:
parent
472ff86c2b
commit
a46c13788f
|
@ -12,6 +12,7 @@
|
|||
- Actualizing information into "About" dialog
|
||||
- Corrected color settings for all widgets
|
||||
- Change default color scheme
|
||||
- Remove ctag, change autocomplitt procedure
|
||||
|
||||
0.4.4
|
||||
|
||||
|
@ -361,5 +362,6 @@ Fixed bug with PageRise function
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -36,9 +36,10 @@ proc auto_completition { widget } {
|
|||
} ;# proc auto_completition
|
||||
|
||||
## PROCEDURE LIST ##
|
||||
## by BanZaj ##
|
||||
## by BanZaj ##
|
||||
|
||||
proc auto_completition_proc { widget } {
|
||||
global procList activeProject noteBook
|
||||
global procList activeProject noteBook varList
|
||||
set nodeEdit [$noteBook raise]
|
||||
if {$nodeEdit == "" || $nodeEdit == "newproj" || $nodeEdit == "about" || $nodeEdit == "debug"} {
|
||||
return
|
||||
|
@ -51,24 +52,29 @@ proc auto_completition_proc { widget } {
|
|||
set cnt 0
|
||||
set pos "1.0"
|
||||
set last_pos ""
|
||||
set pattern "$start_word\\w*"
|
||||
puts "$start_word"
|
||||
puts [regsub -all -- "\$" $start_word "\\\$" word]
|
||||
puts $word
|
||||
#set list_word($start_word) 1
|
||||
if [info exists procList($activeProject)] {
|
||||
set len [llength $procList($activeProject)]
|
||||
if {[string index $start_word 0] == "\$"} {
|
||||
set workList $varList($activeProject)
|
||||
} else {
|
||||
set workList $procList($activeProject)
|
||||
}
|
||||
if [info exists workList] {
|
||||
set len [llength $workList]
|
||||
} else {
|
||||
return
|
||||
}
|
||||
set i 0
|
||||
while {$len >=$i} {
|
||||
set line [lindex $procList($activeProject) $i]
|
||||
set line [lindex $ $i]
|
||||
scan $line "%s" word
|
||||
if [regexp -nocase -all -- {\s\{.*?\}+\s} $line par] {
|
||||
regsub -all (\{|\}) $par " " par
|
||||
set word_ "$word [string trim $par]"
|
||||
if {[string match "$start_word*" $word]} {set list_word($word_) $i}
|
||||
if {[string match "$start_word*" $word]} {
|
||||
set list_word($word) $i
|
||||
}
|
||||
incr i
|
||||
}
|
||||
}
|
||||
bindtags $widget [list CompletitionBind [winfo toplevel $widget] $widget Text sysAfter all]
|
||||
bind CompletitionBind <Escape> "bindtags $widget {[list [winfo toplevel $widget] $widget Text sysAfter all]}; catch { destroy .aCompletition }"
|
||||
bind CompletitionBind <Key> {auto_completition_key %W %K %A ; break}
|
||||
|
@ -165,3 +171,7 @@ proc auto_completition_key { widget K A } {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
13
editor.tcl
13
editor.tcl
|
@ -853,8 +853,8 @@ proc TextEncode {encode} {
|
|||
|
||||
## EDITING FILE ##
|
||||
proc EditFile {node fileName} {
|
||||
global projDir workDir imgDir tree noteBook fontNormal fontBold w fileList replace nodeEdit
|
||||
global backUpFileCreate fileExt progress editor braceHighLightBG braceHighLightFG
|
||||
global projDir workDir imgDir tree noteBook fontNormal fontBold w fileList replace nodeEdit procList
|
||||
global backUpFileCreate fileExt progress editor braceHighLightBG braceHighLightFG activeProject
|
||||
set nodeEdit $node
|
||||
set replace 0
|
||||
set file [file tail $fileName]
|
||||
|
@ -923,14 +923,22 @@ proc EditFile {node fileName} {
|
|||
} elseif {$keyWord == "class"} {
|
||||
set img "class.gif"
|
||||
}
|
||||
if {$keyWord =="proc"} {
|
||||
lappend procList($activeProject) [list $procName "param"]
|
||||
#$w.text tag add procName $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
|
||||
}
|
||||
if {[$tree exists $prcNode$dot$lineNumber] !=1} {
|
||||
$tree insert end $node $prcNode$dot$lineNumber -text $procName \
|
||||
-data "prc_$procName"\
|
||||
-image [Bitmap::get [file join $imgDir $img]] -font $fontNormal
|
||||
}
|
||||
}
|
||||
if {$keyWord =="set"} {
|
||||
lappend varList($activeProject) [list $procName "param"]]
|
||||
}
|
||||
incr lineNumber
|
||||
}
|
||||
#puts $procList
|
||||
close $file
|
||||
$w.text mark set insert 0.0
|
||||
$w.text see insert
|
||||
|
@ -1138,3 +1146,4 @@ GetOp
|
|||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -225,3 +225,4 @@ proc HighLightTCL {text line lineNumber node} {
|
|||
|
||||
|
||||
|
||||
|
||||
|
|
5
main.tcl
5
main.tcl
|
@ -385,8 +385,3 @@ $tree configure -redraw 1
|
|||
set activeProject ""
|
||||
focus -force $tree
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
18
msgcat.add
18
msgcat.add
|
@ -1,18 +0,0 @@
|
|||
÷ÏÔ ÐÉÝÁ ÄÌÑ ÒÁÚÍÙÛÌÅÎÉÊ. õÔÏÞÎÕ. üÔÏÔ ËÏÄ ÐÒÅÄÎÁÚÎÁÞÅÎ ÄÌÑ ÒÁÂÏÔÙ ÐÏÄ Win32 ÐÒÉ ÕÓÌÏ×ÉÉ, ÞÔÏ ×ÅÓÔØ ÔÅËÓÔ ÎÁÂÒÁÎ × koi8-r ËÏÄÉÒÏ×ËÅ. ëÁË ÅÇÏ ÄÏÄÅÌÁÔØ, ÄÕÍÁÀ, ÓÏÏÂÒÁÚÉÛØ ÓÁÍ:
|
||||
set lang ru
|
||||
set mc_source {
|
||||
mcset $lang "File" "æÁÊÌ"
|
||||
mcset $lang "New..." "îÏ×ÙÊ..."
|
||||
}
|
||||
|
||||
set mc_source [encoding convertto koi8-r $mc_source]
|
||||
set mc_source [encoding convertfrom cp1251 $mc_source]
|
||||
|
||||
eval $mc_source
|
||||
|
||||
++++++++++++++++++++++++++
|
||||
set mc_source [encoding convertto koi8-r $mc_source]
|
||||
set mc_source [encoding convertfrom [encoding system] $mc_source]
|
||||
|
||||
|
||||
|
|
@ -1115,3 +1115,5 @@ proc TextOperation {oper} {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -132,3 +132,4 @@ option add *Scrollbar.background $editor(bg) startupFile
|
|||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -53,3 +53,4 @@ proc GetTagList_ {tagFile} {
|
|||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user