Skip to content

Commit

Permalink
v3.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
aplsimple committed Nov 17, 2020
1 parent 9fd1a5f commit 6d6f367
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 86 deletions.
9 changes: 8 additions & 1 deletion apave.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -2356,7 +2356,14 @@ oo::class create ::apave::APave {
set addcomms {}
if {[set tooltip [::apave::getOption -tooltip {*}$attrs]] ne ""} {
my initTooltip
lappend addcomms [list baltip::tip $wdg $tooltip]
if {[set i [string first " -ATTR " $tooltip]]>0} {
set tooltip [string range $tooltip 1 end-1]
set tattrs [string range $tooltip $i+6 end]
set tooltip "{[string range $tooltip 0 $i-2]}"
} else {
set tattrs ""
}
lappend addcomms [list baltip::tip $wdg $tooltip {*}$tattrs]
lappend ::apave::_AP_VARS(TIMW) $wdg
set attrs [::apave::removeOptions $attrs -tooltip]
}
Expand Down
2 changes: 1 addition & 1 deletion apaveinput.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

package require Tk

package provide apave 3.2.1
package provide apave 3.2.2

source [file join [file dirname [info script]] apavedialog.tcl]

Expand Down
27 changes: 16 additions & 11 deletions baltip/baltip.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# License: MIT.
# _______________________________________________________________________ #

package provide baltip 0.8
package provide baltip 0.8.1

package require Tk

Expand Down Expand Up @@ -291,13 +291,13 @@ proc ::baltip::my::Show {w text force geo optvals} {
catch {wm attributes $win -alpha $data(-alpha)}
} else {
::baltip::my::Fade $win $aint [expr {round(1.0*$data(-pause)/$aint)}] \
0 Un $data(-alpha) 1
0 Un $data(-alpha) 1 $geo
}
if {$force} {
::baltip::my::Fade $win $aint $fint $icount {} $data(-alpha) 1
::baltip::my::Fade $win $aint $fint $icount {} $data(-alpha) 1 $geo
} else {
after $data(-pause) [list \
::baltip::my::Fade $win $aint $fint $icount {} $data(-alpha) 1]
::baltip::my::Fade $win $aint $fint $icount {} $data(-alpha) 1 $geo]
}
} else {
# just showing, no fading
Expand All @@ -308,7 +308,7 @@ proc ::baltip::my::Show {w text force geo optvals} {
}
#_____

proc ::baltip::my::Fade {w aint fint icount Un alpha show {geos ""}} {
proc ::baltip::my::Fade {w aint fint icount Un alpha show geo {geos ""}} {
# Fades/unfades the tip's window.
# w - the tip's window
# aint - interval for 'after'
Expand All @@ -317,25 +317,27 @@ proc ::baltip::my::Fade {w aint fint icount Un alpha show {geos ""}} {
# Un - if equal to "Un", unfades the tip
# alpha - value of -alpha option
# show - flag "show the window"
# geo - coordinates (+X+Y) of balloon
# geos - saved coordinates (+X+Y) of shown tip
# See also: FadeNext, UnFadeNext

update
if {[winfo exists $w]} {
after idle [list after $aint \
[list ::baltip::my::${Un}FadeNext $w $aint $fint $icount $alpha $show $geos]]
[list ::baltip::my::${Un}FadeNext $w $aint $fint $icount $alpha $show $geo $geos]]
}
}
#_____

proc ::baltip::my::FadeNext {w aint fint icount alpha show {geos ""}} {
proc ::baltip::my::FadeNext {w aint fint icount alpha show geo {geos ""}} {
# A step to fade the tip's window.
# w - the tip's window
# aint - interval for 'after'
# fint - interval for fading
# icount - counter of intervals
# alpha - value of -alpha option
# show - flag "show the window"
# geo - coordinates (+X+Y) of balloon
# geos - saved coordinates (+X+Y) of shown tip
# See also: Fade

Expand All @@ -345,28 +347,31 @@ proc ::baltip::my::FadeNext {w aint fint icount alpha show {geos ""}} {
if {![winfo exists $w]} return
lassign [split [wm geometry $w] +] -> X Y
if {$geos ne "" && $geos ne "+$X+$Y"} return
set al [expr {min($alpha,($fint+$icount*1.5)/$fint)}]
if {$icount<0} {
set al [expr {min($alpha,($fint+$icount*1.5)/$fint)}]
if {$al>0} {
if {[catch {wm attributes $w -alpha $al}]} {set al 0}
}
if {$al<=0 || ![winfo exists $w]} {
catch {destroy $w}
return
}
} elseif {$al>0 && $geo eq ""} {
catch {wm attributes $w -alpha $al}
}
Fade $w $aint $fint $icount {} $alpha $show +$X+$Y
Fade $w $aint $fint $icount {} $alpha $show $geo +$X+$Y
}
#_____

proc ::baltip::my::UnFadeNext {w aint fint icount alpha show {geos ""}} {
proc ::baltip::my::UnFadeNext {w aint fint icount alpha show geo {geos ""}} {
# A step to unfade the balloon's window.
# w - the tip's window
# aint - interval for 'after'
# fint - interval for fading
# icount - counter of intervals
# alpha - value of -alpha option
# show - not used (here just for compliance with Fade)
# geo - not used (here just for compliance with Fade)
# geos - not used (here just for compliance with Fade)
# See also: Fade

Expand All @@ -378,7 +383,7 @@ proc ::baltip::my::UnFadeNext {w aint fint icount alpha show {geos ""}} {
set show 0
}
if {[winfo exists $w] && $al<$alpha} {
Fade $w $aint $fint $icount Un $alpha 0
Fade $w $aint $fint $icount Un $alpha 0 $geo
}
}
#_____
Expand Down
2 changes: 1 addition & 1 deletion baltip/pkgIndex.tcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ifneeded baltip 0.8 [list source [file join $dir baltip.tcl]]
package ifneeded baltip 0.8.1 [list source [file join $dir baltip.tcl]]

namespace eval ::baltip {

Expand Down
15 changes: 10 additions & 5 deletions hl_tcl/hl_tcl.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# License: MIT.
# _______________________________________________________________________ #

package provide hl_tcl 0.7.2
package provide hl_tcl 0.7.3

# _______________ Common data of ::hl_tcl:: namespace ______________ #

Expand Down Expand Up @@ -390,14 +390,18 @@ proc ::hl_tcl::my::MemPos {txt} {

variable data
set ln [$txt index insert]
set updcurr [expr {![info exists data(CUR_POS,$txt)] || \
int($data(CUR_POS,$txt)) != int($ln)}]
set data(CUR_POS,$txt) $ln
set data(CUR_LEN,$txt) [$txt index end]
lassign [CountQSH $txt $ln] \
data(CNT_QUOTE,$txt) data(CNT_SLASH,$txt) data(CNT_COMMENT,$txt)
$txt tag remove tagBRACKET 1.0 end
$txt tag remove tagBRACKETERR 1.0 end
$txt tag remove tagCURLINE 1.0 end
$txt tag add tagCURLINE [list $ln linestart] [list $ln lineend]+1displayindices
if {[$txt tag ranges tagBRACKET] ne ""} {$txt tag remove tagBRACKET 1.0 end}
if {[$txt tag ranges tagBRACKETERR] ne ""} {$txt tag remove tagBRACKETERR 1.0 end}
if {$updcurr} {
$txt tag remove tagCURLINE 1.0 end
$txt tag add tagCURLINE [list $ln linestart] [list $ln lineend]+1displayindices
}
}
#_____

Expand Down Expand Up @@ -840,6 +844,7 @@ proc ::hl_tcl::hl_text {txt} {
$txt tag configure tagBRACKETERR -foreground white -background red
$txt tag configure tagCURLINE -background $clrCURL
$txt tag raise sel
$txt tag raise tagBRACKETERR
my::HighlightAll $txt
if {![info exists ::hl_tcl::my::data(BIND_TXT,$txt)]} {
bind $txt <KeyPress> [list + [namespace current]::my::MemPos $txt]
Expand Down
2 changes: 1 addition & 1 deletion hl_tcl/pkgIndex.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

package ifneeded hl_tcl 0.7.2 [list source [file join $dir hl_tcl.tcl]]
package ifneeded hl_tcl 0.7.3 [list source [file join $dir hl_tcl.tcl]]

# short intro (for Ruff! docs generator)

Expand Down
Loading

0 comments on commit 6d6f367

Please sign in to comment.