Skip to content

Commit

Permalink
3.4.5b10
Browse files Browse the repository at this point in the history
  • Loading branch information
aplsimple committed Sep 29, 2021
1 parent 3d50333 commit 35863be
Show file tree
Hide file tree
Showing 10 changed files with 1,670 additions and 1,629 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Last changes:


Version `3.4.5b6 (22 Sep'21)`
Version `3.4.5b8 (26 Sep'21)`
- bugfix: font chooser's returned value (in Windows)
- at pressing Enter: "-", "*", "#" duplicated with indentation
- focused "opc" widget at mouse clicking
- TButtonWestHL ttk::style
- AwDark, AwLight color schemes instead of Dark and Celestial
- Dusk CS above Darcula, to align light and dark "themed" CS
- themePopup, themeNonThemed to touch a parent popup menu
Expand All @@ -23,7 +26,7 @@ Version `3.4.5b6 (22 Sep'21)`
- choosers' options (-initialdir, -initialfile, -defaultextension, -multiple)
- test2_pave.tcl got "theme" option
- menu/tool/status bars allow to set "# comment" to comment lines out
- hl_tcl package updated
- hl_tcl, bartabs packages updated


Version `3.4.4 (25 Aug'21)`
Expand Down
45 changes: 32 additions & 13 deletions apave.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ namespace eval ::apave {
dir {{} {}} \
fon {{} {}} \
clr {{} {}} \
fiL {{} {}} \
fiS {{} {}} \
diR {{} {}} \
foN {{} {}} \
clR {{} {}} \
dat {{} {}} \
sta {{} {}} \
too {{} {}} \
Expand Down Expand Up @@ -1073,11 +1078,11 @@ oo::class create ::apave::APave {
}
ent {set widget ttk::entry}
enT {set widget entry}
fil -
fis -
dir -
fon -
clr -
fil - fiL -
fis - fiS -
dir - diR -
fon - foN -
clr - clR -
dat -
sta -
too -
Expand Down Expand Up @@ -1386,6 +1391,7 @@ oo::class create ::apave::APave {
trace var $vname w \
"$w config -text \"\[[self] optionCascadeText \${$vname}\]\" ;\#"
lappend ::apave::_AP_VARS(_TRACED_$w) $vname
bind $w <ButtonPress> "+ focus $w"
return $w.m
}

Expand Down Expand Up @@ -1854,7 +1860,8 @@ oo::class create ::apave::APave {
}
set an [set entname {}]
lassign [my LowercaseWidgetName $name] n
switch -glob -- [my ownWName $n] {
set ownname [my ownWName $n]
switch -glob -nocase -- $ownname {
fil* {set chooser tk_getOpenFile}
fis* {set chooser tk_getSaveFile}
dir* {set chooser tk_chooseDirectory}
Expand Down Expand Up @@ -1923,9 +1930,15 @@ oo::class create ::apave::APave {
}
set entf [list $txtnam - - - - "pack -side left -expand 1 -fill both -in $inname" "$attrs1"]
} else {
set tname [my Transname Ent $name]
if {$entname ne ""} {append entname $tname}
append attrs1 " -callF2 {.ent .buT}"
if {[string range $ownname 0 2] in {fiL fiS diR foN clR}} {
set field cbx
set tname [my Transname Cbx $name]
} else {
set tname [my Transname Ent $name]
set field ent
}
if {$entname ne {}} {append entname $tname}
append attrs1 " -callF2 {.$field .buT}"
append wpar " -tname $tname"
set entf [list $tname - - - - "pack -side left -expand 1 -fill x -in $inname" "$attrs1 $tvar"]
}
Expand Down Expand Up @@ -2803,18 +2816,20 @@ oo::class create ::apave::APave {
set idx2 [$w index {insert lineend}]
set line [$w get $idx1 $idx2]
set nchars [my leadingSpaces $line]
set indent [string range $line 0 [expr {$nchars-1}]]
set ch [string index $line end]
set indent [string range $line 0 $nchars-1]
set ch1 [string range $line $nchars $nchars+1]
set islist [expr {$ch1 in {{* } {- } {# }}}]
set ch2 [string index $line end]
set idx1 [$w index insert]
set idx2 [$w index "$idx1 +1 line"]
set st2 [$w get "$idx2 linestart" "$idx2 lineend"]
if {$indent ne {} || $ch eq "\{" || $K eq {KP_Enter} || $st2 ne {}} {
if {$indent ne {} || $ch2 eq "\{" || $K eq {KP_Enter} || $st2 ne {} || $islist} {
set st1 [$w get "$idx1" "$idx1 lineend"]
if {[string index $st1 0] in [list \t { }]} {
# if space(s) are at the right, remove them at cutting
set n1 [my leadingSpaces $st1]
$w delete [$w index $idx1] [$w index "$idx1 +$n1 char"]
} elseif {$ch eq "\{" && $st1 eq {}} {
} elseif {$ch2 eq "\{" && $st1 eq {}} {
# indent + closing brace
if {$st2 eq {}} {
append indent $::apave::_AP_VARS(INDENT) \n $indent "\}"
Expand All @@ -2831,6 +2846,10 @@ oo::class create ::apave::APave {
set nchars [my leadingSpaces $st2]
set indent [string range $st2 0 [expr {$nchars-1}]]
}
if {$islist} {
set indent "$indent$ch1"
incr nchars 2
}
$w insert [$w index $idx1] \n$indent
::tk::TextSetCursor $w [$w index "$idx2 linestart +$nchars char"]
return -code break
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.4.5b6
package provide apave 3.4.5b10

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

Expand Down
Loading

0 comments on commit 35863be

Please sign in to comment.