From 5d731c9e8e10ebd0cd518762ba38b81f38d8afb5 Mon Sep 17 00:00:00 2001 From: Alex Plotnikov Date: Wed, 13 Oct 2021 07:06:16 +0300 Subject: [PATCH] v1.0.5a6 --- CHANGELOG.md | 30 ++++- data/help/pref-nbk-f3.txt | 9 +- data/help/pref-nbk2-f2.txt | 5 +- data/help/pref-nbk2-f3.txt | 2 +- data/help/project.txt | 9 +- data/msgs/ru.msg | 32 +++--- doc/index.html | 2 +- lib/e_menu/e_menu.tcl | 5 +- lib/e_menu/src/apave.tcl | 26 +++-- lib/e_menu/src/apaveinput.tcl | 2 +- lib/e_menu/src/obbit.tcl | 88 +++++++------- lib/e_menu/src/pkgIndex.tcl | 2 +- lib/hl_tcl/hl_c.tcl | 14 +-- lib/hl_tcl/hl_tcl.tcl | 108 +++++++++--------- lib/hl_tcl/pkgIndex.tcl | 2 +- lib/pave/apave.tcl | 26 +++-- lib/pave/apaveinput.tcl | 2 +- lib/pave/obbit.tcl | 88 +++++++------- lib/pave/pkgIndex.tcl | 2 +- lib/theme/azure/theme/light.tcl | 7 +- lib/theme/azure/theme/light/tree-basic.png | Bin 149 -> 95 bytes lib/theme/azure/theme/light/tree-pressed.png | Bin 169 -> 95 bytes lib/theme/forest/forest-dark/tree-basic.png | Bin 149 -> 83 bytes lib/theme/forest/forest-dark/tree-pressed.png | Bin 95 -> 97 bytes lib/theme/forest/forest-light.tcl | 3 +- lib/theme/forest/forest-light/tree-basic.png | Bin 149 -> 83 bytes .../forest/forest-light/tree-pressed.png | Bin 168 -> 95 bytes lib/theme/sun-valley/sun-valley.tcl | 24 ++-- lib/theme/sun-valley/theme/light.tcl | 14 ++- .../sun-valley/theme/light/tree-basic.png | Bin 0 -> 95 bytes .../sun-valley/theme/light/tree-pressed.png | Bin 0 -> 95 bytes .../theme/light/treeheading-hover.png | Bin 338 -> 0 bytes .../theme/light/treeheading-pressed.png | Bin 318 -> 0 bytes .../theme/light/treeheading-rest.png | Bin 330 -> 0 bytes src/alited.tcl | 2 +- src/bar.tcl | 7 +- src/favor.tcl | 88 ++++++++++---- src/favor_ls.tcl | 6 +- src/file.tcl | 82 +++++++++++-- src/find.tcl | 3 +- src/ini.tcl | 3 + src/main.tcl | 11 +- src/msgs.tcl | 13 ++- src/pkgIndex.tcl | 2 +- src/pref.tcl | 35 ++---- src/project.tcl | 6 +- src/tool.tcl | 2 +- src/tree.tcl | 26 ++++- src/unit.tcl | 2 +- 49 files changed, 483 insertions(+), 307 deletions(-) create mode 100644 lib/theme/sun-valley/theme/light/tree-basic.png create mode 100644 lib/theme/sun-valley/theme/light/tree-pressed.png delete mode 100755 lib/theme/sun-valley/theme/light/treeheading-hover.png delete mode 100755 lib/theme/sun-valley/theme/light/treeheading-pressed.png delete mode 100644 lib/theme/sun-valley/theme/light/treeheading-rest.png mode change 100755 => 100644 src/tree.tcl diff --git a/CHANGELOG.md b/CHANGELOG.md index 0171e50..271ab81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,36 @@ # LAST CHANGES: -Version `1.0.4 (29 Sep'21)` +Version `1.0.5 (30 Oct'21)` - - TODO : save unit's position at any switching to another unit/file + - TODO : BUGFIX: demo 2.Units: favorites not passed to new project - FIX the demo + - TODO : NEW : basic .md highlighting: lists, titles, quotes + - TODO : NEW : more integrated with tclkits + - TODO : CHANGE: save unit's position at any switching to another unit/file (except for navigating inside a text, but including mouse clicks) + - TODO : CHANGE: revise help & doc + + - BUGFIX: demo 1.Start ~01:10 : 'All #1 1-0' in tip of 'Row', if 'No name' + - BUGFIX: demo 3.Project ~10:00 : not see for a current proc + - BUGFIX: switching (popup menu) from file to unit tree if the latter is one line + - BUGFIX: no updating icons at "Replace all in session" + - BUGFIX: no updating file tree at opening files from 'File / Open' + - BUGFIX: pressing Enter if current & next lines begin with *, -, # + - BUGFIX: false movings in the tree (no Ctrl+click, just click & move) + - BUGFIX: false saving modified files at "Tcl/Tk help" + - NEW : "Rename file" from the tree + - NEW : selected units to be added to Favorites (popup menu) + - NEW : "Don't ask again" checkbox at adding to Favorites + - NEW : "Your commands" for Tcl syntax + - CHANGE: faster switching tabs + - CHANGE: faster opening 'Preferences' + - CHANGE: faster opening a file from the file tree + - CHANGE: faster opening 'All Tcl Files' from the file tree + - CHANGE: hl_tcl, apave, e_menu packages + + +Version `1.0.4 (29 Sep'21)` + - BUGFIX: command autocompletion at 1st column failed - BUGFIX: e_menu could fail due to font2's multiple words - BUGFIX: Default buttons of Preferences didn't update colors properly diff --git a/data/help/pref-nbk-f3.txt b/data/help/pref-nbk-f3.txt index 2682935..7397237 100644 --- a/data/help/pref-nbk-f3.txt +++ b/data/help/pref-nbk-f3.txt @@ -17,10 +17,11 @@ - "Unit lines per 1 red bar" is a number of lines to mark a unit (proc/method) with 1 red bar in its icon; a fully red icon is bad! - - "Multi-line strings" is strongly recommended be OFF; it's only for - granular (with small source files) projects the ON value could be - a good choice as it can slow your work; use it on your own risk. + - "Multi-line strings" is recommended be OFF for projects with giant + files; it's only for granular (with small source files) projects + the ON value could be a good choice because it can slow your work; + use it on your own risk. If you don't want to use these defaults, switch the top checkbox off. While preparing a new project in "Projects" dialogue, you would input - its options in the "Options" tab. \ No newline at end of file + its options in the "Options" tab. diff --git a/data/help/pref-nbk2-f2.txt b/data/help/pref-nbk2-f2.txt index a78cbe9..6e1f041 100644 --- a/data/help/pref-nbk2-f2.txt +++ b/data/help/pref-nbk2-f2.txt @@ -6,4 +6,7 @@ appropriate constructs of Tcl. Use "Default" button to restore the default colors - for highlighting. \ No newline at end of file + for highlighting. + + At need, you can enter your own commands to highlight, + in the text field. They are highlighted as Tk ones. \ No newline at end of file diff --git a/data/help/pref-nbk2-f3.txt b/data/help/pref-nbk2-f3.txt index e033c07..eeccdfb 100644 --- a/data/help/pref-nbk2-f3.txt +++ b/data/help/pref-nbk2-f3.txt @@ -8,4 +8,4 @@ for highlighting. At need, you can enter your own key words to highlight, - in the text field. \ No newline at end of file + in the text field. They are highlighted as C++ ones. \ No newline at end of file diff --git a/data/help/project.txt b/data/help/project.txt index ed5e79f..18e7c2a 100644 --- a/data/help/project.txt +++ b/data/help/project.txt @@ -21,10 +21,11 @@ - "Unit lines per 1 red bar" is a number of lines to mark a unit (proc/method) with 1 red bar in its icon; a fully red icon is bad! - - "Multi-line strings" is strongly recommended be OFF; it's only for - granular (with small source files) projects the ON value could be - a good choice as it can slow your work; use it on your own risk. + - "Multi-line strings" is recommended be OFF for projects with giant + files; it's only for granular (with small source files) projects + the ON value could be a good choice because it can slow your work; + use it on your own risk. The buttons under the list are used to add / change / delete a project. At adding / changing a project, you can choose to include the current - files into it. Other choices are "replace", "clear" and "don't change". \ No newline at end of file + files into it. Other choices are "replace", "clear" and "don't change". diff --git a/data/msgs/ru.msg b/data/msgs/ru.msg index f571689..0276688 100644 --- a/data/msgs/ru.msg +++ b/data/msgs/ru.msg @@ -29,7 +29,7 @@ namespace eval ::alited { {Change EOL...} {Сменить EOL...} {Tools} {Снасти} {Setup} {Опции} - {Help} {Справка} + {Help} {Помощь} {Yes} {Да} {No} {Нет} {Cancel} {Отмена} @@ -57,7 +57,7 @@ namespace eval ::alited { {Look for Word} {Искать слово} {Run} {Запуск} {Moving} {Перемещение} - {Help of alited} {Справка alited} + {Help of alited} {Помощь alited} {Color Picker} {Выбор цвета} {Date Picker} {Выбор даты} {Screen Loupe} {Экранная лупа} @@ -81,14 +81,14 @@ namespace eval ::alited { {Line} {№ ст.} {Lines} {Строки} "All of \"%f\"" "Всё из \"%f\"" - {Not recommended!} {Не рекомендуется!} + "Not recommended for projects\nwith large files (>2000 LOC)!" "Не рекомендуется для проектов\nс большими файлами (>2000 строк)!" {Move Unit Up} {Поднять юнит} {Move Unit Down} {Опустить юнит} {Move File Up} {Переместить файл вверх} {Move File Down} {Переместить файл вниз} {Only files are moved by alited.} {Только файлы перемещает alited.} {Lists of Favorites} {Списки избранного} - {Last Visited} {Последние посещения} + {Last Visited} {Последние входы} {Switch to Unit Tree} {Перейти на список юнитов} {Switch to File Tree} {Перейти на список файлов} {Create File} {Создать файл} @@ -102,7 +102,7 @@ namespace eval ::alited { {Contract All} {Свернуть всё} {Expand All} {Развернуть всё} "Move %f\nto\n%d\n?" "Переместить %f\nв\n%d\n?" - {To Last Visited} {На последнее посещение} + {To Last Visited} {На последний вход} {To Matched Bracket} {На парную скобку} {Go to Line} {Перейти на строку} {Line number:} {Номер строки:} @@ -136,6 +136,8 @@ namespace eval ::alited { "File \"%f\" was modified by some application.\n\nCancel your edition and reload the file?" "Файл \"%f\" был изменен другим приложением.\n\nОтменить вашу редакцию и перезагрузить файл?" "File \"%f\" was deleted by some application.\n\nSave the file?" "Файл \"%f\" был удален другим приложением.\n\nСохранить файл?" {Tip File Info} {Данные о файлах} + {Rename File} {Переименовать файл} + {Select one file in the tree.} {Выберите один файл в списке.} } ## ________________________ Templates ________________________ ## @@ -225,19 +227,20 @@ namespace eval ::alited { {Non-favorite files to be:} {Файлы не Избранного должны} {kept} {остаться} {closed} {закрыться} - "Doesn't close any tab without favorites\nat choosing the favorites' list" "Не закрывать \"неизбранные\" закладки\nпри выборе списка Избранного" - "Closes all tabs without favorites\nat choosing the favorites' list" "Закрывать \"неизбранные\" закладки\nпри выборе списка Избранного" - "Sets a list of favorites\nthat was active initially." "Восстанавливает список Избранного,\nдействовавший вначале." + "Doesn't close any tab without favorites\nat choosing Favorites' list" "Не закрывать \"неизбранные\" закладки\nпри выборе списка Избранного" + "Closes all tabs without favorites\nat choosing Favorites' list" "Закрывать \"неизбранные\" закладки\nпри выборе списка Избранного" + "Sets a list of Favorites\nthat was active initially." "Восстанавливает список Избранного,\nдействовавший вначале." {Delete a favorites' list #%n ?} {Удалить список Избранного #%n ?} {Favorites} {Избранное} - "Add \"%n\" of %f\nto the favorites?" "Добавить \"%n\" файла %f\nв Избранное?" - "Item \"%n\" of %f\nis already in the favorites." "Юнит \"%n\" из %f\nуже есть в Избранном." - "Remove \"%n\" of %f\nfrom the favorites?" "Удалить \"%n\" файла %f\nиз Избранного?" + "Add \"%n\" of %f\nto Favorites?" "Добавить \"%n\" файла %f\nв Избранное?" + "Item \"%n\" of %f\nis already in Favorites." "Юнит \"%n\" из %f\nуже есть в Избранном." + "Remove \"%n\" of %f\nfrom Favorites?" "Удалить \"%n\" файла %f\nиз Избранного?" + "\"%n\" unit of %f\nis not in Favorites." "Юнит \"%n\" файла %f\nотсутствует в Избранном." {Add to Favorites} {Добавить в Избранное} {Remove from Favorites} {Удалить из Избранного} {Remove All} {Удалить всё} - {Remove all of the favorites?} {Удалить всё из Избранного?} - {Remove all of the last visited?} {Удалить всё из Последних посещений?} + {Remove all of Favorites?} {Удалить всё из Избранного?} + {Remove all of the last visited?} {Удалить всё из Последних входов?} } ## ________________________ Icons of toolbar: tips ________________________ ## @@ -360,7 +363,7 @@ namespace eval ::alited { {Current file} {Текущий файл} {All files} {Все файлы} {'Recent Files' length:} {Длина списка 'Недавние файлы':} - {'Last Visited' length:} {Длина списка 'Последние посещения':} + {'Last Visited' length:} {Длина списка 'Последние входы':} {Maximum of project files:} {Число файлов проекта не более:} {Confirm exit:} {Подтверждать выход:} {Save configuration on} {Сохранять конфигурацию при} @@ -419,6 +422,7 @@ namespace eval ::alited { {Color of return/goto:} {Цвет return/goto:} {Color of your key words:} {Цвет ваших ключевых слов:} {Colors} {Цвета} + {Your commands:} {Ваши команды:} {Your key words:} {Ваши ключевые слова:} } diff --git a/doc/index.html b/doc/index.html index 12e93be..3076f0e 100644 --- a/doc/index.html +++ b/doc/index.html @@ -470,7 +470,7 @@

Units

-The Last Visited list is a comrade of the favorites. It allows fast access to the last visited units. The last visits are registered at clicking units in the unit tree or at clicking found lines in the info listbox. +The Last Visited list is a comrade of Favorites. It allows fast access to the last visited units. The last visits are registered at clicking units in the unit tree or at clicking found lines in the info listbox.

diff --git a/lib/e_menu/e_menu.tcl b/lib/e_menu/e_menu.tcl index 96e93c6..7f0d492 100644 --- a/lib/e_menu/e_menu.tcl +++ b/lib/e_menu/e_menu.tcl @@ -27,7 +27,7 @@ package require Tk namespace eval ::em { - variable em_version "e_menu 3.4.5b10" + variable em_version "e_menu 3.4.5.3" variable solo [expr {[info exist ::em::executable] || ( \ [info exist ::argv0] && [file normalize $::argv0] eq [file normalize [info script]])} ? 1 : 0] variable Argv0 @@ -625,7 +625,8 @@ proc ::em::checkForShell {rsel} { set res yes } if {[string first "tclsh " $sel]==0 || [string first "wish " $sel]==0} { - set sel [append _ [Tclexe] [string range $sel [string first { } $sel] end]] + set tclexe [string map {wish.exe tclsh.exe} [Tclexe]] + set sel [append _ $tclexe [string range $sel [string first { } $sel] end]] } return $res } diff --git a/lib/e_menu/src/apave.tcl b/lib/e_menu/src/apave.tcl index 142097e..6034741 100755 --- a/lib/e_menu/src/apave.tcl +++ b/lib/e_menu/src/apave.tcl @@ -1643,8 +1643,8 @@ oo::class create ::apave::APave { } else { set dn [file dirname $fn] set fn [file tail $fn] - set args [::apave::removeOptions $args -initialdir] } + set dn [::apave::extractOptions args -initialdir $dn] set args "-initialfile \"$fn\" -initialdir \"$dn\" $parent $args" incr isfilename } elseif {$nchooser eq "tk_chooseDirectory"} { @@ -2828,7 +2828,7 @@ oo::class create ::apave::APave { 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"] + $w delete $idx1 [$w index "$idx1 +$n1 char"] } elseif {$ch2 eq "\{" && $st1 eq {}} { # indent + closing brace if {$st2 eq {}} { @@ -2846,11 +2846,13 @@ oo::class create ::apave::APave { set nchars [my leadingSpaces $st2] set indent [string range $st2 0 [expr {$nchars-1}]] } - if {$islist} { + if {$islist && ![string match *.0 $idx1] && \ + [string trim [$w get "$idx1 linestart" $idx1]] ne {}} { + # a new line supplied with "list-like pattern" set indent "$indent$ch1" incr nchars 2 } - $w insert [$w index $idx1] \n$indent + $w insert $idx1 \n$indent ::tk::TextSetCursor $w [$w index "$idx2 linestart +$nchars char"] return -code break } @@ -3158,9 +3160,10 @@ oo::class create ::apave::APave { set lst1 [lindex $lwidgets $i] if {[my Replace_Tcl i lwlen lwidgets {*}$lst1] ne ""} {incr i} } - set lwlen [llength $lwidgets] # firstly, normalize all names that are "subwidgets": .lab instead fra.lab etc - for {set i $lwlen} {$i} {incr i -1} { + set i [set lwlen [llength $lwidgets]] + while {$i>1} { + incr i -1 set lst1 [lindex $lwidgets $i] lassign $lst1 name neighbor lassign [my NormalizeName name i lwidgets] name wname @@ -3385,8 +3388,15 @@ oo::class create ::apave::APave { if {[set ontop [::apave::getOption -ontop {*}$args]] eq {}} { set ontop no catch { - set wpar [winfo parent $win] - set ontop [wm attributes $wpar -topmost] + set ontop [wm attributes [winfo parent $win] -topmost] + } + if {!$ontop} { + # find if a window child of "." is topmost + # if so, let this one be topmost too + foreach w [winfo children .] { + catch {set ontop [wm attributes $w -topmost]} + if {$ontop} break + } } } if {[set modal [::apave::getOption -modal {*}$args]] eq {}} { diff --git a/lib/e_menu/src/apaveinput.tcl b/lib/e_menu/src/apaveinput.tcl index b055d96..0b13e96 100644 --- a/lib/e_menu/src/apaveinput.tcl +++ b/lib/e_menu/src/apaveinput.tcl @@ -34,7 +34,7 @@ package require Tk -package provide apave 3.4.5b10 +package provide apave 3.4.5.4 source [file join [file dirname [info script]] apavedialog.tcl] diff --git a/lib/e_menu/src/obbit.tcl b/lib/e_menu/src/obbit.tcl index 7b404c9..c0d9b2c 100644 --- a/lib/e_menu/src/obbit.tcl +++ b/lib/e_menu/src/obbit.tcl @@ -44,54 +44,54 @@ namespace eval ::apave { fI bI --12-- bM fW bW itemHL2 tabHL #004...reserved... set ::apave::_CS_(ALL) { -{{ 0: AzureLight} "#050b0d" #050b0d #fff #e1e1df #002aaa #8dd9db #000 #444 grey #0e7b7c #000 #81cdcf - #d7d7d7 #000 #FBFB95 #e2e2e0 #ad0000 #004 #005 #006 #007} -{{ 1: ForestLight} "#050b0d" #050b0d #fff #e1e1df #004000 #A8CCA8 #000 #444 grey #217346 #000 #a8bda8 - #d7d7d7 #000 #FBFB95 #e2e2e0 #ad0000 #004 #005 #006 #007} -{{ 2: SunValleyLight} "#050b0d" #050b0d #fff #d9d9d9 #00469f #74c9ff #000 #444 grey #005fb8 #000 #7fcbff - #cccccc #000 #FBFB95 #e2e2e0 #950000 #004 #005 #006 #007} -{{ 3: AwLight} "#141414" #151616 #dfdfde #d1d1d0 #562222 #85b4e7 #000 #444 grey #1a497c #000 #7fb8ce - #bebebd #000 #FBFB96 #cacaca #a20000 #004 #005 #006 #007} +{{ 0: AwLight} "#141414" #151616 #dfdfde #d1d1d0 #562222 #85b4e7 #000 #444 grey #1a497c #000 #7fb8ce - #bebebd #000 #FBFB96 #cacaca #a20000 #004 #005 #006 #007} +{{ 1: AzureLight} "#050b0d" #050b0d #fff #e1e1e1 #002aaa #8dd9db #000 #444 grey #0e7b7c #000 #81cdcf - #cccccc #000 #FBFB95 #e2e2e0 #ad0000 #004 #005 #006 #007} +{{ 2: ForestLight} "#050b0d" #050b0d #fff #e1e1e1 #004000 #A8CCA8 #000 #444 grey #217346 #000 #a8bda8 - #cccccc #000 #FBFB95 #e2e2e0 #ad0000 #004 #005 #006 #007} +{{ 3: SunValleyLight} "#050b0d" #050b0d #fff #e1e1e1 #00469f #74c9ff #000 #444 grey #005fb8 #000 #7fcbff - #cccccc #000 #FBFB95 #e2e2e0 #950000 #004 #005 #006 #007} {{ 4: Grey1} "#050b0d" #050b0d #F8F8F8 #dadad8 #5c1616 #AFAFAF #000 #444 grey #933232 #000 #AFAFAF - #caccd0 #000 #FBFB95 #e0e0d8 #a20000 #004 #005 #006 #007} -{{ 5: Grey2} "#050b0d" #050b0d #e9e9e7 #F8F8F8 #5c1616 #b8b8b8 #000 #444 grey #933232 #000 #c1c1c1 - #e1e1df #000 #FBFB95 #d5d5d3 #a20000 #004 #005 #006 #007} +{{ 5: Grey2} "#050b0d" #050b0d #e9e9e7 #F8F8F8 #5c1616 #b8b8b8 #000 #444 grey #933232 #000 #c1c1c1 - #e1e1e1 #000 #FBFB95 #d5d5d3 #a20000 #004 #005 #006 #007} {{ 6: Rosy} "#2B122A" #000 #FFFFFF #F6E6E9 #570957 #C5ADC8 #000 #444 grey #870287 #000 #ceb6d1 - #e3d3d6 #000 #FBFB95 #e5e3e1 #a20000 #004 #005 #006 #007} {{ 7: Clay} "#000" #000 #fdf4ed #ded3cc #500a0a #bcaea2 #000 #444 grey #843500 #fff #9a8f83 - #d5c9c1 #000 #FBFB95 #e1dfde #a20000 #004 #005 #006 #007} {{ 8: Dawn} "#08085D" #030358 #FFFFFF #e3f9f9 #562222 #a3dce5 #000 #444 grey #933232 #000 #99d2db - #d3e9e9 #000 #FBFB96 #dbe9ed #a20000 #004 #005 #006 #007} {{ 9: Sky} "#102433" #0A1D33 #d0fdff #bdf6ff #562222 #95ced7 #000 #444 grey #933232 #000 #9ad3dc - #b1eaf3 #000 #FBFB95 #c0e9ef #a20000 #004 #005 #006 #007} -{{10: Florid} "#000" #004000 #e4fce4 #fff #5c1616 #93e493 #0F2D0F #444 grey #802e00 #004000 #a7f8a7 - #eefdee #000 #FBFB96 #d7e6d7 #a20000 #004 #005 #006 #007} -{{11: LightGreen} "#122B05" #091900 #edffed #DEF8DE #562222 #A8CCA8 #000 #444 grey #933232 #000 #A8CCA8 - #d0ead0 #000 #FBFB96 #dee9de #a20000 #004 #005 #006 #007} -{{12: InverseGreen} "#122B05" #091900 #cce6c8 #DEF8DE #562222 #9cc09c #000 #444 grey #933232 #000 #b5d9b5 - #cce6cc #000 #FBFB96 #bed8ba #a20000 #004 #005 #006 #007} -{{13: GreenPeace} "#001000" #001000 #e1ffdd #cadfca #562222 #9dbb99 #000 #444 grey #933232 #000 #9cb694 - #c1dfbd #000 #FBFB96 #d2e1d2 #a20000 #004 #005 #006 #007} -{{14: African} "#000" #000 #fff #ffffe7 #460000 #ffd797 #000 #6f2509 #7e7e7e #771d00 #000 #e6ae80 - #fffff9 #000 #eded89 #ededd5 #a20000 #004 #005 #006 #007} -{{15: African1} "#000" #000 #f5f5dd #f2ebd2 #460000 #ffc48a #000 #6f2509 #7e7e7e #771d00 #000 #e6ae80 - #fffce3 #000 #eded89 #e3e3cb #a20000 #004 #005 #006 #007} -{{16: African2} "#000" #000 #ffffe4 #eae7c0 #500a0a #eaac7a #000 #6f2509 grey #771d00 #00003c #e6ae80 - #f4f0ca #000 #fbfb74 #e7e7cb #a20000 #004 #005 #006 #007} -{{17: African3} "#000" #000 #fdf9d0 #d5d2af #500a0a #d59d6f #000 #6f2509 grey #771d00 #00003c #e6ae80 - #dedbb8 #000 #fbfb74 #e5e5cc #c10000 #004 #005 #006 #007} +{{10: Florid} "#000" #004000 #e4fce4 #fff #5c1616 #93e493 #0F2D0F #444 grey #802e00 #004000 #a7f8a7 - #d8e7d8 #000 #FBFB96 #d7e6d7 #a20000 #004 #005 #006 #007} +{{11: LightGreen} "#122B05" #091900 #edffed #DEF8DE #562222 #A8CCA8 #000 #444 grey #933232 #000 #A8CCA8 - #cde7cd #000 #FBFB96 #dee9de #a20000 #004 #005 #006 #007} +{{12: InverseGreen} "#122B05" #091900 #cce6c8 #DEF8DE #562222 #9cc09c #000 #444 grey #933232 #000 #b5d9b5 - #c9e3c9 #000 #FBFB96 #bed8ba #a20000 #004 #005 #006 #007} +{{13: GreenPeace} "#001000" #001000 #e1ffdd #cadfca #562222 #9dbb99 #000 #444 grey #933232 #000 #9cb694 - #b9d3b9 #000 #FBFB96 #d2e1d2 #a20000 #004 #005 #006 #007} +{{14: African} "#000" #000 #fff #ffffe7 #460000 #ffd797 #000 #6f2509 #7e7e7e #771d00 #000 #e6ae80 - #e7e7cf #000 #eded89 #ededd5 #a20000 #004 #005 #006 #007} +{{15: African1} "#000" #000 #f5f5dd #f2ebd2 #460000 #ffc48a #000 #6f2509 #7e7e7e #771d00 #000 #f2ebd2 - #e3dcc3 #000 #eded89 #e3e3cb #a20000 #004 #005 #006 #007} +{{16: African2} "#000" #000 #ffffe4 #eae7c0 #500a0a #eaac7a #000 #6f2509 grey #771d00 #00003c #e6ae80 - #dddab3 #000 #fbfb74 #e7e7cb #a20000 #004 #005 #006 #007} +{{17: African3} "#000" #000 #fdf9d0 #d5d2af #500a0a #d59d6f #000 #6f2509 grey #771d00 #00003c #e6ae80 - #c5c29f #000 #fbfb74 #e5e5cc #c10000 #004 #005 #006 #007} {{18: Yellowstone} "#00002f" #00003c #ffffd1 #cfcdb1 #591c0e #c89160 #000 #444 grey #771d00 #3b1516 #cfab86 - #c2c0a4 #000 #ffff45 #e6e6bb #a30000 #004 #005 #006 #007} {{19: Notebook} "#000" #000 #e9e1c8 #c2bca8 #460000 #d59d6f #000 #444 #7e7e7e #771d00 #000 #c09c77 - #d0cab6 #000 #eded89 #dad2b9 #a20000 #004 #005 #006 #007} {{20: Notebook1} "#000" #000 #dad2b9 #b5af9b #460000 #d59d6f #000 #444 #707070 #771d00 #000 #ba9671 - #c5bfab #000 #eded89 #ccc4ab #a20000 #004 #005 #006 #007} {{21: Notebook2} "#000" #000 #cdc5ac #a6a08c #460000 #d59d6f #000 #444 #606060 #771d00 #000 #cfab86 - #b4ae9a #000 #eded89 #c1b9a0 #980000 #004 #005 #006 #007} {{22: Notebook3} "#000" #000 #beb69d #96907c #460000 #d59d6f #000 #444 #505050 #771d00 #000 #cfab86 - #a6a08c #000 #eded89 #b2aa91 #7b1010 #004 #005 #006 #007} -{{23: Dusk} "#ececec" #ececec #1a1f21 #262b2d #f1b479 #6b7072 #000 #f4f49f #585d5f #ffbb6d #000 #6b7072 - #363b3d #000 #9e9e3a #23282a #ffabab #004 #005 #006 #007} -{{24: Darcula} "#ececec" #c7c7c7 #272727 #323232 #e98f1c #2F5692 #e1e1e1 #f4f49f grey #d18d3f #EDC881 #2a518d - #444444 #000 #a2a23e #343434 #f28787 #004 #005 #006 #007} -{{25: AzureDark} "#ececec" #c7c7c7 #272727 #393939 #28a7ff #007fff #FFF #f4f49f grey #33b2ff #EDC881 #0062a5 - #444444 #000 #a2a23e #404040 #ffc341 #004 #005 #006 #007} -{{26: ForestDark} "#ececec" #c7c7c7 #272727 #393939 #95bf95 #217346 #FFF #f4f49f grey #99c399 #ffffff #247649 - #444444 #000 #a2a23e #323232 #efaf6f #004 #005 #006 #007} -{{27: SunValleyDark} "#dfdfdf" #dddddd #131313 #252525 #38a9e0 #2f60d8 #FFF #f4f49f #6f6f6f #57c8ff #fff #2051c9 - #2d2d2d #000 #a2a23e #2a2a2a #efaf6f #004 #005 #006 #007} -{{28: AwDark} "#F0E8E8" #E7E7E7 #1f2223 #232829 #de9e5e #215d9c #fff #f4f49f grey #80bcfb #fff #134f8e - #313637 #000 #cdcd69 #292e2f #ffabab #004 #005 #006 #007} +{{23: Darcula} "#ececec" #c7c7c7 #272727 #323232 #e98f1c #2F5692 #e1e1e1 #f4f49f grey #d18d3f #EDC881 #2a518d - #444444 #000 #a2a23e #343434 #f28787 #004 #005 #006 #007} +{{24: Dusk} "#ececec" #ececec #1a1f21 #262b2d #f1b479 #6b7072 #000 #f4f49f #585d5f #ffbb6d #000 #6b7072 - #363b3d #000 #9e9e3a #23282a #ffabab #004 #005 #006 #007} +{{25: AwDark} "#F0E8E8" #E7E7E7 #1f2223 #232829 #de9e5e #215d9c #fff #f4f49f grey #80bcfb #fff #134f8e - #313637 #000 #cdcd69 #292e2f #ffabab #004 #005 #006 #007} +{{26: AzureDark} "#ececec" #c7c7c7 #272727 #393939 #28a7ff #007fff #FFF #f4f49f grey #33b2ff #EDC881 #0062a5 - #4a4a4a #000 #a2a23e #404040 #ffc341 #004 #005 #006 #007} +{{27: ForestDark} "#ececec" #c7c7c7 #272727 #393939 #95bf95 #217346 #FFF #f4f49f grey #99c399 #ffffff #247649 - #4a4a4a #000 #a2a23e #323232 #efaf6f #004 #005 #006 #007} +{{28: SunValleyDark} "#dfdfdf" #dddddd #131313 #252525 #38a9e0 #2f60d8 #FFF #f4f49f #6f6f6f #57c8ff #fff #2051c9 - #323232 #000 #a2a23e #2a2a2a #efaf6f #004 #005 #006 #007} {{29: Dark1} "#E0D9D9" #C4C4C4 #212121 #292929 #de9e5e #6c6c6c #000 #f4f49f #606060 #eda95b #000 #767676 - #363636 #000 #cdcd69 #292929 #ffabab #004 #005 #006 #007} -{{30: Dark2} "#bebebe" #bebebe #1f1f1f #262626 #de9e5e #6b6b6b #000 #f4f49f #616161 #eda95b #000 #767676 - #2b2b2b #000 #b0b04c #262626 #ffabab #004 #005 #006 #007} -{{31: Dark3} "#bebebe" #bebebe #0a0a0a #232323 #de9e5e #6a6a6a #000 #f4f49f #616161 #eda95b #000 #767676 - #1c1c1c #000 #bebe5a #131313 #ffabab #004 #005 #006 #007} -{{32: Oscuro} "#f1f1f1" #f1f1f1 #344545 #526d6d #f1b479 #728d8d #fff #f4f49f #afafaf #f7c475 #000 #94afaf - #4f6666 #000 #cdcd69 #3d4e4e #ffbcbc #004 #005 #006 #007} -{{33: Oscuro1} "#f1f1f1" #f1f1f1 #2a3b3b #466161 #e5a565 #6c8787 #fff #f4f49f #a2a2a2 #edba6b #000 #8ba6a6 - #4a6161 #000 #cdcd69 #354646 #ffbcbc #004 #005 #006 #007} -{{34: Oscuro2} "#f1f1f1" #f1f1f1 #223333 #3e5959 #de9e5e #668181 #fff #f4f49f #a2a2a2 #e4b162 #000 #819c9c - #3f5656 #000 #cdcd69 #2b3c3c #ffbcbc #004 #005 #006 #007} -{{35: Oscuro3} "#f1f1f1" #f1f1f1 #192a2a #355050 #de9e5e #5c7777 #fff #f4f49f #9e9e9e #dfac5d #000 #779292 - #364d4d #000 #cdcd69 #223333 #ffbcbc #004 #005 #006 #007} -{{36: MildDark} "#d2d2d2" #fff #222323 #384e66 #2ccaca #4b7391 #fff #00ffff #939393 #43e1e1 #000 #668eac - #2c4057 #000 #bebe5a #2b2c2c #ffa2a2 #004 #005 #006 #007} -{{37: MildDark1} "#d2d2d2" #fff #151616 #2D435B #2ac8c8 #436b89 #fff #00ffff grey #36d4d4 #000 #668eac - #24384f #000 #bebe5a #1f2020 #ffb0b0 #004 #005 #006 #007} -{{38: MildDark2} "#b4b4b4" #fff #0d0e0e #24384f #28c6c6 #3e6684 #fff #00ffff #757575 #33d1d1 #000 #668eac - #1a2f47 #000 #bebe5a #161717 #ffaeae #004 #005 #006 #007} -{{39: MildDark3} "#e2e2e2" #f1f1f1 #000 #1B3048 #27c5c5 #375f7d #fff #00ffff #6c6c6c #31d0d0 #000 #668eac - #11263e #000 #b0b04c #0f0f0f #ffafaf #004 #005 #006 #007} +{{30: Dark2} "#bebebe" #bebebe #1f1f1f #262626 #de9e5e #6b6b6b #000 #f4f49f #616161 #eda95b #000 #767676 - #323232 #000 #b0b04c #262626 #ffabab #004 #005 #006 #007} +{{31: Dark3} "#bebebe" #bebebe #0a0a0a #232323 #de9e5e #6a6a6a #000 #f4f49f #616161 #eda95b #000 #767676 - #303030 #000 #bebe5a #131313 #ffabab #004 #005 #006 #007} +{{32: Oscuro} "#f1f1f1" #f1f1f1 #344545 #526d6d #f1b479 #728d8d #fff #f4f49f #afafaf #f7c475 #000 #94afaf - #5d7474 #000 #cdcd69 #3d4e4e #ffbcbc #004 #005 #006 #007} +{{33: Oscuro1} "#f1f1f1" #f1f1f1 #2a3b3b #466161 #e5a565 #6c8787 #fff #f4f49f #a2a2a2 #edba6b #000 #8ba6a6 - #526969 #000 #cdcd69 #354646 #ffbcbc #004 #005 #006 #007} +{{34: Oscuro2} "#f1f1f1" #f1f1f1 #223333 #3e5959 #de9e5e #668181 #fff #f4f49f #a2a2a2 #e4b162 #000 #819c9c - #4c6363 #000 #cdcd69 #2b3c3c #ffbcbc #004 #005 #006 #007} +{{35: Oscuro3} "#f1f1f1" #f1f1f1 #192a2a #355050 #de9e5e #5c7777 #fff #f4f49f #9e9e9e #dfac5d #000 #779292 - #425959 #000 #cdcd69 #223333 #ffbcbc #004 #005 #006 #007} +{{36: MildDark} "#d2d2d2" #fff #222323 #384e66 #2ccaca #4b7391 #fff #00ffff #939393 #43e1e1 #000 #668eac - #455b73 #000 #bebe5a #2b2c2c #ffa2a2 #004 #005 #006 #007} +{{37: MildDark1} "#d2d2d2" #fff #151616 #2D435B #2ac8c8 #436b89 #fff #00ffff grey #36d4d4 #000 #668eac - #3a5068 #000 #bebe5a #1f2020 #ffb0b0 #004 #005 #006 #007} +{{38: MildDark2} "#b4b4b4" #fff #0d0e0e #24384f #28c6c6 #3e6684 #fff #00ffff #757575 #33d1d1 #000 #668eac - #33475e #000 #bebe5a #161717 #ffaeae #004 #005 #006 #007} +{{39: MildDark3} "#e2e2e2" #f1f1f1 #000 #1B3048 #27c5c5 #375f7d #fff #00ffff #6c6c6c #31d0d0 #000 #668eac - #2a3f57 #000 #b0b04c #0f0f0f #ffafaf #004 #005 #006 #007} {{40: Inkpot} "#d3d3ff" #AFC2FF #16161f #1E1E27 #de9e5e #6767a8 #000 #f4f49f #6e6e6e #ffbb6d #000 #8585c6 - #292936 #000 #a2a23e #202029 #ffa5a5 #004 #005 #006 #007} {{41: Quiverly} "#cdd8d8" #cdd8d8 #2b303b #333946 #de9e5e #6f7582 #000 #f4f49f #757575 #eda95b #000 #9197a4 - #414650 #000 #b0b04c #323742 #ffabab #004 #005 #006 #007} {{42: Monokai} "#f8f8f2" #f8f8f2 #353630 #4e5044 #f1b479 #707070 #000 #f4f49f #9a9a9a #ffbb6d #000 #777777 - #46473d #000 #cdcd69 #3c3d37 #ffabab #004 #005 #006 #007} -{{43: Desert} "#fff" #fff #47382d #5a4b40 #f1b479 #78695e #000 #f4f49f #a2a2a2 #ffbb6d #000 #7f7065 - #55463b #000 #eded89 #503f34 #ffabab #004 #005 #006 #007} +{{43: TKE Default} "#dbdbdb" #dbdbdb #000 #282828 #de9e5e #0a0acc #fff #f4f49f #6a6a6a #d3a85a #fff #0000d3 - #383838 #000 #b0b04c #0d0e0e #ffabab #004 #005 #006 #007} {{44: Magenta} "#E8E8E8" #F0E8E8 #381e44 #4A2A4A #f1b479 #846484 #000 #f4f49f grey #ffbb6d #000 #ad8dad - #573757 #000 #cdcd69 #42284e #ffabab #004 #005 #006 #007} -{{45: Red} "#fff" #e9e9e6 #340202 #440702 #f1b479 #b05e5e #000 #f4f49f #828282 #ffbb6d #000 #ba6868 - #3e0100 #000 #bebe5a #461414 #ffc1c1 #004 #005 #006 #007} -{{46: Chocolate} "#d6d1ab" #d6d1ab #251919 #402020 #de9e5e #664D4D #fff #f4f49f #828282 #c3984a #fff #583f3f - #361d1d #000 #b0b04c #2d2121 #ffb7b7 #004 #005 #006 #007} -{{47: TKE Default} "#dbdbdb" #dbdbdb #000 #282828 #de9e5e #0a0acc #fff #f4f49f #6a6a6a #d3a85a #fff #0000d3 - #383838 #000 #b0b04c #0d0e0e #ffabab #004 #005 #006 #007} +{{45: Red} "#fff" #e9e9e6 #340202 #440702 #f1b479 #b05e5e #000 #f4f49f #828282 #ffbb6d #000 #ba6868 - #521514 #000 #bebe5a #461414 #ffc1c1 #004 #005 #006 #007} +{{46: Chocolate} "#d6d1ab" #d6d1ab #251919 #402020 #de9e5e #664D4D #fff #f4f49f #828282 #c3984a #fff #583f3f - #432a2a #000 #b0b04c #2d2121 #ffb7b7 #004 #005 #006 #007} +{{47: Desert} "#fff" #fff #47382d #5a4b40 #f1b479 #78695e #000 #f4f49f #a2a2a2 #ffbb6d #000 #7f7065 - #695a4f #000 #eded89 #503f34 #ffabab #004 #005 #006 #007} } set ::apave::_CS_(initall) 1 set ::apave::_CS_(initWM) 1 @@ -1451,7 +1451,7 @@ oo::class create ::apave::ObjectTheming { } set fontdef [font actual apaveFontDef] # configuring themed widgets - foreach ts {TLabel TButton TCheckbutton TRadiobutton TNotebook.Tab} { + foreach ts {TLabel TButton TCheckbutton TRadiobutton} { my Ttk_style configure $ts -font $fontdef my Ttk_style configure $ts -foreground $tfg1 my Ttk_style configure $ts -background $tbg1 @@ -1465,14 +1465,14 @@ oo::class create ::apave::ObjectTheming { my Ttk_style configure TLabelframe.Label -background $tbg1 my Ttk_style configure TLabelframe.Label -font $fontdef foreach ts {TNotebook TFrame} { - my Ttk_style configure $ts -background $tbg1 + my Ttk_style map $ts -background [list focus $tbg1 !focus $tbg1] } foreach ts {TNotebook.Tab} { my Ttk_style configure $ts -font $fontdef if {[my apaveTheme]} { - my Ttk_style map $ts -foreground [list selected $tfgS active $tfg2] + my Ttk_style map $ts -foreground [list {selected !active} $tfgS {!selected !active} $tfgM active $tfg2 {selected active} $tfg2] } - my Ttk_style map $ts -background [list selected $tbgS {active disabled} $tbg1 active $tbg2] + my Ttk_style map $ts -background [list {selected !active} $tbgS {!selected !active} $tbgM {!selected active} $tbg2 {selected active} $tbg2] } foreach ts {TEntry Treeview TSpinbox TCombobox TCombobox.Spinbox TMatchbox TNotebook.Tab TScrollbar TScale} { my Ttk_style map $ts -lightcolor [list focus $bclr active $bclr] @@ -1525,6 +1525,8 @@ oo::class create ::apave::ObjectTheming { option add *Menu.font $fontdef my Ttk_style configure TMenubutton -foreground $tfgM my Ttk_style configure TMenubutton -background $tbgM + my Ttk_style configure TButton -foreground $tfgM + my Ttk_style configure TButton -background $tbgM foreach {nam clr} {back tbg2 fore tfg2 selectBack tbgS selectFore tfgS} { option add *Listbox.${nam}ground [set $clr] } @@ -1562,12 +1564,14 @@ oo::class create ::apave::ObjectTheming { set ::apave::_C_($ts,4) "-activebackground $tbgS" set ::apave::_C_($ts,5) "-disabledforeground $tfgD" set ::apave::_C_($ts,6) "-font {$fontdef}" - if {[my apaveTheme]} { - set ::apave::_C_($ts,7) {-borderwidth 2} - set ::apave::_C_($ts,8) {-relief raised} + if {[::iswindows]} { + set ::apave::_C_($ts,0) 6 + } elseif {[my apaveTheme]} { + set ::apave::_C_($ts,7) {-borderwidth 2} + set ::apave::_C_($ts,8) {-relief raised} } else { - set ::apave::_C_($ts,7) {-borderwidth 1} - set ::apave::_C_($ts,8) {-relief groove} + set ::apave::_C_($ts,7) {-borderwidth 1} + set ::apave::_C_($ts,8) {-relief groove} } if {[my csDarkEdit]} {set c white} {set c black} set ::apave::_C_($ts,9) "-selectcolor $c" diff --git a/lib/e_menu/src/pkgIndex.tcl b/lib/e_menu/src/pkgIndex.tcl index 2e31da7..a0d74df 100644 --- a/lib/e_menu/src/pkgIndex.tcl +++ b/lib/e_menu/src/pkgIndex.tcl @@ -1,5 +1,5 @@ -package ifneeded apave 3.4.5b10 [list source [file join $dir apaveinput.tcl]] +package ifneeded apave 3.4.5.4 [list source [file join $dir apaveinput.tcl]] # A short intro (for Ruff! docs generator:) diff --git a/lib/hl_tcl/hl_c.tcl b/lib/hl_tcl/hl_c.tcl index c7750c9..3d13f1a 100755 --- a/lib/hl_tcl/hl_c.tcl +++ b/lib/hl_tcl/hl_c.tcl @@ -542,6 +542,7 @@ proc ::hl_c::hl_init {txt args} { set args [lrange $args 1 end] } set ::hl_c::my::data(REG_TXT,$txt) {} ;# disables Modified at changing the text + set ::hl_c::my::data(KEYWORDS,$txt) {} foreach {opt val} {-dark 0 -readonly 0 -cmd {} -cmdpos {} -optRE 1 \ -multiline 1 -seen 500 -plaintext no -insertwidth 2 -keywords {}} { if {[dict exists $args $opt]} { @@ -680,15 +681,14 @@ proc ::hl_c::hl_line {txt} { # txt - text's path if {!$::hl_c::my::data(PLAINTEXT,$txt)} { - set ln [expr {int([$txt index insert])}] set tSTR [$txt tag ranges tagSTR] set tCMN [$txt tag ranges tagCMN] - if {$ln==1} { - set currQtd -1 - } else { - set currQtd [::hl_c::my::LineState $txt $tSTR $tCMN "$ln.0 -1 chars"] - } - ::hl_c::my::HighlightLine $txt $ln $currQtd + set ln0 [expr {int([$txt index insert])}] + set ln2 [expr {int([$txt index end])}] + set ln1 [expr {max (1,$ln0-1)}] + set ln2 [expr {min ($ln2,$ln0+1)}] + # update lines: previous, current, next + after idle "::hl_c::my::CoroRun $txt $ln1 $ln2" } ::hl_c::my::MemPos $txt yes $txt configure -insertwidth $::hl_c::my::data(INSERTWIDTH,$txt) diff --git a/lib/hl_tcl/hl_tcl.tcl b/lib/hl_tcl/hl_tcl.tcl index 2087005..0171339 100755 --- a/lib/hl_tcl/hl_tcl.tcl +++ b/lib/hl_tcl/hl_tcl.tcl @@ -7,7 +7,7 @@ # License: MIT. ########################################################### -package provide hl_tcl 0.9.22 +package provide hl_tcl 0.9.26 # ______________________ Common data ____________________ # @@ -37,7 +37,7 @@ namespace eval ::hl_tcl { pkg::create tcl::prefix \ http::config http::geturl http::formatQuery http::reset http::wait \ http::status http::size http::code http::ncode http::meta http::data \ - http::error http::cleanup http::register http::unregister \ + http::error http::cleanup http::register http::unregister * \ ]] # Ttk commands @@ -57,25 +57,28 @@ namespace eval ::hl_tcl { ] # Tk/ttk commands united - set data(CMD_TK) [lsort [concat $data(CMD_TTK) $data(CMD_TK2) [list \ + set data(CMD_TK) [concat $data(CMD_TTK) $data(CMD_TK2) [list \ button entry checkbutton radiobutton label menubutton menu wm winfo bind \ grid pack event bell text canvas frame listbox grab scale scrollbar \ labelframe focus font bindtags image selection toplevel destroy \ option options spinbox bitmap photo keysyms send lower clipboard colors \ console message cursors panedwindow place raise \ - ]]] + ]] # allowed edges of string (as one and only) - set data(S_LEFT) [list "\{" "\["] - set data(S_RIGHT) [list "\}" "\]"] + set data(S_LEFT) [list \{ \[] + set data(S_RIGHT) [list \} \]] # allowed edges of string (as one or both) - set data(S_SPACE) [list "" " " "\t" ";"] - set data(S_SPACE2) [concat $data(S_SPACE) [list "\{"]] - set data(S_BOTH) [concat $data(S_SPACE) [list "\"" "="]] + set data(S_SPACE) [list {} { } \t {;}] + set data(S_SPACE2) [concat $data(S_SPACE) [list \{]] + set data(S_BOTH) [concat $data(S_SPACE) [list \" \}]] - set data(RE0) {(^|[\{\}\[;])+\s*([:\w]+)([\s\}\];]|$){1}} - set data(RE1) {([\{\}\[;])+\s*([:\w]+)([\s\}\];]|$){1}} + set data(RE0) {(^|[\{\}\[;])+\s*([:\w*]+)(\s|\]|\}|\\|$)} + set data(RE1) {([\{\}\[;])+\s*([:\w*]+)(\s|\]|\}|\\|$)} set data(RE5) {(^|[^\\])(\[|\]|\$|\{|\})+} + + set data(LBR) {\{(\[} + set data(RBR) {\})\]} } } @@ -168,7 +171,7 @@ proc ::hl_tcl::my::HighlightCmd {txt line ln pri i} { $txt tag add tagCOM "$ln.$pri +$i1 char" "$ln.$pri +$i2 char" } elseif {[lsearch -exact -sorted $data(PROC_TCL) $c]>-1} { $txt tag add tagPROC "$ln.$pri +$i1 char" "$ln.$pri +$i2 char" - } elseif {[lsearch -exact -sorted $data(CMD_TK) $c]>-1} { + } elseif {[lsearch -exact -sorted $data(CMD_TK_EXP) $c]>-1} { $txt tag add tagCOMTK "$ln.$pri +$i1 char" "$ln.$pri +$i2 char" } } @@ -401,7 +404,7 @@ proc ::hl_tcl::my::CountQSH {txt ln} { set ln [expr {int($ln)}] set st [$txt get $ln.0 $ln.end] - return [list [CountChar $st "\""] [CountChar $st "\\"] [CountChar $st #]] + return [list [CountChar $st \"] [CountChar $st \\] [CountChar $st #]] } #_____ @@ -440,7 +443,7 @@ proc ::hl_tcl::my::MemPos1 {txt {donorm yes} {K ""} {s ""}} { # This fixes an issue with text cursor: less width at 0th column. variable data - if {$K eq "Home" && [string is digit -strict $s] && \ + if {$K eq {Home} && [string is digit -strict $s] && \ [expr {$s & 4}]==0 && [expr {$s & 1}]==0} { # Ctrl-Home & Shift-Home are passed set p1 [$txt index insert] @@ -458,7 +461,7 @@ proc ::hl_tcl::my::MemPos1 {txt {donorm yes} {K ""} {s ""}} { } set insLC [$txt index insert] lassign [split $insLC .] L C - if {$data(_INSPOS_,$txt) eq ""} { + if {$data(_INSPOS_,$txt) eq {}} { set L2 [set C2 0] } else { lassign [split $data(_INSPOS_,$txt) .] L2 C2 @@ -472,6 +475,7 @@ proc ::hl_tcl::my::MemPos1 {txt {donorm yes} {K ""} {s ""}} { } return $insLC } +#_____ proc ::hl_tcl::my::MemPos {txt {doit no}} { # Remembers the state of current line. @@ -648,10 +652,6 @@ proc ::hl_tcl::my::InRange {p1 p2 l {c -1}} { return [expr { \ ($l>=$l1 && $l<$l2 && $c>=$c1) || ($l>$l1 && $l<=$l2 && $c<=$c2) || ($l==$l1 && $l1==$l2 && $c>=$c1 && $c<=$c2) || ($l>$l1 && $l<$l2)}] - #set p [format "%09d%09d" $l $c] - #set p1 [format "%09d%09d" $l1 $c1] - #set p2 [format "%09d%09d" $l2 $c2] - #return [expr {$p>=$p1 && $p<=$p2}] } # doctest: #% ::hl_tcl::my::InRange 9.0 9.20 9.0 @@ -718,7 +718,7 @@ proc ::hl_tcl::my::LineState {txt tSTR tCMN l1} { set co1 [set co2 {}] while {$nl>1} { incr nl -1 - if {[set line [$txt get $nl.0 $nl.end]] ne ""} { + if {[set line [$txt get $nl.0 $nl.end]] ne {}} { if {$co2 eq {}} { set co2 [$txt index "$nl.end -1 char"] if {[string length $line]>1} { @@ -736,7 +736,7 @@ proc ::hl_tcl::my::LineState {txt tSTR tCMN l1} { set ch [$txt get $co2 "$co2 +1 chars"] set c [lindex [split [$txt index $co2] .] 1] if {![NotEscaped $line $c]} {set ch {}} - return [expr {$ch!="\"" && $f2 || $ch=="\"" && !$f1}] + return [expr {$ch ne {"} && $f2 || $ch eq {"} && !$f1}] } # is the end of line quoted? set line {} @@ -751,7 +751,7 @@ proc ::hl_tcl::my::LineState {txt tSTR tCMN l1} { if {![NotEscaped $line $c]} {set ch {}} set f1 [expr {[SearchTag $tSTR [$txt index $i1]]!=-1}] set f2 [expr {[SearchTag $tSTR [$txt index "$i1 +1 chars"]]!=-1}] - return [expr {$ch!="\"" && $f1 || $ch=="\"" && !$f2}] + return [expr {$ch ne {"} && $f1 || $ch eq {"} && !$f2}] } return 0 } @@ -884,28 +884,27 @@ proc ::hl_tcl::my::HighlightBrackets {w} { # Highlights matching brackets if any. # w - text widget's path + variable data set curpos [ShowCurrentLine $w] set curpos2 [$w index {insert -1 chars}] set ch [$w get $curpos] - set lbr "\{(\[" - set rbr "\})\]" - set il [string first $ch $lbr] - set ir [string first $ch $rbr] + set il [string first $ch $data(LBR)] + set ir [string first $ch $data(RBR)] set txt [split [$w get 1.0 end] \n] if {$il>-1} { set brcpos [MatchedBrackets $txt $curpos \ - [string index $lbr $il] [string index $rbr $il] 1] + [string index $data(LBR) $il] [string index $data(RBR) $il] 1] } elseif {$ir>-1} { set brcpos [MatchedBrackets $txt $curpos \ - [string index $rbr $ir] [string index $lbr $ir] -1] - } elseif {[set il [string first [$w get $curpos2] $lbr]]>-1} { + [string index $data(RBR) $ir] [string index $data(LBR) $ir] -1] + } elseif {[set il [string first [$w get $curpos2] $data(LBR)]]>-1} { set curpos $curpos2 set brcpos [MatchedBrackets $txt $curpos \ - [string index $lbr $il] [string index $rbr $il] 1] - } elseif {[set ir [string first [$w get $curpos2] $rbr]]>-1} { + [string index $data(LBR) $il] [string index $data(RBR) $il] 1] + } elseif {[set ir [string first [$w get $curpos2] $data(RBR)]]>-1} { set curpos $curpos2 set brcpos [MatchedBrackets $txt $curpos \ - [string index $rbr $ir] [string index $lbr $ir] -1] + [string index $data(RBR) $ir] [string index $data(LBR) $ir] -1] } else { return } @@ -935,20 +934,20 @@ proc ::hl_tcl::hl_readonly {txt {ro -1} {com2 ""}} { if {[info commands $newcom] eq ""} {rename $txt $newcom} set com "[namespace current]::my::Modified $txt" #if {$com2 ne ""} {append com " ; $com2"} - if {$ro} {proc ::$txt {args} " - switch -exact -- \[lindex \$args 0\] \{ - insert \{$com2\} - delete \{$com2\} - replace \{$com2\} - default \{ return \[eval $newcom \$args\] \} + if {$ro} {proc ::$txt {args} " \ + switch -exact -- \[lindex \$args 0\] \{ \ + insert \{$com2\} \ + delete \{$com2\} \ + replace \{$com2\} \ + default \{ return \[eval $newcom \$args\] \} \ \}" - } else {proc ::$txt {args} " - switch -exact -- \[lindex \$args 0\] \{ - delete \{$com {*}\$args\} - insert \{$com {*}\$args\} - replace \{$com {*}\$args\} - \} - set _res_ \[eval $newcom \$args\] + } else {proc ::$txt {args} " \ + switch -exact -- \[lindex \$args 0\] \{ \ + delete \{$com {*}\$args\} \ + insert \{$com {*}\$args\} \ + replace \{$com {*}\$args\} \ + \} ; \ + set _res_ \[eval $newcom \$args\] ; \ return \$_res_" } } @@ -975,8 +974,9 @@ proc ::hl_tcl::hl_init {txt args} { set args [lrange $args 1 end] } set ::hl_tcl::my::data(REG_TXT,$txt) {} ;# disables Modified at changing the text + set ::hl_tcl::my::data(KEYWORDS,$txt) {} foreach {opt val} {-dark 0 -readonly 0 -cmd {} -cmdpos {} -optRE 1 \ - -multiline 1 -seen 500 -plaintext no -insertwidth 2} { + -multiline 1 -seen 500 -plaintext no -insertwidth 2 -keywords {}} { if {[dict exists $args $opt]} { set val [dict get $args $opt] } elseif {$setonly} { @@ -984,6 +984,9 @@ proc ::hl_tcl::hl_init {txt args} { } set ::hl_tcl::my::data([string toupper [string range $opt 1 end]],$txt) $val } + set ::hl_tcl::my::data(CMD_TK_EXP) [lsort [list \ + {*}$::hl_tcl::my::data(CMD_TK) {*}$::hl_tcl::my::data(KEYWORDS,$txt)]] + unset ::hl_tcl::my::data(KEYWORDS,$txt) if {[dict exists $args -colors]} { set ::hl_tcl::my::data(COLORS,$txt) [dict get $args -colors] set ::hl_tcl::my::data(SETCOLORS,$txt) 1 @@ -1125,15 +1128,14 @@ proc ::hl_tcl::hl_line {txt} { # txt - text's path if {!$::hl_tcl::my::data(PLAINTEXT,$txt)} { - set ln [expr {int([$txt index insert])}] set tSTR [$txt tag ranges tagSTR] set tCMN [$txt tag ranges tagCMN] - if {$ln==1} { - set currQtd 0 - } else { - set currQtd [::hl_tcl::my::LineState $txt $tSTR $tCMN "$ln.0 -1 chars"] - } - ::hl_tcl::my::HighlightLine $txt $ln $currQtd + set ln0 [expr {int([$txt index insert])}] + set ln2 [expr {int([$txt index end])}] + set ln1 [expr {max (1,$ln0-1)}] + set ln2 [expr {min ($ln2,$ln0+1)}] + # update lines: previous, current, next + ::hl_tcl::my::RunCoroAfterIdle $txt $ln1 $ln2 no } ::hl_tcl::my::MemPos $txt yes $txt configure -insertwidth $::hl_tcl::my::data(INSERTWIDTH,$txt) diff --git a/lib/hl_tcl/pkgIndex.tcl b/lib/hl_tcl/pkgIndex.tcl index f6ae556..4f6e13b 100644 --- a/lib/hl_tcl/pkgIndex.tcl +++ b/lib/hl_tcl/pkgIndex.tcl @@ -1,5 +1,5 @@ -package ifneeded hl_tcl 0.9.22 [list source [file join $dir hl_tcl.tcl]] +package ifneeded hl_tcl 0.9.26 [list source [file join $dir hl_tcl.tcl]] # short intro (for Ruff! docs generator) diff --git a/lib/pave/apave.tcl b/lib/pave/apave.tcl index 142097e..6034741 100755 --- a/lib/pave/apave.tcl +++ b/lib/pave/apave.tcl @@ -1643,8 +1643,8 @@ oo::class create ::apave::APave { } else { set dn [file dirname $fn] set fn [file tail $fn] - set args [::apave::removeOptions $args -initialdir] } + set dn [::apave::extractOptions args -initialdir $dn] set args "-initialfile \"$fn\" -initialdir \"$dn\" $parent $args" incr isfilename } elseif {$nchooser eq "tk_chooseDirectory"} { @@ -2828,7 +2828,7 @@ oo::class create ::apave::APave { 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"] + $w delete $idx1 [$w index "$idx1 +$n1 char"] } elseif {$ch2 eq "\{" && $st1 eq {}} { # indent + closing brace if {$st2 eq {}} { @@ -2846,11 +2846,13 @@ oo::class create ::apave::APave { set nchars [my leadingSpaces $st2] set indent [string range $st2 0 [expr {$nchars-1}]] } - if {$islist} { + if {$islist && ![string match *.0 $idx1] && \ + [string trim [$w get "$idx1 linestart" $idx1]] ne {}} { + # a new line supplied with "list-like pattern" set indent "$indent$ch1" incr nchars 2 } - $w insert [$w index $idx1] \n$indent + $w insert $idx1 \n$indent ::tk::TextSetCursor $w [$w index "$idx2 linestart +$nchars char"] return -code break } @@ -3158,9 +3160,10 @@ oo::class create ::apave::APave { set lst1 [lindex $lwidgets $i] if {[my Replace_Tcl i lwlen lwidgets {*}$lst1] ne ""} {incr i} } - set lwlen [llength $lwidgets] # firstly, normalize all names that are "subwidgets": .lab instead fra.lab etc - for {set i $lwlen} {$i} {incr i -1} { + set i [set lwlen [llength $lwidgets]] + while {$i>1} { + incr i -1 set lst1 [lindex $lwidgets $i] lassign $lst1 name neighbor lassign [my NormalizeName name i lwidgets] name wname @@ -3385,8 +3388,15 @@ oo::class create ::apave::APave { if {[set ontop [::apave::getOption -ontop {*}$args]] eq {}} { set ontop no catch { - set wpar [winfo parent $win] - set ontop [wm attributes $wpar -topmost] + set ontop [wm attributes [winfo parent $win] -topmost] + } + if {!$ontop} { + # find if a window child of "." is topmost + # if so, let this one be topmost too + foreach w [winfo children .] { + catch {set ontop [wm attributes $w -topmost]} + if {$ontop} break + } } } if {[set modal [::apave::getOption -modal {*}$args]] eq {}} { diff --git a/lib/pave/apaveinput.tcl b/lib/pave/apaveinput.tcl index b055d96..0b13e96 100644 --- a/lib/pave/apaveinput.tcl +++ b/lib/pave/apaveinput.tcl @@ -34,7 +34,7 @@ package require Tk -package provide apave 3.4.5b10 +package provide apave 3.4.5.4 source [file join [file dirname [info script]] apavedialog.tcl] diff --git a/lib/pave/obbit.tcl b/lib/pave/obbit.tcl index 7b404c9..c0d9b2c 100644 --- a/lib/pave/obbit.tcl +++ b/lib/pave/obbit.tcl @@ -44,54 +44,54 @@ namespace eval ::apave { fI bI --12-- bM fW bW itemHL2 tabHL #004...reserved... set ::apave::_CS_(ALL) { -{{ 0: AzureLight} "#050b0d" #050b0d #fff #e1e1df #002aaa #8dd9db #000 #444 grey #0e7b7c #000 #81cdcf - #d7d7d7 #000 #FBFB95 #e2e2e0 #ad0000 #004 #005 #006 #007} -{{ 1: ForestLight} "#050b0d" #050b0d #fff #e1e1df #004000 #A8CCA8 #000 #444 grey #217346 #000 #a8bda8 - #d7d7d7 #000 #FBFB95 #e2e2e0 #ad0000 #004 #005 #006 #007} -{{ 2: SunValleyLight} "#050b0d" #050b0d #fff #d9d9d9 #00469f #74c9ff #000 #444 grey #005fb8 #000 #7fcbff - #cccccc #000 #FBFB95 #e2e2e0 #950000 #004 #005 #006 #007} -{{ 3: AwLight} "#141414" #151616 #dfdfde #d1d1d0 #562222 #85b4e7 #000 #444 grey #1a497c #000 #7fb8ce - #bebebd #000 #FBFB96 #cacaca #a20000 #004 #005 #006 #007} +{{ 0: AwLight} "#141414" #151616 #dfdfde #d1d1d0 #562222 #85b4e7 #000 #444 grey #1a497c #000 #7fb8ce - #bebebd #000 #FBFB96 #cacaca #a20000 #004 #005 #006 #007} +{{ 1: AzureLight} "#050b0d" #050b0d #fff #e1e1e1 #002aaa #8dd9db #000 #444 grey #0e7b7c #000 #81cdcf - #cccccc #000 #FBFB95 #e2e2e0 #ad0000 #004 #005 #006 #007} +{{ 2: ForestLight} "#050b0d" #050b0d #fff #e1e1e1 #004000 #A8CCA8 #000 #444 grey #217346 #000 #a8bda8 - #cccccc #000 #FBFB95 #e2e2e0 #ad0000 #004 #005 #006 #007} +{{ 3: SunValleyLight} "#050b0d" #050b0d #fff #e1e1e1 #00469f #74c9ff #000 #444 grey #005fb8 #000 #7fcbff - #cccccc #000 #FBFB95 #e2e2e0 #950000 #004 #005 #006 #007} {{ 4: Grey1} "#050b0d" #050b0d #F8F8F8 #dadad8 #5c1616 #AFAFAF #000 #444 grey #933232 #000 #AFAFAF - #caccd0 #000 #FBFB95 #e0e0d8 #a20000 #004 #005 #006 #007} -{{ 5: Grey2} "#050b0d" #050b0d #e9e9e7 #F8F8F8 #5c1616 #b8b8b8 #000 #444 grey #933232 #000 #c1c1c1 - #e1e1df #000 #FBFB95 #d5d5d3 #a20000 #004 #005 #006 #007} +{{ 5: Grey2} "#050b0d" #050b0d #e9e9e7 #F8F8F8 #5c1616 #b8b8b8 #000 #444 grey #933232 #000 #c1c1c1 - #e1e1e1 #000 #FBFB95 #d5d5d3 #a20000 #004 #005 #006 #007} {{ 6: Rosy} "#2B122A" #000 #FFFFFF #F6E6E9 #570957 #C5ADC8 #000 #444 grey #870287 #000 #ceb6d1 - #e3d3d6 #000 #FBFB95 #e5e3e1 #a20000 #004 #005 #006 #007} {{ 7: Clay} "#000" #000 #fdf4ed #ded3cc #500a0a #bcaea2 #000 #444 grey #843500 #fff #9a8f83 - #d5c9c1 #000 #FBFB95 #e1dfde #a20000 #004 #005 #006 #007} {{ 8: Dawn} "#08085D" #030358 #FFFFFF #e3f9f9 #562222 #a3dce5 #000 #444 grey #933232 #000 #99d2db - #d3e9e9 #000 #FBFB96 #dbe9ed #a20000 #004 #005 #006 #007} {{ 9: Sky} "#102433" #0A1D33 #d0fdff #bdf6ff #562222 #95ced7 #000 #444 grey #933232 #000 #9ad3dc - #b1eaf3 #000 #FBFB95 #c0e9ef #a20000 #004 #005 #006 #007} -{{10: Florid} "#000" #004000 #e4fce4 #fff #5c1616 #93e493 #0F2D0F #444 grey #802e00 #004000 #a7f8a7 - #eefdee #000 #FBFB96 #d7e6d7 #a20000 #004 #005 #006 #007} -{{11: LightGreen} "#122B05" #091900 #edffed #DEF8DE #562222 #A8CCA8 #000 #444 grey #933232 #000 #A8CCA8 - #d0ead0 #000 #FBFB96 #dee9de #a20000 #004 #005 #006 #007} -{{12: InverseGreen} "#122B05" #091900 #cce6c8 #DEF8DE #562222 #9cc09c #000 #444 grey #933232 #000 #b5d9b5 - #cce6cc #000 #FBFB96 #bed8ba #a20000 #004 #005 #006 #007} -{{13: GreenPeace} "#001000" #001000 #e1ffdd #cadfca #562222 #9dbb99 #000 #444 grey #933232 #000 #9cb694 - #c1dfbd #000 #FBFB96 #d2e1d2 #a20000 #004 #005 #006 #007} -{{14: African} "#000" #000 #fff #ffffe7 #460000 #ffd797 #000 #6f2509 #7e7e7e #771d00 #000 #e6ae80 - #fffff9 #000 #eded89 #ededd5 #a20000 #004 #005 #006 #007} -{{15: African1} "#000" #000 #f5f5dd #f2ebd2 #460000 #ffc48a #000 #6f2509 #7e7e7e #771d00 #000 #e6ae80 - #fffce3 #000 #eded89 #e3e3cb #a20000 #004 #005 #006 #007} -{{16: African2} "#000" #000 #ffffe4 #eae7c0 #500a0a #eaac7a #000 #6f2509 grey #771d00 #00003c #e6ae80 - #f4f0ca #000 #fbfb74 #e7e7cb #a20000 #004 #005 #006 #007} -{{17: African3} "#000" #000 #fdf9d0 #d5d2af #500a0a #d59d6f #000 #6f2509 grey #771d00 #00003c #e6ae80 - #dedbb8 #000 #fbfb74 #e5e5cc #c10000 #004 #005 #006 #007} +{{10: Florid} "#000" #004000 #e4fce4 #fff #5c1616 #93e493 #0F2D0F #444 grey #802e00 #004000 #a7f8a7 - #d8e7d8 #000 #FBFB96 #d7e6d7 #a20000 #004 #005 #006 #007} +{{11: LightGreen} "#122B05" #091900 #edffed #DEF8DE #562222 #A8CCA8 #000 #444 grey #933232 #000 #A8CCA8 - #cde7cd #000 #FBFB96 #dee9de #a20000 #004 #005 #006 #007} +{{12: InverseGreen} "#122B05" #091900 #cce6c8 #DEF8DE #562222 #9cc09c #000 #444 grey #933232 #000 #b5d9b5 - #c9e3c9 #000 #FBFB96 #bed8ba #a20000 #004 #005 #006 #007} +{{13: GreenPeace} "#001000" #001000 #e1ffdd #cadfca #562222 #9dbb99 #000 #444 grey #933232 #000 #9cb694 - #b9d3b9 #000 #FBFB96 #d2e1d2 #a20000 #004 #005 #006 #007} +{{14: African} "#000" #000 #fff #ffffe7 #460000 #ffd797 #000 #6f2509 #7e7e7e #771d00 #000 #e6ae80 - #e7e7cf #000 #eded89 #ededd5 #a20000 #004 #005 #006 #007} +{{15: African1} "#000" #000 #f5f5dd #f2ebd2 #460000 #ffc48a #000 #6f2509 #7e7e7e #771d00 #000 #f2ebd2 - #e3dcc3 #000 #eded89 #e3e3cb #a20000 #004 #005 #006 #007} +{{16: African2} "#000" #000 #ffffe4 #eae7c0 #500a0a #eaac7a #000 #6f2509 grey #771d00 #00003c #e6ae80 - #dddab3 #000 #fbfb74 #e7e7cb #a20000 #004 #005 #006 #007} +{{17: African3} "#000" #000 #fdf9d0 #d5d2af #500a0a #d59d6f #000 #6f2509 grey #771d00 #00003c #e6ae80 - #c5c29f #000 #fbfb74 #e5e5cc #c10000 #004 #005 #006 #007} {{18: Yellowstone} "#00002f" #00003c #ffffd1 #cfcdb1 #591c0e #c89160 #000 #444 grey #771d00 #3b1516 #cfab86 - #c2c0a4 #000 #ffff45 #e6e6bb #a30000 #004 #005 #006 #007} {{19: Notebook} "#000" #000 #e9e1c8 #c2bca8 #460000 #d59d6f #000 #444 #7e7e7e #771d00 #000 #c09c77 - #d0cab6 #000 #eded89 #dad2b9 #a20000 #004 #005 #006 #007} {{20: Notebook1} "#000" #000 #dad2b9 #b5af9b #460000 #d59d6f #000 #444 #707070 #771d00 #000 #ba9671 - #c5bfab #000 #eded89 #ccc4ab #a20000 #004 #005 #006 #007} {{21: Notebook2} "#000" #000 #cdc5ac #a6a08c #460000 #d59d6f #000 #444 #606060 #771d00 #000 #cfab86 - #b4ae9a #000 #eded89 #c1b9a0 #980000 #004 #005 #006 #007} {{22: Notebook3} "#000" #000 #beb69d #96907c #460000 #d59d6f #000 #444 #505050 #771d00 #000 #cfab86 - #a6a08c #000 #eded89 #b2aa91 #7b1010 #004 #005 #006 #007} -{{23: Dusk} "#ececec" #ececec #1a1f21 #262b2d #f1b479 #6b7072 #000 #f4f49f #585d5f #ffbb6d #000 #6b7072 - #363b3d #000 #9e9e3a #23282a #ffabab #004 #005 #006 #007} -{{24: Darcula} "#ececec" #c7c7c7 #272727 #323232 #e98f1c #2F5692 #e1e1e1 #f4f49f grey #d18d3f #EDC881 #2a518d - #444444 #000 #a2a23e #343434 #f28787 #004 #005 #006 #007} -{{25: AzureDark} "#ececec" #c7c7c7 #272727 #393939 #28a7ff #007fff #FFF #f4f49f grey #33b2ff #EDC881 #0062a5 - #444444 #000 #a2a23e #404040 #ffc341 #004 #005 #006 #007} -{{26: ForestDark} "#ececec" #c7c7c7 #272727 #393939 #95bf95 #217346 #FFF #f4f49f grey #99c399 #ffffff #247649 - #444444 #000 #a2a23e #323232 #efaf6f #004 #005 #006 #007} -{{27: SunValleyDark} "#dfdfdf" #dddddd #131313 #252525 #38a9e0 #2f60d8 #FFF #f4f49f #6f6f6f #57c8ff #fff #2051c9 - #2d2d2d #000 #a2a23e #2a2a2a #efaf6f #004 #005 #006 #007} -{{28: AwDark} "#F0E8E8" #E7E7E7 #1f2223 #232829 #de9e5e #215d9c #fff #f4f49f grey #80bcfb #fff #134f8e - #313637 #000 #cdcd69 #292e2f #ffabab #004 #005 #006 #007} +{{23: Darcula} "#ececec" #c7c7c7 #272727 #323232 #e98f1c #2F5692 #e1e1e1 #f4f49f grey #d18d3f #EDC881 #2a518d - #444444 #000 #a2a23e #343434 #f28787 #004 #005 #006 #007} +{{24: Dusk} "#ececec" #ececec #1a1f21 #262b2d #f1b479 #6b7072 #000 #f4f49f #585d5f #ffbb6d #000 #6b7072 - #363b3d #000 #9e9e3a #23282a #ffabab #004 #005 #006 #007} +{{25: AwDark} "#F0E8E8" #E7E7E7 #1f2223 #232829 #de9e5e #215d9c #fff #f4f49f grey #80bcfb #fff #134f8e - #313637 #000 #cdcd69 #292e2f #ffabab #004 #005 #006 #007} +{{26: AzureDark} "#ececec" #c7c7c7 #272727 #393939 #28a7ff #007fff #FFF #f4f49f grey #33b2ff #EDC881 #0062a5 - #4a4a4a #000 #a2a23e #404040 #ffc341 #004 #005 #006 #007} +{{27: ForestDark} "#ececec" #c7c7c7 #272727 #393939 #95bf95 #217346 #FFF #f4f49f grey #99c399 #ffffff #247649 - #4a4a4a #000 #a2a23e #323232 #efaf6f #004 #005 #006 #007} +{{28: SunValleyDark} "#dfdfdf" #dddddd #131313 #252525 #38a9e0 #2f60d8 #FFF #f4f49f #6f6f6f #57c8ff #fff #2051c9 - #323232 #000 #a2a23e #2a2a2a #efaf6f #004 #005 #006 #007} {{29: Dark1} "#E0D9D9" #C4C4C4 #212121 #292929 #de9e5e #6c6c6c #000 #f4f49f #606060 #eda95b #000 #767676 - #363636 #000 #cdcd69 #292929 #ffabab #004 #005 #006 #007} -{{30: Dark2} "#bebebe" #bebebe #1f1f1f #262626 #de9e5e #6b6b6b #000 #f4f49f #616161 #eda95b #000 #767676 - #2b2b2b #000 #b0b04c #262626 #ffabab #004 #005 #006 #007} -{{31: Dark3} "#bebebe" #bebebe #0a0a0a #232323 #de9e5e #6a6a6a #000 #f4f49f #616161 #eda95b #000 #767676 - #1c1c1c #000 #bebe5a #131313 #ffabab #004 #005 #006 #007} -{{32: Oscuro} "#f1f1f1" #f1f1f1 #344545 #526d6d #f1b479 #728d8d #fff #f4f49f #afafaf #f7c475 #000 #94afaf - #4f6666 #000 #cdcd69 #3d4e4e #ffbcbc #004 #005 #006 #007} -{{33: Oscuro1} "#f1f1f1" #f1f1f1 #2a3b3b #466161 #e5a565 #6c8787 #fff #f4f49f #a2a2a2 #edba6b #000 #8ba6a6 - #4a6161 #000 #cdcd69 #354646 #ffbcbc #004 #005 #006 #007} -{{34: Oscuro2} "#f1f1f1" #f1f1f1 #223333 #3e5959 #de9e5e #668181 #fff #f4f49f #a2a2a2 #e4b162 #000 #819c9c - #3f5656 #000 #cdcd69 #2b3c3c #ffbcbc #004 #005 #006 #007} -{{35: Oscuro3} "#f1f1f1" #f1f1f1 #192a2a #355050 #de9e5e #5c7777 #fff #f4f49f #9e9e9e #dfac5d #000 #779292 - #364d4d #000 #cdcd69 #223333 #ffbcbc #004 #005 #006 #007} -{{36: MildDark} "#d2d2d2" #fff #222323 #384e66 #2ccaca #4b7391 #fff #00ffff #939393 #43e1e1 #000 #668eac - #2c4057 #000 #bebe5a #2b2c2c #ffa2a2 #004 #005 #006 #007} -{{37: MildDark1} "#d2d2d2" #fff #151616 #2D435B #2ac8c8 #436b89 #fff #00ffff grey #36d4d4 #000 #668eac - #24384f #000 #bebe5a #1f2020 #ffb0b0 #004 #005 #006 #007} -{{38: MildDark2} "#b4b4b4" #fff #0d0e0e #24384f #28c6c6 #3e6684 #fff #00ffff #757575 #33d1d1 #000 #668eac - #1a2f47 #000 #bebe5a #161717 #ffaeae #004 #005 #006 #007} -{{39: MildDark3} "#e2e2e2" #f1f1f1 #000 #1B3048 #27c5c5 #375f7d #fff #00ffff #6c6c6c #31d0d0 #000 #668eac - #11263e #000 #b0b04c #0f0f0f #ffafaf #004 #005 #006 #007} +{{30: Dark2} "#bebebe" #bebebe #1f1f1f #262626 #de9e5e #6b6b6b #000 #f4f49f #616161 #eda95b #000 #767676 - #323232 #000 #b0b04c #262626 #ffabab #004 #005 #006 #007} +{{31: Dark3} "#bebebe" #bebebe #0a0a0a #232323 #de9e5e #6a6a6a #000 #f4f49f #616161 #eda95b #000 #767676 - #303030 #000 #bebe5a #131313 #ffabab #004 #005 #006 #007} +{{32: Oscuro} "#f1f1f1" #f1f1f1 #344545 #526d6d #f1b479 #728d8d #fff #f4f49f #afafaf #f7c475 #000 #94afaf - #5d7474 #000 #cdcd69 #3d4e4e #ffbcbc #004 #005 #006 #007} +{{33: Oscuro1} "#f1f1f1" #f1f1f1 #2a3b3b #466161 #e5a565 #6c8787 #fff #f4f49f #a2a2a2 #edba6b #000 #8ba6a6 - #526969 #000 #cdcd69 #354646 #ffbcbc #004 #005 #006 #007} +{{34: Oscuro2} "#f1f1f1" #f1f1f1 #223333 #3e5959 #de9e5e #668181 #fff #f4f49f #a2a2a2 #e4b162 #000 #819c9c - #4c6363 #000 #cdcd69 #2b3c3c #ffbcbc #004 #005 #006 #007} +{{35: Oscuro3} "#f1f1f1" #f1f1f1 #192a2a #355050 #de9e5e #5c7777 #fff #f4f49f #9e9e9e #dfac5d #000 #779292 - #425959 #000 #cdcd69 #223333 #ffbcbc #004 #005 #006 #007} +{{36: MildDark} "#d2d2d2" #fff #222323 #384e66 #2ccaca #4b7391 #fff #00ffff #939393 #43e1e1 #000 #668eac - #455b73 #000 #bebe5a #2b2c2c #ffa2a2 #004 #005 #006 #007} +{{37: MildDark1} "#d2d2d2" #fff #151616 #2D435B #2ac8c8 #436b89 #fff #00ffff grey #36d4d4 #000 #668eac - #3a5068 #000 #bebe5a #1f2020 #ffb0b0 #004 #005 #006 #007} +{{38: MildDark2} "#b4b4b4" #fff #0d0e0e #24384f #28c6c6 #3e6684 #fff #00ffff #757575 #33d1d1 #000 #668eac - #33475e #000 #bebe5a #161717 #ffaeae #004 #005 #006 #007} +{{39: MildDark3} "#e2e2e2" #f1f1f1 #000 #1B3048 #27c5c5 #375f7d #fff #00ffff #6c6c6c #31d0d0 #000 #668eac - #2a3f57 #000 #b0b04c #0f0f0f #ffafaf #004 #005 #006 #007} {{40: Inkpot} "#d3d3ff" #AFC2FF #16161f #1E1E27 #de9e5e #6767a8 #000 #f4f49f #6e6e6e #ffbb6d #000 #8585c6 - #292936 #000 #a2a23e #202029 #ffa5a5 #004 #005 #006 #007} {{41: Quiverly} "#cdd8d8" #cdd8d8 #2b303b #333946 #de9e5e #6f7582 #000 #f4f49f #757575 #eda95b #000 #9197a4 - #414650 #000 #b0b04c #323742 #ffabab #004 #005 #006 #007} {{42: Monokai} "#f8f8f2" #f8f8f2 #353630 #4e5044 #f1b479 #707070 #000 #f4f49f #9a9a9a #ffbb6d #000 #777777 - #46473d #000 #cdcd69 #3c3d37 #ffabab #004 #005 #006 #007} -{{43: Desert} "#fff" #fff #47382d #5a4b40 #f1b479 #78695e #000 #f4f49f #a2a2a2 #ffbb6d #000 #7f7065 - #55463b #000 #eded89 #503f34 #ffabab #004 #005 #006 #007} +{{43: TKE Default} "#dbdbdb" #dbdbdb #000 #282828 #de9e5e #0a0acc #fff #f4f49f #6a6a6a #d3a85a #fff #0000d3 - #383838 #000 #b0b04c #0d0e0e #ffabab #004 #005 #006 #007} {{44: Magenta} "#E8E8E8" #F0E8E8 #381e44 #4A2A4A #f1b479 #846484 #000 #f4f49f grey #ffbb6d #000 #ad8dad - #573757 #000 #cdcd69 #42284e #ffabab #004 #005 #006 #007} -{{45: Red} "#fff" #e9e9e6 #340202 #440702 #f1b479 #b05e5e #000 #f4f49f #828282 #ffbb6d #000 #ba6868 - #3e0100 #000 #bebe5a #461414 #ffc1c1 #004 #005 #006 #007} -{{46: Chocolate} "#d6d1ab" #d6d1ab #251919 #402020 #de9e5e #664D4D #fff #f4f49f #828282 #c3984a #fff #583f3f - #361d1d #000 #b0b04c #2d2121 #ffb7b7 #004 #005 #006 #007} -{{47: TKE Default} "#dbdbdb" #dbdbdb #000 #282828 #de9e5e #0a0acc #fff #f4f49f #6a6a6a #d3a85a #fff #0000d3 - #383838 #000 #b0b04c #0d0e0e #ffabab #004 #005 #006 #007} +{{45: Red} "#fff" #e9e9e6 #340202 #440702 #f1b479 #b05e5e #000 #f4f49f #828282 #ffbb6d #000 #ba6868 - #521514 #000 #bebe5a #461414 #ffc1c1 #004 #005 #006 #007} +{{46: Chocolate} "#d6d1ab" #d6d1ab #251919 #402020 #de9e5e #664D4D #fff #f4f49f #828282 #c3984a #fff #583f3f - #432a2a #000 #b0b04c #2d2121 #ffb7b7 #004 #005 #006 #007} +{{47: Desert} "#fff" #fff #47382d #5a4b40 #f1b479 #78695e #000 #f4f49f #a2a2a2 #ffbb6d #000 #7f7065 - #695a4f #000 #eded89 #503f34 #ffabab #004 #005 #006 #007} } set ::apave::_CS_(initall) 1 set ::apave::_CS_(initWM) 1 @@ -1451,7 +1451,7 @@ oo::class create ::apave::ObjectTheming { } set fontdef [font actual apaveFontDef] # configuring themed widgets - foreach ts {TLabel TButton TCheckbutton TRadiobutton TNotebook.Tab} { + foreach ts {TLabel TButton TCheckbutton TRadiobutton} { my Ttk_style configure $ts -font $fontdef my Ttk_style configure $ts -foreground $tfg1 my Ttk_style configure $ts -background $tbg1 @@ -1465,14 +1465,14 @@ oo::class create ::apave::ObjectTheming { my Ttk_style configure TLabelframe.Label -background $tbg1 my Ttk_style configure TLabelframe.Label -font $fontdef foreach ts {TNotebook TFrame} { - my Ttk_style configure $ts -background $tbg1 + my Ttk_style map $ts -background [list focus $tbg1 !focus $tbg1] } foreach ts {TNotebook.Tab} { my Ttk_style configure $ts -font $fontdef if {[my apaveTheme]} { - my Ttk_style map $ts -foreground [list selected $tfgS active $tfg2] + my Ttk_style map $ts -foreground [list {selected !active} $tfgS {!selected !active} $tfgM active $tfg2 {selected active} $tfg2] } - my Ttk_style map $ts -background [list selected $tbgS {active disabled} $tbg1 active $tbg2] + my Ttk_style map $ts -background [list {selected !active} $tbgS {!selected !active} $tbgM {!selected active} $tbg2 {selected active} $tbg2] } foreach ts {TEntry Treeview TSpinbox TCombobox TCombobox.Spinbox TMatchbox TNotebook.Tab TScrollbar TScale} { my Ttk_style map $ts -lightcolor [list focus $bclr active $bclr] @@ -1525,6 +1525,8 @@ oo::class create ::apave::ObjectTheming { option add *Menu.font $fontdef my Ttk_style configure TMenubutton -foreground $tfgM my Ttk_style configure TMenubutton -background $tbgM + my Ttk_style configure TButton -foreground $tfgM + my Ttk_style configure TButton -background $tbgM foreach {nam clr} {back tbg2 fore tfg2 selectBack tbgS selectFore tfgS} { option add *Listbox.${nam}ground [set $clr] } @@ -1562,12 +1564,14 @@ oo::class create ::apave::ObjectTheming { set ::apave::_C_($ts,4) "-activebackground $tbgS" set ::apave::_C_($ts,5) "-disabledforeground $tfgD" set ::apave::_C_($ts,6) "-font {$fontdef}" - if {[my apaveTheme]} { - set ::apave::_C_($ts,7) {-borderwidth 2} - set ::apave::_C_($ts,8) {-relief raised} + if {[::iswindows]} { + set ::apave::_C_($ts,0) 6 + } elseif {[my apaveTheme]} { + set ::apave::_C_($ts,7) {-borderwidth 2} + set ::apave::_C_($ts,8) {-relief raised} } else { - set ::apave::_C_($ts,7) {-borderwidth 1} - set ::apave::_C_($ts,8) {-relief groove} + set ::apave::_C_($ts,7) {-borderwidth 1} + set ::apave::_C_($ts,8) {-relief groove} } if {[my csDarkEdit]} {set c white} {set c black} set ::apave::_C_($ts,9) "-selectcolor $c" diff --git a/lib/pave/pkgIndex.tcl b/lib/pave/pkgIndex.tcl index 2e31da7..a0d74df 100644 --- a/lib/pave/pkgIndex.tcl +++ b/lib/pave/pkgIndex.tcl @@ -1,5 +1,5 @@ -package ifneeded apave 3.4.5b10 [list source [file join $dir apaveinput.tcl]] +package ifneeded apave 3.4.5.4 [list source [file join $dir apaveinput.tcl]] # A short intro (for Ruff! docs generator:) diff --git a/lib/theme/azure/theme/light.tcl b/lib/theme/azure/theme/light.tcl index b41afd1..6f0daf4 100644 --- a/lib/theme/azure/theme/light.tcl +++ b/lib/theme/azure/theme/light.tcl @@ -535,14 +535,15 @@ namespace eval ttk::theme::azure-light { ttk::style element create Treeheading.cell \ image [list $I(tree-basic) \ - pressed $I(tree-pressed) - ] -border 5 -padding 4 -sticky ewns + pressed $I(tree-basic) \ + active $I(tree-pressed) + ] -border 5 -padding 4 -sticky nsew ttk::style element create Treeitem.indicator \ image [list $I(right) \ user2 $I(empty) \ user1 $I(down) \ - ] -width 26 -sticky {} + ] -width 17 -sticky {} # ttk::style configure Treeview -background $colors(-bg) ttk::style configure Treeview.Item -padding {2 0 0 0} diff --git a/lib/theme/azure/theme/light/tree-basic.png b/lib/theme/azure/theme/light/tree-basic.png index 755062b10eafc9d5daff1daa4ff664795df7be2d..5c0ad96070c1d70dc2885802af7ae639c3b9494f 100644 GIT binary patch delta 77 zcmbQr7(YS6ospS=fnmFQzaNld3-AeXefaRo=EOCt}3C>R|DNig)WhgH% z*UQYyE>2D?NY%?PN}v7CMhd7%$o=EOCt}3C>R|DNig)WhgH% z*UQYyE>2D?NY%?PN}v7CMhd9N%+tj&#G?1@6+=M=1D?YUTg8tZ6FhTv!cqpCD2BQ# y6TcXQF-+2lC@zAk(uod*S9U}*kTt6v1`xp_l^S^!QkoY=d#Wzp$Pz+PBCu) diff --git a/lib/theme/forest/forest-dark/tree-basic.png b/lib/theme/forest/forest-dark/tree-basic.png index 06e9b18273066232593958ecff02e3234cb0bb86..1a67ba405c0d34dddcc327f44f670a7d5df2395f 100644 GIT binary patch delta 65 zcmbQr7(7A3nvt1-fnmFQzaNld4)6(awY0Rn>-el3$mRBQaSY+Op1i;a$O&LzY&g8T Q9mrzvboFyt=akR{01!YC6951J delta 131 zcmWHZ$~ZxymV=FffuXlkmKR8I7I;J!GcfQS24TkI`72U@f|4b!5hcO-X(i=}MX3zs z<>h*rdD+Fui3O>8`91~H*MBb Qcc4lJPgg&ebxsLQ02MV6;Q#;t delta 59 zcmYd{pCG}>$jrdNu-(1iZ=#~8riiDDV+hCfmdKI;Vst06QHL1^@s6 delta 131 zcmWHZ$~ZxymV=FffuXlkmKR8I7I;J!GcfQS24TkI`72U@f|4b!5hcO-X(i=}MX3zs z<>h*rdD+Fui3O>8`9IzUbgQu&X%Q~loCIH>cDmefE diff --git a/lib/theme/forest/forest-light/tree-pressed.png b/lib/theme/forest/forest-light/tree-pressed.png index 517cc1938c363d72f8fb7a64270fbc6adcc498e4..79dca23daf929dc2f091852cfe7012583242c463 100644 GIT binary patch delta 77 zcmZ3%7(YS6ospS=fnmFQzaNld3-AeX{r~@eadGjvZ2lua5fM)p#}JO|$v^)8XLe?8 eW-v84p~KLAhX3zoh*rdD+Fui3O>8`9ty yl(4AF(<9-^fk0+=UK!JZD-Ik9OUgtU7^36Y1aIdFKI#FQz~JfX=d#Wzp$PyX@-pE7 diff --git a/lib/theme/sun-valley/sun-valley.tcl b/lib/theme/sun-valley/sun-valley.tcl index 92dc312..7d9ce47 100755 --- a/lib/theme/sun-valley/sun-valley.tcl +++ b/lib/theme/sun-valley/sun-valley.tcl @@ -10,7 +10,7 @@ proc set_theme {mode} { unset ::SUNVALLEYDIR ;# no retheming supposed ttk::style theme use "sun-valley-dark" - + array set colors { -fg "#ffffff" -bg "#1c1c1c" @@ -18,7 +18,7 @@ proc set_theme {mode} { -selectfg "#ffffff" -selectbg "#196ebf" } - + ttk::style configure . \ -background $colors(-bg) \ -foreground $colors(-fg) \ @@ -32,7 +32,7 @@ proc set_theme {mode} { -font {"Segoe Ui" 10} \ -borderwidth 1 \ -relief flat - + tk_setPalette \ background [ttk::style lookup . -background] \ foreground [ttk::style lookup . -foreground] \ @@ -41,21 +41,21 @@ proc set_theme {mode} { selectForeground [ttk::style lookup . -selectforeground] \ activeBackground [ttk::style lookup . -selectbackground] \ activeForeground [ttk::style lookup . -selectforeground] - + ttk::style map . -foreground [list disabled $colors(-disabledfg)] - + option add *font [ttk::style lookup . -font] -# option add *Treeview.show tree + option add *Treeview.show tree option add *Menu.selectcolor $colors(-fg) option add *Menu.background #2d2d2d - + } elseif {$mode == "light"} { source [file join $::SUNVALLEYDIR theme light.tcl] unset ::SUNVALLEYDIR ;# no retheming supposed ttk::style theme use "sun-valley-light" - + array set colors { -fg "#202020" -bg "#fafafa" @@ -63,7 +63,7 @@ proc set_theme {mode} { -selectfg "#ffffff" -selectbg "#196ebf" } - + ttk::style configure . \ -background $colors(-bg) \ -foreground $colors(-fg) \ @@ -77,7 +77,7 @@ proc set_theme {mode} { -font {"Segoe Ui" 10} \ -borderwidth 0 \ -relief flat - + tk_setPalette background [ttk::style lookup . -background] \ foreground [ttk::style lookup . -foreground] \ highlightColor [ttk::style lookup . -focuscolor] \ @@ -85,9 +85,9 @@ proc set_theme {mode} { selectForeground [ttk::style lookup . -selectforeground] \ activeBackground [ttk::style lookup . -selectbackground] \ activeForeground [ttk::style lookup . -selectforeground] - + ttk::style map . -foreground [list disabled $colors(-disabledfg)] - + option add *font [ttk::style lookup . -font] # option add *Treeview.show tree option add *Menu.selectcolor $colors(-fg) diff --git a/lib/theme/sun-valley/theme/light.tcl b/lib/theme/sun-valley/theme/light.tcl index 71e8ea7..513ed82 100755 --- a/lib/theme/sun-valley/theme/light.tcl +++ b/lib/theme/sun-valley/theme/light.tcl @@ -483,18 +483,20 @@ namespace eval ttk::theme::sun-valley-light { # -border 5 ttk::style element create Treeheading.cell \ - image [list $images(treeheading-rest) \ - pressed $images(treeheading-pressed) \ - active $images(treeheading-hover) - ] -border 5 -padding 15 -sticky nsew + image [list $images(tree-basic) \ + pressed $images(tree-basic) \ + active $images(tree-pressed) + ] -border 5 -padding 4 -sticky nsew ttk::style element create Treeitem.indicator \ image [list $images(arrow-right) \ user2 $images(empty) \ user1 $images(arrow-down) \ - ] -width 26 -sticky {} + ] -width 17 -sticky {} - ttk::style configure Treeview -foreground $colors(-fg) -background $colors(-bg) -rowheight [expr {[font metrics font -linespace] + 2}] +# ttk::style configure Treeview -foreground $colors(-fg) -background $colors(-bg) -rowheight [expr {[font metrics font -linespace] + 2}] + ttk::style configure Treeview -background $colors(-bg) + ttk::style configure Treeview.Item -padding {2 0 0 0} ttk::style map Treeview \ -background [list selected $colors(-selectbg)] \ -foreground [list selected $colors(-selectfg)] diff --git a/lib/theme/sun-valley/theme/light/tree-basic.png b/lib/theme/sun-valley/theme/light/tree-basic.png new file mode 100644 index 0000000000000000000000000000000000000000..5c0ad96070c1d70dc2885802af7ae639c3b9494f GIT binary patch literal 95 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAj3?#R^_xk}Uwg8_H*M|=uPMS1n!OQboK+>Kr rjv*Y^lYjjG&+N?H%wTG8LWiOK4FBKF%0IRN@x&*16m=d#Wzp$Py}T^s5E literal 0 HcmV?d00001 diff --git a/lib/theme/sun-valley/theme/light/treeheading-hover.png b/lib/theme/sun-valley/theme/light/treeheading-hover.png deleted file mode 100755 index 47bf56f4a5e8cc6b7db6816c07230ecf7d668804..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 338 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4foCO|{#S9F5he4R}c>anMprB-l zYeY$Kep*R+Vo@qXd3m{BW?pu2a$-TMUVc&f>~}U&Kt=aGT^vI!df#4k%s!$Z(DpD~ zSXHIs%>Vz5J6k*!X;|6jOkV2Ez4i8`({;-oKNPx1gnD`YX#SEOn5}xuLz8vlw#`$5 zN@9;2@MNsb&(>63xpmWf>uXUxh8jy}B?u}$_wnk?oOK~;F=J9sME1sOW{cC0KmRA8 ze1KPPX+lpXn|yN5!YM`Vu20#Z&00sP zMPOcA|KlB5ybtCi$A<6ue*H$arzY!r+uPe7&SAb+FVHZ@`1B?Lryc7)-_2Mnd3<8! iyqCZKDgU`$$vpLIzJK@D%w<5YGI+ZBxvXanMprB-l zYeY$Kep*R+Vo@qXd3m{BW?pu2a$-TMUVc&f>~}U&Kt-oLT^vI!df#3>n{~v1$L(VF zPkzUH|9zV`_B_>FHo39U>9Rq|Gvo z7dcbo=y&J#y`K_v!cu(wbiPNDtFIp#+#ix-tidtrV{;XKe= N44$rjF6*2UngEe6hY$b& diff --git a/lib/theme/sun-valley/theme/light/treeheading-rest.png b/lib/theme/sun-valley/theme/light/treeheading-rest.png deleted file mode 100644 index d4aa09591d8d749f0a36640afa74788ea3e987c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 330 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4foCO|{#S9F5he4R}c>anMprB-l zYeY$Kep*R+Vo@qXd3m{BW?pu2a$-TMUVc&f>~}U&Kt<= zSI5X{74HQnR_h*{akeLO)`xqK=iD~mFKw)RtYg(B6JDhzh80@(elPEHS5o?28M^m6 zLy(unbH3*Fh36&){c0&bXFuzUsnVwX=PTc?Ruiu|DE=pY!_36Aoe)+>< zMTXqlMt#bPEZcIedGc<%aWvk3>vp~Lz;Ax04ePWI8*I=y{V-cl@YSwm@2gj>s%opZ Z&W|g~@xSWc@(Acf22WQ%mvv4FO#tQyiD3W$ diff --git a/src/alited.tcl b/src/alited.tcl index 7f0cdca..a283b9d 100755 --- a/src/alited.tcl +++ b/src/alited.tcl @@ -7,7 +7,7 @@ # License: MIT. ########################################################### -package provide alited 1.0.4 +package provide alited 1.0.5a6 package require Tk catch {package require comm} ;# Generic message transport diff --git a/src/bar.tcl b/src/bar.tcl index 5b672dd..a1fa23a 100644 --- a/src/bar.tcl +++ b/src/bar.tcl @@ -303,14 +303,15 @@ proc bar::OnTabSelection {TID} { if {[alited::edit::CommentChar] ne {}} {set cmnst normal} {set cmnst disabled} $al(MENUEDIT) entryconfigure 7 -state $cmnst $al(MENUEDIT) entryconfigure 8 -state $cmnst - set wtxt [alited::main::GetWTXT $TID] - set al(wrapwords) [expr {[$wtxt cget -wrap] eq {word}}] + if {[set wtxt [alited::main::GetWTXT $TID]] ne {}} { + set al(wrapwords) [expr {[$wtxt cget -wrap] eq {word}}] + } CurrentControlTab [FileName $TID] alited::main::HighlightLine - alited::tree::SeeSelection set indent [alited::main::CalcIndentation] ::apave::setTextIndent $indent if {$al(prjindentAuto)} {alited::main::UpdateProjectInfo $indent} + after 10 ::alited::tree::SeeSelection } # ________________________ Handle Ctrl+Tab keys ______________________ # diff --git a/src/favor.tcl b/src/favor.tcl index 0ec20f6..52ee96d 100644 --- a/src/favor.tcl +++ b/src/favor.tcl @@ -126,7 +126,7 @@ proc favor::Select {} { } set values [$wtree item $favID -values] if {[set TID [OpenSelectedFile $fname]] eq {}} return - # scan the favorites/last-visited tree, to find the selected item + # scan Favorites/last-visited tree, to find the selected item # and remake favorites and last visits; then go to the selected unit foreach it1 [$wtree children {}] { if {$name eq [lindex [$wtree item $it1 -values] 0]} { @@ -277,35 +277,69 @@ proc favor::SwitchFavVisit {} { # ________________________ Changing lists ________________________ # -proc favor::Add {{undermouse yes}} { +proc favor::Add {{undermouse yes} {idnames {}}} { # Adds a unit to favorites. # undermouse - if yes, run by mouse click + # idnames - list of unit's ID and names to add namespace upvar ::alited al al obPav obPav - lassign [CurrentName] itemID name l1 l2 - if {$name eq {}} return - if {$undermouse} {set geo {-geometry pointer+10+-100}} {set geo {}} set fname [alited::bar::FileName] set sname [file tail $fname] - foreach it [alited::tree::GetTree {} TreeFavor] { - lassign [lindex $it 4] name2 fname2 - if {$name eq $name2 && $fname eq $fname2} { - set msg [string map [list %n $name %f $sname] $al(MC,addexist)] - alited::msg ok err $msg {*}$geo - return + if {$undermouse} {set geo {-geometry pointer+10+-100}} {set geo {}} + set idnlen [llength $idnames] + if {$idnlen==0} { + lassign [CurrentName] itemID name l1 l2 + if {$name eq {}} return + set idnames [list $itemID $name] + } + if {![info exists al(ANSWER,favor::Add)]} { + set al(ANSWER,favor::Add) 0 + } + foreach {itemID name} $idnames { + set err no + foreach it [alited::tree::GetTree {} TreeFavor] { + lassign [lindex $it 4] name2 fname2 + if {$name eq $name2 && $fname eq $fname2} { + set msg [string map [list %n $name %f $sname] $al(MC,addexist)] + alited::Message $msg 4 + set err yes + break + } + } + if {$err} continue + set msg [string map [list %n $name %f $sname] $al(MC,addfavor)] + if {$al(ANSWER,favor::Add)==11 || [set al(ANSWER,favor::Add) \ + [alited::msg yesnocancel ques $msg YES -ch $al(MC,noask) {*}$geo]] \ + in {1 11}} { + set wtree [$obPav Tree] + set header [alited::unit::GetHeader [$obPav Tree] $itemID] + if {$idnlen==0} { + set pos [[alited::main::CurrentWTXT] index insert] + set line [expr {($l1 eq {} || $l2 eq {} || $l1>$pos || $l2<$pos) ? 0 : \ + [alited::p+ $pos -$l1]}] + } else { + set line 0 ;# favorites added from the tree + } + set wt2 [$obPav TreeFavor] + set ID2 [$wt2 insert {} 0 -values [list $name $fname $header $line]] + $wt2 tag add tagNorm $ID2 } + if {!$al(ANSWER,favor::Add)} break } - set msg [string map [list %n $name %f $sname] $al(MC,addfavor)] - if {[alited::msg yesno ques $msg YES {*}$geo]} { - set wtree [$obPav Tree] - set header [alited::unit::GetHeader [$obPav Tree] $itemID] - set pos [[alited::main::CurrentWTXT] index insert] - set line [expr {($l1 eq {} || $l2 eq {} || $l1>$pos || $l2<$pos) ? 0 : \ - [alited::p+ $pos -$l1]}] - set wt2 [$obPav TreeFavor] - set ID2 [$wt2 insert {} 0 -values [list $name $fname $header $line]] - $wt2 tag add tagNorm $ID2 +} +#_______________________ + +proc favor::AddFromTree {} { + # Adds a list of selected items of the tree to Favorites. + + namespace upvar ::alited al al obPav obPav + set wtree [$obPav Tree] + set IDs [$wtree selection] + if {$IDs eq {}} {bell; return} + foreach ID $IDs { + lappend idnames $ID [string trim [$wtree item $ID -text]] } + Add no $idnames } #_______________________ @@ -328,8 +362,12 @@ proc favor::Delete {{undermouse yes}} { } else { if {![IsSelected favID name fname sname header line]} return } - if {$favID eq {}} {bell; return} set sname [file tail $fname] + if {$favID eq {}} { + set msg [string map [list %n $name %f $sname] $al(MC,notfavor)] + alited::Message $msg 4 + return + } set msg [string map [list %n $name %f $sname] $al(MC,delfavor)] if {$undermouse} {set geo {-geometry pointer+10+-100}} {set geo {}} if {[alited::msg yesno warn $msg NO {*}$geo]} { @@ -345,7 +383,7 @@ proc favor::DeleteAll {{undermouse yes}} { namespace upvar ::alited al al obPav obPav if {$undermouse} {set geo {-geometry pointer+10+-100}} {set geo {}} if {$al(FAV,IsFavor)} { - set msg {Remove all of the favorites?} + set msg {Remove all of Favorites?} set listvar al(FAV,current) } else { set msg {Remove all of the last visited?} @@ -375,7 +413,7 @@ proc favor::CurrentName {} { # ________________________ Popup menus _________________________ # proc favor::ShowPopupMenu {ID X Y} { - # Displays a popup menu at clicking the favorites / last visited list. + # Displays a popup menu at clicking Favorites / last visited list. # ID - tree item's ID # X - x-coordinate of the mouse pointer # Y - y-coordinate of the mouse pointer @@ -418,7 +456,7 @@ proc favor::ShowPopupMenu {ID X Y} { #_______________________ proc favor::PopupMenu {x y X Y} { - # Prepares and runs a popup menu at clicking the favorites / last visited list. + # Prepares and runs a popup menu at clicking Favorites / last visited list. # x - x-coordinate to identify tree item # y - y-coordinate to identify tree item # X - x-coordinate of the mouse pointer diff --git a/src/favor_ls.tcl b/src/favor_ls.tcl index 8f5dbf1..cd228ad 100644 --- a/src/favor_ls.tcl +++ b/src/favor_ls.tcl @@ -344,13 +344,13 @@ proc favor_ls::_create {} { {.sbvFav .TexFav L - - {pack -side left}} {fra2 fra1 T 1 2 {-st nswe} {-padding {5 5 5 5} -relief groove}} {.labBA - - - - {pack -side left} {-t "Non-favorite files to be:"}} - {.radA - - - - {pack -side left -padx 8} {-t kept -var ::alited::favor_ls::place -value 1 -tip "Doesn't close any tab without favorites\nat choosing the favorites' list"}} - {.radB - - - - {pack -side left -padx 8} {-t closed -var ::alited::favor_ls::place -value 2 -tip "Closes all tabs without favorites\nat choosing the favorites' list"}} + {.radA - - - - {pack -side left -padx 8} {-t kept -var ::alited::favor_ls::place -value 1 -tip "Doesn't close any tab without favorites\nat choosing Favorites' list"}} + {.radB - - - - {pack -side left -padx 8} {-t closed -var ::alited::favor_ls::place -value 2 -tip "Closes all tabs without favorites\nat choosing Favorites' list"}} {LabMess fra2 T 1 2 {-st nsew -pady 0 -padx 3} {-style TLabelFS}} {fra3 labMess T 1 2 {-st nswe}} {.butHelp - - - - {pack -side left} {-t "$alited::al(MC,help)" -command ::alited::favor_ls::Help}} {.h_ - - - - {pack -side left -expand 1 -fill both -padx 4}} - {.butUndo - - - - {pack -side left} {-t Back -command {::alited::favor_ls::Ok 3} -tip "Sets a list of favorites\nthat was active initially."}} + {.butUndo - - - - {pack -side left} {-t Back -command {::alited::favor_ls::Ok 3} -tip "Sets a list of Favorites\nthat was active initially."}} {.butOK - - - - {pack -side left -padx 2} {-t "$alited::al(MC,select)" -command ::alited::favor_ls::Ok}} {.butCancel - - - - {pack -side left} {-t Cancel -command ::alited::favor_ls::Cancel}} } diff --git a/src/file.tcl b/src/file.tcl index 2aa26de..20d691a 100644 --- a/src/file.tcl +++ b/src/file.tcl @@ -260,16 +260,75 @@ proc file::AllSaved {} { } #_______________________ -proc file::RenameFile {TID fname} { +proc file::RenameFile {TID fname {doshow yes}} { # Renames a file. # TID - ID of tab # fname - file name + # doshow - flag "show the file's text" alited::bar::SetTabState $TID --fname $fname alited::bar::BAR $TID configure -text {} -tip {} set tab [alited::bar::UniqueListTab $fname] - alited::bar::BAR $TID configure -text $tab -tip [FileStat $fname] - alited::bar::BAR $TID show + set sname [file tail $fname] + alited::bar::BAR $TID configure -text $sname -tip [FileStat $fname] + if {$doshow} { + alited::bar::BAR $TID show + } +} +#_______________________ + +proc file::DoRenameFileInTree {wtree ID fname name2} { + # Performs renaming a current file in a file tree. + # wtree - file tree's path + # ID - ID of the file in the file tree + # fname - old file name (full) + # name2 - new file name (tail) + + set fsplit [file split $fname] + set fname2 [file join [file dirname $fname] $name2] + if {[catch {file rename $fname $fname2} err]} { + alited::msg ok err $err -text 1 -w 40 -h {5 7} + return + } + set currTID [alited::bar::CurrentTabID] + foreach tab [alited::bar::BAR listTab] { + set TID [lindex $tab 0] + set fname1 [alited::bar::FileName $TID] + if {$fname1 eq $fname} { + RenameFile $TID $fname2 no + break + } + set fsplit1 [file split $fname1] + if {[string first $fsplit $fsplit1]==0} { + set fname1 [file join $fname2 {*}[lrange $fsplit1 [llength $fsplit] end]] + RenameFile $TID $fname1 no + } + } + alited::bar::BAR draw + RecreateFileTree +} +#_______________________ + +proc file::RenameFileInTree {{geo ""}} { + # Renames a current file in a file tree. + # geo - geometry for dialogue + + namespace upvar ::alited al al obPav obPav obDl2 obDl2 + set wtree [$obPav Tree] + set ID [$wtree selection] + if {[llength $ID]!=1} { + alited::Message [msgcat::mc {Select one file in the tree.}] 4 + return + } + set name [$wtree item $ID -text] + set fname [lindex [$wtree item $ID -values] 1] + lassign [$obDl2 input {} $al(MC,renamefile) [list \ + ent "{} {} {-w 32}" "$name"] \ + -head [msgcat::mc {File name:}] {*}$geo] res name2 + set name2 [string trim $name2] + if {$res && $name2 ne {} && $name2 ne $name} { + DoRenameFileInTree $wtree $ID $fname $name2 + } } #_______________________ @@ -338,10 +397,11 @@ proc file::NewFile {} { } #_______________________ -proc file::OpenFile {{fnames ""} {reload no}} { +proc file::OpenFile {{fnames ""} {reload no} {islist no}} { # Handles "Open file" menu item. # fnames - file name (if not set, asks for it) # reload - if yes, loads the file even if it has a "strange" extension + # islist - if yes, *fnames* is a file list # Returns the file's tab ID if it's loaded, or {} if not loaded. namespace upvar ::alited al al obPav obPav @@ -351,8 +411,8 @@ proc file::OpenFile {{fnames ""} {reload no}} { set chosen yes set fnames [$obPav chooser tk_getOpenFile alited::al(filename) -multiple 1 \ -initialdir [file dirname [alited::bar::CurrentTab 2]] -parent $al(WIN)] - set fnames [lreverse $fnames] - } else { + set fnames [lsort -decreasing $fnames] + } elseif {!$islist} { set fnames [list $fnames] } set TID {} @@ -381,7 +441,6 @@ proc file::OpenFile {{fnames ""} {reload no}} { } } # open new tab - [$obPav Tree] selection set {} set tab [alited::bar::UniqueListTab $fname] set TID [alited::bar::InsertTab $tab [FileStat $fname]] alited::file::AddRecent $fname @@ -391,6 +450,7 @@ proc file::OpenFile {{fnames ""} {reload no}} { if {$TID ne {} && $TID ne [alited::bar::CurrentTabID]} { alited::bar::BAR $TID show } + RecreateFileTree return $TID } #_______________________ @@ -545,6 +605,7 @@ proc file::RecreateFileTree {} { namespace upvar ::alited al al obPav obPav if {!$al(TREE,isunits)} { + [$obPav Tree] selection set {} catch {after cancel $al(_AFT_RECR_)} set al(_AFT_RECR_) [after 100 ::alited::tree::RecreateTree] } @@ -559,12 +620,13 @@ proc file::OpenOfDir {dname} { set msg [string map [list %f [file tail $dname]] $msg] if {[alited::msg okcancel warn $msg NO]} { if {![catch {set flist [glob -directory $dname *]}]} { - foreach fname [lsort -decreasing $flist] { + set fnames [list] + foreach fname $flist { if {[file isfile $fname] && [IsTcl $fname]} { - OpenFile $fname + lappend fnames $fname } } - alited::tree::UpdateFileTree + OpenFile $fnames no yes } } } diff --git a/src/find.tcl b/src/find.tcl index e80a5cf..5f92e44 100644 --- a/src/find.tcl +++ b/src/find.tcl @@ -731,7 +731,6 @@ proc find::ReplaceInSession {} { if {![alited::msg yesno warn $msg NO -ontop $data(c5)]} { return {} } - set currTID [alited::bar::CurrentTabID] set rn 0 set data(_ERR_) no foreach tab [SessionList] { @@ -742,11 +741,11 @@ proc find::ReplaceInSession {} { incr rn $rdone alited::bar::BAR markTab $TID } -# alited::file::MakeThemHighlighted $TID if {$data(_ERR_)} break } ShowResults2 $rn $alited::al(MC,frres3) alited::main::UpdateTextGutterTree + alited::bar::OnTabSelection [alited::bar::CurrentTabID] ;# updates icons } # ________________________ Helpers _________________________ # diff --git a/src/ini.tcl b/src/ini.tcl index 4bae5e3..0e5ad08 100755 --- a/src/ini.tcl +++ b/src/ini.tcl @@ -14,6 +14,7 @@ namespace eval ::alited { set al(ED,sp1) 1 ;# -spacing1 option of texts set al(ED,sp2) 0 ;# -spacing2 option of texts set al(ED,sp3) 0 ;# -spacing3 option of texts + set al(ED,TclKeyWords) {} ;# user's key words for Tcl set al(ED,CKeyWords) {} ;# user's key words for C/C++ set al(ED,gutterwidth) 5 ;# gutter's windth in chars set al(ED,guttershift) 3 ;# space between gutter and text @@ -293,6 +294,7 @@ proc ini::ReadIniOptions {nam val} { spacing1 {set al(ED,sp1) $val} spacing2 {set al(ED,sp2) $val} spacing3 {set al(ED,sp3) $val} + TclKeyWords {set al(ED,TclKeyWords) $val} CKeyWords {set al(ED,CKeyWords) $val} clrDark {set al(ED,Dark) $val} save_onadd - save_onclose - save_onsave {set al(INI,$nam) $val} @@ -576,6 +578,7 @@ proc ini::SaveIni {{newproject no}} { puts $chan "spacing2=$al(ED,sp2)" puts $chan "spacing3=$al(ED,sp3)" puts $chan "CKeyWords=$al(ED,CKeyWords)" + puts $chan "TclKeyWords=$al(ED,TclKeyWords)" puts $chan "cursorwidth=$al(CURSORWIDTH)" set clrnams [::hl_tcl::hl_colorNames] foreach lng {{} C} { diff --git a/src/main.tcl b/src/main.tcl index dffe765..67ada88 100644 --- a/src/main.tcl +++ b/src/main.tcl @@ -96,7 +96,7 @@ proc main::GetText {TID {doshow no} {dohighlight yes}} { # hide both previous pack forget $wold1 ;# a text pack forget $wold2 ;# a scrollbar - update + after idle update } } # show the selected text @@ -306,7 +306,7 @@ proc main::HighlightText {TID curfile wtxt} { -insertwidth $al(CURSORWIDTH) } else { ::hl_tcl::hl_init $wtxt -dark [$obPav csDarkEdit] \ - -multiline $al(prjmultiline) \ + -multiline $al(prjmultiline) -keywords $al(ED,TclKeyWords) \ -cmd "::alited::edit::Modified $TID" \ -cmdpos ::alited::main::CursorPos \ -plaintext [expr {![alited::file::IsTcl $curfile]}] \ @@ -521,13 +521,12 @@ proc main::PackTextWidgets {wtxt wsbv} { # wsbv - scrollbar widget's path namespace upvar ::alited al al obPav obPav + pack $wtxt -side left -expand 1 -fill both + pack $wsbv -fill y -expand 1 lassign [GutterAttrs] canvas width shift # widgets created outside apave require the theming: $obPav csSet [$obPav csCurrent] $al(WIN) -doit - pack $wtxt -side left -expand 1 -fill both - pack $wsbv -fill y -expand 1 - set bind [list $obPav fillGutter $wtxt $canvas $width $shift] - {*}$bind + $obPav fillGutter $wtxt $canvas $width $shift } # ________________________ main _________________________ # diff --git a/src/msgs.tcl b/src/msgs.tcl index a159f98..af5a24b 100644 --- a/src/msgs.tcl +++ b/src/msgs.tcl @@ -36,7 +36,7 @@ namespace eval ::alited { set al(MC,clallright) [msgcat::mc {... All at Right}] set al(MC,pref) [msgcat::mc Preferences] set al(MC,pref...) [msgcat::mc Preferences...] - set al(MC,notrecomm) [msgcat::mc {Not recommended!}] + set al(MC,notrecomm) [msgcat::mc "Not recommended for projects\nwith large files (>2000 LOC)!"] set al(MC,restart) [msgcat::mc Restart] set al(MC,quit) [msgcat::mc Quit] set al(MC,indent) [msgcat::mc Indent] @@ -69,9 +69,10 @@ namespace eval ::alited { set al(MC,introln2) [msgcat::mc {Can't touch the first %n lines.}] set al(MC,favorites) [msgcat::mc Favorites] set al(MC,lastvisit) [msgcat::mc {Last Visited}] - set al(MC,addfavor) [msgcat::mc "Add \"%n\" of %f\nto the favorites?"] - set al(MC,addexist) [msgcat::mc "Item \"%n\" of %f\nis already in the favorites."] - set al(MC,delfavor) [msgcat::mc "Remove \"%n\" of %f\nfrom the favorites?"] + set al(MC,addfavor) [msgcat::mc "Add \"%n\" of %f\nto Favorites?"] + set al(MC,addexist) [msgcat::mc "Item \"%n\" of %f\nis already in Favorites."] + set al(MC,delfavor) [msgcat::mc "Remove \"%n\" of %f\nfrom Favorites?"] + set al(MC,notfavor) [msgcat::mc "\"%n\" unit of %f\nis not in Favorites."] set al(MC,selfavor) [msgcat::mc "Click \"%t\""] set al(MC,copydecl) [msgcat::mc {Copy Declaration}] set al(MC,openofdir) [msgcat::mc "Open All Tcl Files of \"%n\""] @@ -86,6 +87,7 @@ namespace eval ::alited { set al(MC,errmove) [msgcat::mc "\"%n\" contains unbalanced \{\}: %1!=%2"] set al(MC,beforerun) [msgcat::mc {Command before "Run"}] set al(MC,locale) [msgcat::mc "Mostly this is a country code,\nfor example: ru, ua, cz."] + set al(MC,noask) [msgcat::mc {Don't ask anymore}] ## _ templates _ ## set al(MC,tpl) [msgcat::mc Templates] @@ -145,8 +147,9 @@ namespace eval ::alited { set al(MC,errcopy) [msgcat::mc "Can't backup \"%f\" to\n\"%d\"!\n\nDelete it anyway?"] set al(MC,removed) [msgcat::mc "\"%f\" removed to \"%d\""] set al(MC,nottoopen) [msgcat::mc "The file \"%f\" seems to be not of types\n%s.\n\nStill do you want to open it?"] + set al(MC,renamefile) [msgcat::mc {Rename File}] - ## _ checking ini directory _ ## + ## _ checking ini directory _ ## set al(MC,chini1) [msgcat::mc {Choosing Directory for Settings}] set al(MC,chini2) [msgcat::mc "\n The \"alited\" needs a configuration directory to store its settings.\n You can pass its name to alited as an argument.\n\n The default configuration directory is \"%d\".\n It's preferable as used to run \"alited\" without arguments.\n"] set al(MC,chini3) [msgcat::mc {Choose a directory}] diff --git a/src/pkgIndex.tcl b/src/pkgIndex.tcl index d45ba33..ae168d5 100755 --- a/src/pkgIndex.tcl +++ b/src/pkgIndex.tcl @@ -1,4 +1,4 @@ -package ifneeded alited 1.0.4 [list source [file join $dir alited.tcl]] +package ifneeded alited 1.0.5a6 [list source [file join $dir alited.tcl]] namespace eval ::alited { diff --git a/src/pref.tcl b/src/pref.tcl index 325e801..84586a1 100644 --- a/src/pref.tcl +++ b/src/pref.tcl @@ -69,9 +69,6 @@ namespace eval pref { # bar/e_menu full info variable em_inf; array set em_inf [list] - # list of menus' content - variable em_Menus [list] - # list of e_menu icons variable em_Icons [list] @@ -140,7 +137,6 @@ proc pref::fetchVars {} { variable em_ico variable em_sep variable em_inf - variable em_Menus variable em_Icons variable listIcons variable listMenus @@ -292,6 +288,8 @@ proc pref::Ok {args} { if {![string is integer -strict $al(INI,CS)]} {set al(INI,CS) -1} set al(EM,CS) [GetCS 2] if {![string is integer -strict $al(EM,CS)]} {set al(EM,CS) -1} + set al(ED,TclKeyWords) [[$obDl2 TexTclKeys] get 1.0 {end -1c}] + set al(ED,TclKeyWords) [string map [list \n { }] $al(ED,TclKeyWords)] set al(ED,CKeyWords) [[$obDl2 TexCKeys] get 1.0 {end -1c}] set al(ED,CKeyWords) [string map [list \n { }] $al(ED,CKeyWords)] set al(BACKUP) [string trim $al(BACKUP)] @@ -646,7 +644,7 @@ proc pref::Edit_Tab2 {} { {FraTab2 v_ T 1 1 {-st nsew -cw 1 -rw 1}} {fraTab2.scf - - 1 1 {pack -fill both -expand 1} {-mode y}} {.labExt - - 1 1 {-st w -pady 3 -padx 3} {-t "Tcl files' extensions:"}} - {.entExt .labExt L 1 1 {-st sw -pady 3} {-tvar alited::al(TclExtensions) -w 30}} + {.entExt .labExt L 1 1 {-st swe -pady 3} {-tvar alited::al(TclExtensions) -w 30}} {.LabCOM .labExt T 1 1 {-st w -pady 3 -padx 3} {-t "Color of Tcl commands:"}} {.clrCOM .labCOM L 1 1 {-st sw -pady 3} {-tvar alited::al(ED,clrCOM) -w 20}} {.labCOMTK .labCOM T 1 1 {-st w -pady 3 -padx 3} {-t "Color of Tk commands:"}} @@ -665,6 +663,10 @@ proc pref::Edit_Tab2 {} { {.clrBRA .labBRA L 1 1 {-st sw -pady 3} {-tvar alited::al(ED,clrBRA) -w 20}} {.seh .labBRA T 1 2 {-pady 3}} {.but .seh T 1 1 {-st w} {-t Default -com alited::pref::TclSyntax_Default}} + {.seh2 .but T 1 2 {-pady 10}} + {fraTab2.scf.fra2 .seh2 T 1 2 {-st nsew}} + {.labAddKeys - - 1 1 {-st nw -pady 3} {-t "Your commands:"}} + {.TexTclKeys .labAddKeys L 1 1 {-st new} {-h 7 -w 55 -wrap word -tabnext $alited::pref::win.fraB.butOK}} } } #_______________________ @@ -677,7 +679,7 @@ proc pref::Edit_Tab3 {} { {FraTab3 v_ T 1 1 {-st nsew -cw 1 -rw 1}} {fraTab3.scf - - 1 1 {pack -fill both -expand 1} {-mode y}} {.labExt - - 1 1 {-st w -pady 3 -padx 3} {-t "C/C++ files' extensions:"}} - {.entExt .labExt L 1 2 {-st sw -pady 3} {-tvar alited::al(ClangExtensions) -w 30}} + {.entExt .labExt L 1 1 {-st swe -pady 3} {-tvar alited::al(ClangExtensions) -w 30}} {.LabCOM2 .labExt T 1 1 {-st w -pady 3 -padx 3} {-t "Color of C key words:"}} {.clrCOM2 .labCOM2 L 1 1 {-st sw -pady 3} {-tvar alited::al(ED,CclrCOM) -w 20}} {.labCOMTK2 .labCOM2 T 1 1 {-st w -pady 3 -padx 3} {-t "Color of C++ key words:"}} @@ -699,7 +701,7 @@ proc pref::Edit_Tab3 {} { {.seh2 .but T 1 2 {-pady 10}} {fraTab3.scf.fra2 .seh2 T 1 2 {-st nsew}} {.labAddKeys - - 1 1 {-st nw -pady 3} {-t "Your key words:"}} - {.TexCKeys .labAddKeys L 1 1 {-st new} {-h 7 -w 36 -wrap word -tabnext $alited::pref::win.fraB.butOK}} + {.TexCKeys .labAddKeys L 1 1 {-st new} {-h 7 -w 48 -wrap word -tabnext $alited::pref::win.fraB.butOK}} } } #_______________________ @@ -1116,24 +1118,6 @@ proc pref::Runs_Tab {} { incr icr } EmSeparators no - # get a full list of actions contained in all e_menu's menus - set em_Menus {} - set curmenu menu.mnu - set curlev 0 - set listMenus [alited::tool::EM_AllStructure $curmenu] - foreach mit $listMenus { - lassign $mit lev mnu hk item - set item [string map [list \{ \\\{ \} \\\} \" \\\" \$ \\\$] $item] - if {$lev>$curlev} { - append em_Menus " \{$mnu" - } elseif {$lev<$curlev} { - append em_Menus "\} \"$item\"" - } else { - append em_Menus " \"$item\"" - } - set curlev $lev - } - append em_Menus [string repeat \} $curlev] # get a layout of "bar/menu" tab return { {v_ - - 1 1} @@ -1317,6 +1301,7 @@ proc pref::_create {tab} { $wtxt insert end [::apave::readTextFile $fnotes] } $wtxt edit reset; $wtxt edit modified no + [$obDl2 TexTclKeys] insert end $al(ED,TclKeyWords) [$obDl2 TexCKeys] insert end $al(ED,CKeyWords) if {$tab ne {}} { switch -exact $tab { diff --git a/src/project.tcl b/src/project.tcl index 35a96ef..1ae3b56 100644 --- a/src/project.tcl +++ b/src/project.tcl @@ -74,7 +74,7 @@ proc project::SaveCurrFileList {title {isnew no}} { if {[info exists al(ANSWERED,SaveCurrFileList)]} { set ans $al(ANSWERED,SaveCurrFileList) } else { - set ans [$obDl3 misc ques $title $msg $asks file -ch {Don't ask anymore}] + set ans [$obDl3 misc ques $title $msg $asks file -ch $al(MC,noask)] if {[string last {10} $ans]>-1} { set ans [string map {10 {}} $ans] set al(ANSWERED,SaveCurrFileList) $ans @@ -607,10 +607,10 @@ proc project::Ok {args} { alited::main::UpdateProjectInfo alited::ini::GetUserDirs alited::file::MakeThemHighlighted - after idle alited::main::ShowText + alited::favor::ShowFavVisit [$obPav Tree] selection set {} ;# new project - no group selected if {!$al(TREE,isunits)} {after idle alited::tree::RecreateTree} - alited::favor::ShowFavVisit + after 10 alited::main::ShowText $obDl2 res $win 1 return } diff --git a/src/tool.tcl b/src/tool.tcl index 9fd4e6b..e76bcab 100644 --- a/src/tool.tcl +++ b/src/tool.tcl @@ -363,7 +363,7 @@ proc tool::e_menu {args} { # depending on e_menu's preferences. namespace upvar ::alited al al - if {{ex=Help} ni $args} { + if {{EX=Help} ni $args} { EM_SaveFiles if {![is_submenu $args]} { append args " g=" ;# should be last, to override previous settings diff --git a/src/tree.tcl b/src/tree.tcl old mode 100755 new mode 100644 index b0b556a..2bbe380 --- a/src/tree.tcl +++ b/src/tree.tcl @@ -71,7 +71,12 @@ proc tree::OpenFile {{ID ""}} { } lassign [$wtree item $ID -values] -> fname isfile if {$isfile} { - alited::file::OpenFile $fname + if {[set TID [alited::bar::FileTID $fname]] eq {}} { + alited::file::OpenFile $fname + } else { + alited::bar::BAR $TID show + } + alited::bar::BAR draw alited::tree::UpdateFileTree } } @@ -255,6 +260,7 @@ proc tree::Create {} { alited::tree::TooltipOff alited::tree::DestroyMoveWindow yes } + bind $wtree {alited::file::RenameFileInTree} if {$al(TREE,isunits)} { CreateUnitsTree $TID $wtree } else { @@ -521,6 +527,11 @@ proc tree::ShowPopupMenu {ID X Y} { $popm add command {*}[$obPav iconA none] -label $m3 \ -command "::alited::tree::DelItem $ID" -image alimg_delete if {$al(TREE,isunits)} { + if {$al(FAV,IsFavor)} { + $popm add separator + $popm add command {*}[$obPav iconA heart] -label $al(MC,favoradd) \ + -command ::alited::favor::AddFromTree + } if {$isunit} { $popm add separator $popm add command {*}[$obPav iconA none] -label $al(MC,copydecl) \ @@ -529,6 +540,9 @@ proc tree::ShowPopupMenu {ID X Y} { } else { if {$isfile} {set fname [file dirname $fname]} set sname [file tail $fname] + $popm add command {*}[$obPav iconA change] \ + -label $al(MC,renamefile) -accelerator F2 \ + -command {::alited::file::RenameFileInTree {-geometry pointer+10+-100}} $popm add separator set msg [string map [list %n $sname] $al(MC,openofdir)] $popm add command {*}[$obPav iconA OpenFile] -label $msg \ @@ -546,7 +560,7 @@ proc tree::ShowPopupMenu {ID X Y} { } } bind $popm "$wtree tag add tagBold $ID" - bind $popm "$wtree tag remove tagBold $ID; $addsel" + bind $popm "catch {$wtree tag remove tagBold $ID; $addsel}" $obPav themePopup $popm tk_popup $popm $X $Y } @@ -579,15 +593,15 @@ proc tree::ButtonPress {but x y X Y} { {1} { set al(movID) $ID set al(movWin) .tritem_move + set msec [clock milliseconds] if {$al(TREE,isunits)} { NewSelection $ID } else { - set msec [clock milliseconds] if {[info exists al(_MSEC)] && [expr {($msec-$al(_MSEC))<400}]} { OpenFile $ID } - set al(_MSEC) $msec } + set al(_MSEC) $msec } } } @@ -623,7 +637,9 @@ proc tree::ButtonRelease {but s x y X Y} { set wtree [$obPav Tree] set ID [$wtree identify item $x $y] DestroyMoveWindow no - if {$s & 7} { + set msec [clock milliseconds] + if {([info exists al(_MSEC)] && [expr {($msec-$al(_MSEC))<400}]) \ + || ($s & 7)} { set al(movWin) {} return } diff --git a/src/unit.tcl b/src/unit.tcl index c2586ae..a5561ec 100644 --- a/src/unit.tcl +++ b/src/unit.tcl @@ -25,7 +25,7 @@ proc unit::GetHeader {wtree ID {NC ""}} { return $l2 ;# for file tree, it's a full file name } if {$NC eq {#1}} { - set tip "[string map {al #} $id]\n$l1 - $l2" + set tip "[string map {al #} $id]\n$l1 - [expr {max($l1,$l2)}]" set ID {} } else { catch {