Fixed AutoComplite precedure for TCL/TK-projects

Added colored icon for main window
Fixed "Close all" procedure if opened files from projects and file browser
This commit is contained in:
Sergey Kalinin 2018-02-15 16:00:22 +03:00
parent 91fa85203b
commit b3da4421d8
10 changed files with 182 additions and 207 deletions

View File

@ -8,6 +8,9 @@
0.4.5
14.02.2018
- Added saving main window geometry into projman.conf file when close programm
- Fixed AutoComplite precedure for TCL/TK-projects
- Added colored icon for main window
- Fixed "Close all" procedure if opened files from projects and file browser
13.02.2018
- Added gray theme
@ -358,52 +361,3 @@ Fixed bug with PageRise function
- Fix error with select active project after creating new project
- Fix small error with delete project procedure
- Fix uncorrect cursor position counter into editor

12
TODO
View File

@ -6,16 +6,13 @@
##########################################################
1. GUI
- Запомнить размер и местоположение окна и при запуске соответсвенно устанавливать.
- one click tree procedure
- Поиск процедуры по файлам проекта
- added tcl-console
- added readline widget
- into settings dialog
-- on/off highligttning
-- on/off
- Add color scheme
- Переключение закладок с помощью Alt+> Alt+<
- перед первой фукнцией возможность перейти в начало документа, а после последней на конец
документа
- В статусбаре самый последнее поле (правое) где тест file saved уж
@ -26,12 +23,7 @@
- rpm spec file
- deb
4. Working with release (distribute)
- ftp received
5. Working with files
- open file dialog
- include internal cvs support
- search and replacement text into all projects files (ala grep)
6. Working with projects
@ -68,5 +60,3 @@
поддержка frink (автоформаттер)
нумерация строк

View File

@ -383,3 +383,7 @@ proc SetVarLang {lang} {

View File

@ -36,13 +36,13 @@ proc auto_completition { widget } {
## by BanZaj ##
proc auto_completition_proc { widget } {
global procList activeProject noteBook varList
global procList activeProject noteBook varList wishOpList
set nodeEdit [$noteBook raise]
if {$nodeEdit == "" || $nodeEdit == "newproj" || $nodeEdit == "about" || $nodeEdit == "debug"} {
return
}
#puts $procList()
set start_word [$widget get "insert - 1 chars wordstart" insert]
set start_word [string tolower [$widget get "insert - 1 chars wordstart" insert]]
set box [$widget bbox insert]
set box_x [expr [lindex $box 0] + [winfo rootx $widget] ]
set box_y [expr [lindex $box 1] + [winfo rooty $widget] + [lindex $box 3] ]
@ -55,23 +55,28 @@ proc auto_completition_proc { widget } {
#puts $word
#set list_word($start_word) 1
#puts $varList($activeProject)
puts $procList($activeProject)
if {[string index $start_word 0] == "\$"} {
set workList $varList($activeProject)
} else {
#puts $procList($activeProject)
#puts [lindex $wishOpList 0]
if {[info exists procList($activeProject)]} {
set workList $procList($activeProject)
}
if [info exists workList] {
set len [llength $workList]
} else {
return
}
set i 0
while {$len >=$i} {
set line [lindex $ $i]
set line [lindex $workList $i]
scan $line "%s" word
if {[string match "$start_word*" $word]} {
if {[string match "$start_word*" [string tolower $word]]} {
set list_word($word) $i
}
incr i
}
}
}
set i 0
while {$i <= [llength $wishOpList]} {
set word [lindex $wishOpList $i]
if {[string match "$start_word*" [string tolower $word]]} {
set list_word($word) $i
}
incr i
@ -176,6 +181,9 @@ proc auto_completition_key { widget K A } {

View File

@ -366,7 +366,8 @@ proc Replace {text incr} {
}
## FILE OPERATION ##
proc FileDialog {tree operation} {
global noteBook fontNormal fontBold fileList noteBook projDir activeProject imgDir editor
global noteBook noteBookFiles fontNormal fontBold
global fileList projDir activeProject imgDir editor
set dot "_"
set types {
{"Tcl files" {.tcl}}
@ -565,6 +566,8 @@ proc FileDialog {tree operation} {
} else {
focus -force $noteBook.f$node
}
set tree [GetTreeForNode $node]
focus $tree
$tree selection set $node
} else {
LabelUpdate .frmStatus.frmLine.lblLine ""
@ -577,6 +580,12 @@ proc FileDialog {tree operation} {
$noteBook raise [$noteBook page 0]
set nbNode [$noteBook raise]
set tree [GetTreeForNode $nbNode]
if {$tree eq ".frmBody.frmCat.noteBook.ffiles.frmTreeFiles.treeFiles"} {
$noteBookFiles raise files
} elseif {$tree eq ".frmBody.frmCat.noteBook.fprojects.frmTree.tree"} {
$noteBookFiles raise projects
}
while {$nbNode != ""} {
if {$nbNode == "newproj" || $nbNode == "settings" || $nbNode == "about" || $nbNode == "debug"} {
$noteBook delete $nbNode
@ -600,6 +609,7 @@ proc FileDialog {tree operation} {
cancel {return cancel}
}
}
set tree [GetTreeForNode $nbNode]
set nl [$tree nodes $nbNode 0 end]
if {$nl != ""} {
foreach n $nl {
@ -729,15 +739,17 @@ proc _PageTab {} {
}
## RAISED NOTEBOOK TAB IF CLICK MOUSE BUTTON ##
proc PageRaise {tree node} {
global noteBook fileList editor nodeEdit
global noteBook fileList editor nodeEdit noteBookFiles
#puts $node
$noteBook raise $node
set tree [GetTreeForNode $node]
if {$tree eq ".frmBody.frmCat.noteBook.ffiles.frmTreeFiles.treeFiles"} {
$noteBookFiles raise files
} elseif {$tree eq ".frmBody.frmCat.noteBook.fprojects.frmTree.tree"} {
$noteBookFiles raise projects
}
set nodeEdit [$noteBook raise]
#set nodeEdit $node
puts $node
puts $nodeEdit
if {$node == "newproj" || $node == "settings" || $node == "about" || $node == "debug"} {
return
} else {
@ -937,7 +949,7 @@ proc EditFile {tree node fileName} {
###################
if {[regexp -nocase -all -line -- {proc (.*) \{(.*)\}} $line match procName params]} {
set procList($activeProject) [list $procName [string trim $params]]
lappend procList($activeProject) [list $procName [string trim $params]]
puts "proc $procName $params"
}
if {[regexp -nocase -all -line -- {set (\w+)} $line match varName]} {
@ -1004,10 +1016,12 @@ proc EditFile {tree node fileName} {
bind $text <Control-igrave> "tk_textPaste $w.text;break"
bind $text <Control-v> {TextOperation paste; break}
bind $text <Control-adiaeresis> "auto_completition $text"
bind $text <Control-l> "auto_completition $text"
#bind $text <Control-adiaeresis> "auto_completition $text"
#bind $text <Control-l> "auto_completition $text"
bind $text <Control-icircumflex> "auto_completition_proc $text"
bind $text <Control-j> "auto_completition_proc $text"
#bind $text <Control-Tab> "auto_completition_proc $text"
bind $text <Control-q> Find
bind $text <Control-comma> {TextOperation comment}
bind $text <Control-period> {TextOperation uncomment}
@ -1256,6 +1270,13 @@ GetOp

View File

@ -16,6 +16,8 @@ if {[info exists topLevelGeometry]} {
wm title . "Tcl/Tk Project Manager $ver"
wm iconname . "Tcl/Tk Project Manager $ver"
image create photo icon -format png -file [file join $imgDir icons large projman.png]
wm iconphoto . icon
wm protocol . WM_DELETE_WINDOW Quit
wm overrideredirect . 0
wm positionfrom . user
@ -393,14 +395,3 @@ $tree configure -redraw 1
set activeProject ""
focus -force $tree

View File

@ -99,3 +99,4 @@ namespace eval pane {

View File

@ -906,3 +906,4 @@ proc InsertTitle {newFile type} {

View File

@ -565,3 +565,4 @@ proc GetTreeForNode {node} {
}

View File

@ -15,6 +15,7 @@ set ver "0.4.5"
package require BWidget
package require msgcat
set wishOpList [info commands]
## DO NOT EDIT THIS LINE! USE install.tcl SCRIPT ##
set rootDir "/usr"
set tclDir "/usr/bin"
@ -119,3 +120,6 @@ option add *NoteBook.fg $editor(fg) startupFile
option add *Listbox.foreground $editor(fg) startupFile
option add *Listbox.background $editor(bg) startupFile
option add *Scrollbar.background $editor(bg) startupFile