GoToLine procedure tuning

This commit is contained in:
Sergey Kalinin 2018-02-24 20:08:03 +03:00
parent 823591ae92
commit ea76af25d6
5 changed files with 24 additions and 12 deletions

View File

@ -14,7 +14,7 @@
####################################################################### #######################################################################
proc balloon { widget action args } { proc balloon { widget action args } {
global BALLOON global BALLOON fontNormal
switch -- $action { switch -- $action {
set { set {
@ -34,7 +34,8 @@ proc balloon { widget action args } {
array set attrFont [font actual fixed] array set attrFont [font actual fixed]
set attrFont(-size) [expr $attrFont(-size) - 2] set attrFont(-size) [expr $attrFont(-size) - 2]
eval pack [message .bubble.txt -aspect 5000 -bg lightyellow \ eval pack [message .bubble.txt -aspect 5000 -bg lightyellow \
-font [array get attrFont] -text [lindex $args 0]] -font $fontNormal -text [lindex $args 0]]
#-font [array get attrFont] -text [lindex $args 0]]
pack .bubble.txt pack .bubble.txt
wm transient .bubble . wm transient .bubble .
wm overrideredirect .bubble 1 wm overrideredirect .bubble 1
@ -77,3 +78,4 @@ proc raise_balloon {widget text} {
update update
} ;# proc raise_balloon } ;# proc raise_balloon

View File

@ -98,7 +98,13 @@ proc OverWrite {} {
## GOTO LINE DIALOG FORM ## ## GOTO LINE DIALOG FORM ##
proc GoToLine {} { proc GoToLine {} {
global noteBook fileList fontNormal global noteBook fileList fontNormal
# toolbar entry used #######
focus .frmTool.frmGoto.entGoTo
.frmTool.frmGoto.entGoTo delete 0 end
return
#############################
set node [$noteBook raise] set node [$noteBook raise]
if {$node == "newproj" || $node == "settings" || $node == "about" || $node == ""} { if {$node == "newproj" || $node == "settings" || $node == "about" || $node == ""} {
return return
} }
@ -654,7 +660,7 @@ proc EditFile {tree node fileName} {
} }
bind $text <Control-idiaeresis> GoToLine bind $text <Control-idiaeresis> GoToLine
#bind $text <Control-g> GoToLine #bind $text <Control-g> GoToLine
bind $text <Control-g> {focus .frmTool.frmGoto.entGoTo} bind $text <Control-g> {focus .frmTool.frmGoto.entGoTo; .frmTool.frmGoto.entGoTo delete 0 end}
bind $text <Control-agrave> Find bind $text <Control-agrave> Find
bind $text <Control-f> Find bind $text <Control-f> Find
bind $text <F3> {FindNext $w.text 1} bind $text <F3> {FindNext $w.text 1}
@ -966,5 +972,3 @@ proc ReadFileStructure {mod line lineNumber tree node} {
GetOp GetOp

View File

@ -424,3 +424,4 @@ if {[info exists workingProject]} {
} }

View File

@ -1,4 +1,4 @@
###################################################### ######################################################
# Tcl/Tk Project Manager # Tcl/Tk Project Manager
# Distributed under GNU Public License # Distributed under GNU Public License
# Author: Sergey Kalinin banzaj28@yandex.ru # Author: Sergey Kalinin banzaj28@yandex.ru
@ -79,16 +79,18 @@ proc GetMenu {m} {
-command {TextOperation uncomment} -command {TextOperation uncomment}
$m add separator $m add separator
$m add command -label [::msgcat::mc "Goto line"] -command GoToLine -font $fontNormal\ $m add command -label [::msgcat::mc "Goto line"] -command GoToLine -font $fontNormal -accelerator "Ctrl+g"
-accelerator "Ctrl+G" $m add separator
$m add command -label [::msgcat::mc "Find"] -command Find -font $fontNormal -accelerator "Ctrl+F" $m add command -label [::msgcat::mc "Find"] -command Find -font $fontNormal -accelerator "Ctrl+F"
$m add command -label [::msgcat::mc "Replace"] -command ReplaceDialog -font $fontNormal\ $m add command -label [::msgcat::mc "Replace"] -command ReplaceDialog -font $fontNormal\
-accelerator "Ctrl+R" -accelerator "Ctrl+R"
$m add cascade -label [::msgcat::mc "Encode"] -menu $m.encode -font $fontNormal $m add cascade -label [::msgcat::mc "Encode"] -menu $m.encode -font $fontNormal
set me [menu $m.encode -bg $editor(bg) -fg $editor(fg)] set me [menu $m.encode -bg $editor(bg) -fg $editor(fg)]
$me add command -label [::msgcat::mc "KOI8-R"] -command {TextEncode koi8-r} -font $fontNormal $me add command -label [::msgcat::mc "KOI8-R"] -command {TextEncode koi8-r} -font $fontNormal
$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

@ -70,7 +70,10 @@ proc GoToLineButton {w} {
-bg $editor(bg) -fg $editor(fg) -bg $editor(bg) -fg $editor(fg)
pack $w.text $w.entGoTo -side left -anchor nw -padx 2 -pady 2 pack $w.text $w.entGoTo -side left -anchor nw -padx 2 -pady 2
bind $w.entGoTo <Return> "+ToolBarGoToLineNumber $w" bind $w.entGoTo <Return> "+ToolBarGoToLineNumber $w"
balloon $w.entGoTo set [::msgcat::mc "Goto line"]
} }