74 Commits

Author SHA1 Message Date
svk
47f1473167 Тесты сборки
Some checks failed
Build and Create Tag Release / build (push) Failing after 18s
2026-01-22 21:06:17 +03:00
svk
72101c90d5 Тесты сборки
Some checks failed
Build and Create Tag Release / build (push) Failing after 12s
2026-01-22 21:03:55 +03:00
svk
261dc38748 Тесты сборки
Some checks failed
Build and Create Tag Release / build (push) Failing after 12s
2026-01-22 21:02:54 +03:00
svk
e20cb3464f Тесты сборки
All checks were successful
Simple Release / build (push) Successful in 17s
2026-01-22 20:59:04 +03:00
svk
d4ed578178 Тесты сборки
Some checks failed
Simple Release / build (push) Failing after 19s
2026-01-22 20:55:46 +03:00
svk
46017d027a Тесты сборки
All checks were successful
Simple Release / build (push) Successful in 17s
2026-01-22 20:52:47 +03:00
svk
d4d38e26ce Тесты сборки 2026-01-22 20:51:35 +03:00
svk
a2c525ecd1 Тесты сборки 2026-01-22 20:50:36 +03:00
svk
f743c47d6b Тесты сборки
Some checks failed
Сборка Projman / build (push) Failing after 16s
2026-01-22 20:48:40 +03:00
svk
08ba3678f8 Тесты сборки
Some checks failed
Сборка Projman / build (push) Failing after 16s
2026-01-22 20:46:48 +03:00
svk
9cc837bdd8 Тесты сборки
All checks were successful
Сборка Projman / build (push) Successful in 15s
2026-01-22 20:42:53 +03:00
svk
9eb32586c7 Тесты сборки
Some checks failed
Сборка Projman / build (push) Failing after 9s
2026-01-22 20:40:38 +03:00
svk
ff18a032f4 Тесты сборки
All checks were successful
Сборка Projman / build (push) Successful in 15s
2026-01-22 20:38:00 +03:00
svk
debcffb9a2 Тесты сборки
Some checks failed
Gitea Actions / Explore-Gitea-Actions (push) Failing after 10s
2026-01-22 20:35:54 +03:00
svk
9c15f23987 Тесты сборки
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2026-01-22 20:31:16 +03:00
svk
5f89f0ce31 Тесты сборки
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 16s
2026-01-22 20:25:21 +03:00
svk
6ec850c77c Тесты сборки
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 21s
2026-01-22 20:17:30 +03:00
svk
7def13e265 Добавлена сборка пакетов для openbsd 2026-01-22 20:16:00 +03:00
svk
cf41075f42 Добавлена сборка пакетов для openbsd 2026-01-22 20:15:16 +03:00
svk
4f0e746128 Релиз 1-й бета версии
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 19s
2026-01-22 17:58:15 +03:00
svk
bc706ab410 Исправление ошибок 2026-01-22 17:48:59 +03:00
svk
83d70ebd3f Сделан вывод отладочной информации по запросу. Переделка кода. 2026-01-22 17:30:11 +03:00
svk
f9dbdf893d Добавлены процедуры проверки наличия параметров конфигурации, и установки значений по умолчанию в случае их отсутствия в файле конфигурации.
Добавлена новая секця и два новых парметра в конфиг, для вывода отладочной информации.
2026-01-22 16:55:17 +03:00
svk
f1fcd09f89 Новая сборка
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 15s
2026-01-21 16:44:07 +03:00
svk
cdb47df781 Исправил ошибку. 2026-01-21 16:41:45 +03:00
svk
d7e681c607 Новая сборка
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 19s
2026-01-21 16:35:56 +03:00
svk
978482c2ae Добавил фокус ввода на 'терминал' если он открыт во вкладке (при переключении вкладок). 2026-01-21 16:33:50 +03:00
svk
8435bf0254 Исправил вставку кавычек при выделении текста 2026-01-21 16:31:59 +03:00
svk
604175491a Исправил ошибку при отправке сигналов несуществующему процессу. 2026-01-21 15:40:33 +03:00
svk
9ff7fa815f Уменьшил всплывающее меню: вынес менюшки Файл и Вид в подменю. 2026-01-21 15:33:12 +03:00
svk
1a490afe44 Изменил команду загрузки пакета в репу
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 17s
2026-01-21 13:44:27 +03:00
svk
78107b529f Новая сборка
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
2026-01-21 13:13:06 +03:00
svk
781352b249 Исправлено поведение при сочетании клавиш Control-y (повторение последнего действия) 2026-01-21 13:00:38 +03:00
svk
478a583c3a Новая сборка 2026-01-21 12:27:18 +03:00
svk
4f01a1fbd7 Исправлен флаг модификации при открытии файла, исправлена 'Отмена' до пустого файла. Внес исправления на основе изменений https://github.com/wandrien/projman 2026-01-21 12:24:08 +03:00
svk
96dd7a1b4b Изменил почту
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 20s
2026-01-21 11:58:50 +03:00
Sergey Kalinin
4b2adb3299 Новая сборка
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 20s
2026-01-19 14:49:29 +03:00
Sergey Kalinin
0c4928c224 Исправил закрытие вкладок редактора и сохранение файла при разделении экрана.
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 23s
2026-01-19 14:43:31 +03:00
Sergey Kalinin
eb6b2c6f53 Новая сборка
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 17s
2025-12-03 18:06:32 +03:00
Sergey Kalinin
aa9bb03cc2 Исправил ошибку 2025-12-03 18:02:13 +03:00
Sergey Kalinin
bcc3460e06 Исправил ошибку 2025-12-03 17:59:31 +03:00
Sergey Kalinin
1385c91255 Исправления после слияния 2025-12-03 17:33:06 +03:00
Sergey Kalinin
ead8267d61 Изменения перед слиянием
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-12-03 17:09:42 +03:00
Sergey Kalinin
e534b27407 Добавлены настройки путей к программам для выполнения редактируемых файлов для каждого поддержимаего типа. И использование этих настроек при выполнении файла.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-12-03 17:01:58 +03:00
Sergey Kalinin
45cbd7845b Добавил вывод информации о версиях tcl и tk
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-11-10 13:18:26 +03:00
Sergey Kalinin
b830838f8e Добавил вывод номера версии tcl/tl в О Программе
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-11-10 13:13:44 +03:00
Sergey Kalinin
ef87b88156 Незначительные изменения
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-11-10 13:00:43 +03:00
264368c61f новая сборка
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 17s
2025-10-31 19:01:41 +03:00
c38dffeeb9 Исправил сохранение и закрытие нового файла. Теперь при сохранении файл будет переоткрыт под новым именем. 2025-10-31 18:56:38 +03:00
df1d9aa36d Добавил проверку пакета Img. И поправил проверку типов изображений
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m23s
2025-10-31 17:30:16 +03:00
cff798a9f1 Переделал сигналы и сочетния
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m23s
2025-10-30 14:53:30 +03:00
64287f1a01 Небольшие исправления
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-30 14:47:05 +03:00
5e1c057bc5 Поправил changelog
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-30 13:12:49 +03:00
ab740f0be8 Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-30 13:10:54 +03:00
4c6713b2d3 Добавлена передача сигналов для закрытия запущенного процесса
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-30 12:52:21 +03:00
dc5fd60c0d Исправлен changelog
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-29 21:48:31 +03:00
c3848566df Удалил линее
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-29 21:44:26 +03:00
961d597032 Изменил виджет текста в окне псевдо-терминала. Добавил подстановку имени файла к командную строку по шаблону %f 2025-10-29 21:42:34 +03:00
5d70d508cd Добавлен диалог настроек, и кнопка на панели. Для редактирования файла настроек программы
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-29 20:48:52 +03:00
8619e3e1f4 Добавил псевдо-терминал, и команды запуска файлов.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-29 19:59:57 +03:00
8834c0954e Исправлен changelog
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-29 13:10:31 +03:00
4e67dbfccf Добавлен диалог при открытии файлов отличных от текстовых
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-29 09:08:28 +03:00
e5b0468a44 Поправил тему оформления
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-28 16:05:56 +03:00
a9ac54ce54 Новая сборка
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-27 21:01:15 +03:00
297d0f7420 Исправлена работа в windows 2025-10-27 20:59:27 +03:00
9b083515ba Уменьшил колдичество выводимой отладочной информации
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-27 19:32:08 +03:00
722bbc4e30 Новая сборка
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-27 14:48:18 +03:00
bdb9b2db00 Добавлено определение пути до git в зависимости от платформы. 2025-10-27 14:45:30 +03:00
22bdd7b87e Исправлено создание файла конфигурации
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-27 14:13:56 +03:00
430f7d6607 Исправлено создание файла конфигурации. Добавлены номера версий в вызов tclsh8.6 и wish8.6. Убрана зависимостить на Threads.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-27 14:05:40 +03:00
Калинин Сергей Валерьевич
f54333f942 Новая сборка
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-23 13:58:22 +03:00
Калинин Сергей Валерьевич
f6a1b440f7 Исправлено чтение структуры проекта при открытии из меню 'Открыть недавнее' 2025-10-23 13:54:54 +03:00
Калинин Сергей Валерьевич
9b69e94412 Bugfix release
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-10-22 09:35:08 +03:00
Калинин Сергей Валерьевич
8a1145a2d9 Bug fix with varhelper 2025-10-22 09:34:13 +03:00
27 changed files with 1523 additions and 251 deletions

View File

@@ -1,17 +1,74 @@
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
name: Build and Create Tag Release
on:
push:
branches:
- master
- main
jobs:
Explore-Gitea-Actions:
build:
runs-on: tcl-tk-builder
steps:
- name: Build the packages
- name: Клонирование
run: |
git clone ${{ vars.main_url }}${{ gitea.repository }}
pwd
cd projman/debian
./build-deb-projman.sh
cd ../../
curl --user ${{ vars.user}}:${{vars.api_token}} --upload-file "$(ls -1| grep projman | grep -E 'deb$')" ${{vars.main_url}}api/packages/${{vars.user}}/debian/pool/bookworm/main/upload
- run: echo "This job's status is ${{ job.status }}."
git clone "${{ vars.main_url }}${{ gitea.repository }}.git" .
- name: Получение версии
id: get_version
run: |
VERSION=$(grep "Version" projman.tcl | head -1 | grep -o '[0-9.]\+[a-zA-Z0-9]*' || echo "1.0.0")
RELEASE=$(grep "# Release" projman.tcl | tail -1 | awk '{print $NF}' || echo "$(date +%Y%m%d)")
# Создаем имя тега из версии
TAG="v${VERSION}-${RELEASE}"
echo "TAG=$TAG" >> $GITEA_ENV
echo "VERSION=$VERSION" >> $GITEA_ENV
echo "Будет создан тег: $TAG"
- name: Создание тега в git
run: |
git config user.email "svk@nuk-svk.ru"
git config user.name "svk"
# Создаем тег локально
git tag -a "$TAG" -m "Release $TAG"
git remote set-url origin "https://${{ secrets.USER }}:${{ secrets.API_TOKEN }}@git.nuk-svk.ru/${{ gitea.repository }}.git"
# Пушим тег на сервер
git push origin "$TAG"
- name: Сборка пакетов
run: |
cd debian && ./build-deb-projman.sh
cd ../openbsd && ./build-package-bsd.sh
echo "Собранные файлы:"
ls -la projman*
- name: Создание релиза с тегом
run: |
echo "Создаем релиз для тега: $TAG"
curl -X POST \
-u "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "'"$TAG"'",
"name": "Projman '"$VERSION"'",
"body": "## Информация о сборке\n\n- Версия: '"$VERSION"'\n- Дата: '"$(date)"'\n- Коммит: '"$(git rev-parse --short HEAD)"'",
"draft": false,
"prerelease": false
}' \
"${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases"
- name: Загрузка файлов
run: |
# Загружаем все файлы projman*
curl -u "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
--upload-file "../projman_2.0.0-beta1_amd64.deb" \
"${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases/tags/$TAG/assets?name=../projman_2.0.0-beta1_amd64.deb"
curl -u "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
--upload-file "../projman-2.0.0beta1.tgz" \
"${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases/tags/$TAG/assets?name=../projman-2.0.0beta1.tgz"

4
.gitignore vendored
View File

@@ -5,4 +5,6 @@ debian/projman.substvars
debian/files
debian/projman.debhelper.log
debian/*.tmp
*.tmp
debian/errors
*.tmp
errors

120
CHANGELOG
View File

@@ -1,4 +1,122 @@
projman (2.0.0-alfa16)
projman (2.0.0-beta1) stable; urgency=medium
* Сделан вывод отладочной информации по запросу.
* Добавлены параметры в файл конфигурации "debug" - включение или отключение отладки и "debugOut" - куда выводить информацию.
* Переделка кода.
* Добавлены процедуры проверки наличия параметров конфигурации в файле и устанвоки переменных по умолчанию.
-- svk <svk@nuk-svk.ru> Wed, 21 Jan 2026 16:44:07 +0300
projman (2.0.0-alpha24) stable; urgency=medium
* Добавил фокус ввода на 'терминал' если он открыт во вкладке (при переключении вкладок).
* Исправил вставку кавычек при выделении текста
* Исправил ошибку при отправке сигналов несуществующему процессу.
* Уменьшил всплывающее меню: вынес менюшки Файл и Вид в подменю.
* Изменил команду загрузки пакета в репу
-- svk <svk@nuk-svk.ru> Wed, 21 Jan 2026 16:35:06 +0300
projman (2.0.0-alpha23) stable; urgency=medium
* Исправлен флаг модификации при открытии файла
* Исправлена 'Отмена' до пустого файла. Внес исправления на основе изменений https://github.com/wandrien/projman
* Исправлено поведение при сочетании клавиш Control-y (повторение последнего действия)
-- svk <svk@nuk-svk.ru> Mon, 19 Jan 2026 14:49:29 +0300
projman (2.0.0-alpha22) stable; urgency=medium
* Исправил закрытие вкладок редактора и сохранение файла при разделении экрана.
* Новая сборка
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 3 Dec 2025 18:06:32 +0300
projman (2.0.0-alpha21) stable; urgency=medium
* Исправил ошибку
* Добавлены настройки путей к программам для выполнения редактируемых файлов для каждого поддержимаего типа. И использование этих настроек при выполнении файла.
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 3 Dec 2025 17:59:31 +0300
projman (2.0.0-alpha20) stable; urgency=medium
* Добавление вывод номера версии tcl/tl в О Программе
-- Sergey Kalinin <svk@nuk-svk.ru> Mon, 03 Dec 2025 17:22:44 +0300
projman (2.0.0-alpha19) stable; urgency=medium
* Исправил сохранение и закрытие нового файла. Теперь при сохранении файл будет переоткрыт под новым именем.
* Добавил проверку пакета Img. И поправил проверку типов изображений
* Переделал сигналы и сочетания
* Небольшие исправления
* Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения.
* Добавлена передача сигналов для закрытия запущенного процесса
* Изменил виджет текста в окне псевдо-терминала. Добавил подстановку имени файла к командную строку по шаблону %f
* Добавлен диалог настроек
* Добавил псевдо-терминал
* Добавлен диалог при открытии файлов отличных от текстовых
* Поправил тему оформления
* Исправлена работа в windows
* Уменьшил колдичество выводимой отладочной информации
* Добавлено определение пути до git в зависимости от платформы.
* Исправлено создание файла конфигурации
* Исправлено создание файла конфигурации. Добавлены номера версий в вызов tclsh8.6 и wish8.6. Убрана зависимость на Threads.
* Исправлено чтение структуры проекта при открытии из меню 'Открыть недавнее'
* Bugfix release
* Bug fix with varhelper
* Added the "Open Recent" menu. The "recentlyEditedFolders" option in the configuration file contains a list of recently opened directories. The procedures for working with this list have also been added.
* Косметические изменения.
* Исправлены ошибки при вставке кавычек
-- Калинин Сергей Валерьевич <svk@nuk-svk.ru> Thu, 30 Jan 2025 12:19:56 +0300
projman (2.0.0-alpha19) stable; urgency=medium
* Переделал сигналы и сочетния
* Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения.
* Добавлена передача сигналов для закрытия запущенного процесса
* Изменил виджет текста в окне псевдо-терминала. Добавил подстановку имени файла к командную строку по шаблону %f
* Добавлен диалог настроек
* Добавил псевдо-терминал
* Добавлен диалог при открытии файлов отличных от текстовых
* Добавлен просмотр файлов изображений (png, bmp, gif, ppm, pgm)
* Исправлена процедура опреления типа файла
* Добавлены диалоги для подтверждения открытия больших файлов, и двоичных файлов.
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 29 Oct 2025 13:10:31 +0300
projman (2.0.0-alpha18) stable; urgency=medium
* Поправил тему оформления
* Исправлена работа в windows
* Уменьшил количество выводимой отладочной информации
* Добавлено определение пути до git в зависимости от платформы.
* Исправлено создание файла конфигурации
* Добавлены номера версий в вызов tclsh8.6 и wish8.6.
* Убрана зависимость на Threads.
* Исправлено чтение структуры проекта при открытии из меню 'Открыть недавнее'
* Исправление работы процедуры varhelper
-- Sergey Kalinin <svk@nuk-svk.ru> Mon, 27 Oct 2025 14:05:40 +0300
projman (2.0.0-alpha17) stable; urgency=medium
* Added the "Open Recent" menu.
* The "recentlyEditedFolders" option in the configuration file contains a list of recently opened directories.
* The procedures for working with this list have also been added.
* Новая сборка
-- svk <svk@nuk-svk.ru> Sat, 18 Oct 2025 16:29:50 +0300
projman (2.0.0-alpha17) stable; urgency=medium
* Косметические изменения.
* Исправлены ошибки при вставке кавычек
* Обновить README.md
-- svk <svk@nuk-svk.ru> Thu, 31 Oct 2024 19:48:30 +0300
Sergey Kalinin <svk@nuk-svk.ru> Thu, 22 Aug 2024 15:09:19 +0300
- changelog-gen.tcl: Добавлена генерация текстового журнала изменений

View File

@@ -69,6 +69,17 @@ tcllib, tklib
![projman_global_search.png](https://nuk-svk.ru/images/projman_global_search.png)
- A pseudo-terminal for launching the edited file and other command
![projman_global_search.png](https://nuk-svk.ru/images/projman_terminal_1.png)
![projman_global_search.png](https://nuk-svk.ru/images/projman_terminal_2.png)
- Image viewer
![projman_imageviewer.png](https://nuk-svk.ru/images/projman_imageviewer.png)
## Getting source code
Download the source code https://git.nuk-svk.ru/svk/projman/
@@ -120,7 +131,6 @@ Or type "projman" into terminal, Or choose the name of the program "Projman" on
- Ctrl-N - Create new file
- Ctrl-O - Open file
- Ctrl-W - Close editor (file)
- Ctrl-K - Open folder
- Ctrl-Q - Quit from ProjMan
- Ctrl-J - Show procedures (functions) list for navigation in open editor
- Ctrl-L - Find and display files where the variable is defined, the name of which is located under the cursor in the editor
@@ -134,6 +144,10 @@ Or type "projman" into terminal, Or choose the name of the program "Projman" on
- Ctrl-G - Go to line dialog
- Ctrl-C - Copy selected text into buffer
- Ctrl-V - Paste text from buffer
- Ctrl-R - Open terminal for edited file
- Ctrl-Z - Send SIGTSTP signal
- Ctrl-D - Send SIGINT signal
- Ctrl-C - Send SIGKILL signal
- Alt-P - Show/Hide the file tree panel
- Alt-W - Delete the current word
@@ -142,6 +156,7 @@ Or type "projman" into terminal, Or choose the name of the program "Projman" on
- Alt-R - Delete current line
- Alt-Y - Copy current line into buffer
- Alt-S - Split the edited window horizontally
- Alt-K - Open folder
## Credits

5
TODO
View File

@@ -7,7 +7,7 @@
--- Ansible ---
1. Определение всех переменных в отдельный список
- внутри файла, конструкции вида:
- внутри файла, конструкции вида:
set_fact:
varName: value
set_fact varName value
@@ -18,5 +18,4 @@
- var1.yml
- var2.yml
3. Если используется роль и переменная не найдена в плэйбуке то искать в роли (не факт что требуется)
3. Если используется роль и переменная не найдена в плэйбуке

View File

@@ -1,6 +1,6 @@
#!/bin/sh
# Tcl ignores the next line -*- tcl -*- \
exec tclsh "$0" -- "$@"
exec tclsh8.6 "$0" -- "$@"
######################################################################
# ProjMan 2
@@ -334,4 +334,3 @@ if [info exists args(--txt)] {
StoreChangeLog $outText
}
}

View File

@@ -3,7 +3,7 @@
cd ../
VERSION=$(grep Version projman.tcl | grep -oE '\b[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}\b')
RELEASE=$(grep Release projman.tcl | grep -oE '[0-9A-Za-z]+$')
RELEASE=$(grep "# Release" projman.tcl | grep -oE '[0-9A-Za-z]+$')
BUILD_DATE=$(date +%d%m%Y%H%M%S)
TXT="# Build: ${BUILD_DATE}"
echo "$VERSION, $RELEASE, $BUILD_DATE"

114
debian/changelog vendored
View File

@@ -1,3 +1,106 @@
projman (2.0.0-beta1) stable; urgency=medium
* Сделан вывод отладочной информации по запросу.
* Добавлены параметры в файл конфигурации "debug" - включение или отключение отладки и "debugOut" - куда выводить информацию.
* Переделка кода.
* Добавлены процедуры проверки наличия параметров конфигурации в файле и устанвоки переменных по умолчанию.
-- svk <svk@nuk-svk.ru> Wed, 21 Jan 2026 16:44:07 +0300
projman (2.0.0-alpha24) stable; urgency=medium
* Добавил фокус ввода на 'терминал' если он открыт во вкладке (при переключении вкладок).
* Исправил вставку кавычек при выделении текста
* Исправил ошибку при отправке сигналов несуществующему процессу.
* Уменьшил всплывающее меню: вынес менюшки Файл и Вид в подменю.
* Изменил команду загрузки пакета в репу
-- svk <svk@nuk-svk.ru> Wed, 21 Jan 2026 16:35:06 +0300
projman (2.0.0-alpha23) stable; urgency=medium
* Исправлен флаг модификации при открытии файла
* Исправлена 'Отмена' до пустого файла. Внес исправления на основе изменений https://github.com/wandrien/projman
* Исправлено поведение при сочетании клавиш Control-y (повторение последнего действия)
-- svk <svk@nuk-svk.ru> Mon, 19 Jan 2026 14:49:29 +0300
projman (2.0.0-alpha22) stable; urgency=medium
* Исправил закрытие вкладок редактора и сохранение файла при разделении экрана.
* Новая сборка
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 3 Dec 2025 18:06:32 +0300
projman (2.0.0-alpha21) stable; urgency=medium
* Исправил ошибку
* Добавлены настройки путей к программам для выполнения редактируемых файлов для каждого поддержимаего типа. И использование этих настроек при выполнении файла.
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 3 Dec 2025 17:59:31 +0300
projman (2.0.0-alpha20) stable; urgency=medium
* Добавление вывод номера версии tcl/tl в О Программе
-- Sergey Kalinin <svk@nuk-svk.ru> Mon, 03 Dec 2025 17:22:44 +0300
projman (2.0.0-alpha19) stable; urgency=medium
* Исправил сохранение и закрытие нового файла. Теперь при сохранении файл будет переоткрыт под новым именем.
* Добавил проверку пакета Img. И поправил проверку типов изображений
* Переделал сигналы и сочетания
* Небольшие исправления
* Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения.
* Добавлена передача сигналов для закрытия запущенного процесса
* Изменил виджет текста в окне псевдо-терминала. Добавил подстановку имени файла к командную строку по шаблону %f
* Добавлен диалог настроек
* Добавил псевдо-терминал
* Добавлен диалог при открытии файлов отличных от текстовых
* Поправил тему оформления
* Исправлена работа в windows
* Уменьшил колдичество выводимой отладочной информации
* Добавлено определение пути до git в зависимости от платформы.
* Исправлено создание файла конфигурации
* Исправлено создание файла конфигурации. Добавлены номера версий в вызов tclsh8.6 и wish8.6. Убрана зависимость на Threads.
* Исправлено чтение структуры проекта при открытии из меню 'Открыть недавнее'
* Bugfix release
* Bug fix with varhelper
* Added the "Open Recent" menu. The "recentlyEditedFolders" option in the configuration file contains a list of recently opened directories. The procedures for working with this list have also been added.
* Косметические изменения.
* Исправлены ошибки при вставке кавычек
-- Калинин Сергей Валерьевич <svk@nuk-svk.ru> Thu, 30 Jan 2025 12:19:56 +0300
projman (2.0.0-alpha19) stable; urgency=medium
* Переделал сигналы и сочетния
* Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения.
* Добавлена передача сигналов для закрытия запущенного процесса
* Изменил виджет текста в окне псевдо-терминала. Добавил подстановку имени файла к командную строку по шаблону %f
* Добавлен диалог настроек
* Добавил псевдо-терминал
* Добавлен диалог при открытии файлов отличных от текстовых
* Добавлен просмотр файлов изображений (png, bmp, gif, ppm, pgm)
* Исправлена процедура опреления типа файла
* Добавлены диалоги для подтверждения открытия больших файлов, и двоичных файлов.
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 29 Oct 2025 13:10:31 +0300
projman (2.0.0-alpha18) stable; urgency=medium
* Поправил тему оформления
* Исправлена работа в windows
* Уменьшил количество выводимой отладочной информации
* Добавлено определение пути до git в зависимости от платформы.
* Исправлено создание файла конфигурации
* Добавлены номера версий в вызов tclsh8.6 и wish8.6.
* Убрана зависимость на Threads.
* Исправлено чтение структуры проекта при открытии из меню 'Открыть недавнее'
* Исправление работы процедуры varhelper
-- Sergey Kalinin <svk@nuk-svk.ru> Mon, 27 Oct 2025 14:05:40 +0300
projman (2.0.0-alpha17) stable; urgency=medium
* Added the "Open Recent" menu.
@@ -354,3 +457,14 @@ projman (2.0.0-alfa0) stable; urgency=medium
-- svkalinin <banzaj28@yandex.ru> Thu, 5 Jul 2018 08:41:18 +0300

View File

@@ -25,7 +25,7 @@ set ::configDefault "\[General\]
cfgModifyDate=''
searchCommand=/usr/bin/grep
searchCommandOptions=-r -n -H
gitCommand=/usr/bin/git
gitCommand=
# must return a mime type of file
fileTypeCommand=/usr/bin/file
fileTypeCommandOptions=-i -b
@@ -37,7 +37,7 @@ menuShow=true
statusBarShow=true
filesPanelShow=true
filesPanelPlace=left
geometry=1024x768
geometry=800x600
guiFont={Droid Sans Mono} 9
guiFontBold={Droid Sans Mono} 9 bold
guiFG=#cccccc
@@ -64,7 +64,20 @@ multilineComments=true
\[UserSession\]
opened=
editedFiles=
recentlyEditedFolders=
recentFolder=
\[Executor\]
TCL=tclsh
GO=go
PY=python3
SH=bash
PL=perl
RB=ruby
HTM=firefox
HTML=firefox
LUA=lua
\[Debug\]
debug=false
debugOut=stdout
"
proc Config::create {dir} {
set cfgFile [open [file join $dir projman.ini] "w+"]
@@ -121,3 +134,49 @@ proc Config::write {dir} {
ini::commit $cfgFile
ini::close $cfgFile
}
# Добавление перменной в список
# если отсутствует нужная секция то она будет добавлена.
proc Config::AddVariable {key value section} {
# Проверяем, существует ли уже такая переменная
if {[info exists ::cfgVariables($key)]} {
DebugPuts "The variable '$key' already exists: $::cfgVariables($key)"
return 0
}
# Добавляем в массив переменных
set ::cfgVariables($key) $value
# Добавляем в список ключей секции
if {[info exists ::cfgINIsections($section)]} {
# Проверяем, нет ли уже такого ключа в секции
if {[lsearch -exact $::cfgINIsections($section) $key] == -1} {
lappend ::cfgINIsections($section) $key
}
} else {
set ::cfgINIsections($section) [list $key]
}
DebugPuts "Config::AddVariable: The variable '$key' has been added to the array 'cfgVariables'"
return 1
}
# Проверяем наличие переменных в конфиге на основе "эталонного" списка
# и выставляем значение по умолчанию если в конфиге переменной нет
proc Config::CheckVariables {} {
set valList [split $::configDefault "\n"]
foreach item $valList {
if {[regexp -nocase -all -- {\[(\w+)\]} $item -> v1]} {
set section $v1
}
if {[regexp {^([^=]+)=(.*)$} $item -> var value]} {
if ![info exists ::cfgVariables($var)] {
DebugPuts "Error in Config::CheckVariables: variable ::cfgVariables($var) not found"
# set ::cfgVariables($var) $value
DebugPuts "Config::CheckVariables: The variable cfgVariables($var) setting to default value \"$value\""
Config::AddVariable "$var" "$value" "$section"
}
}
}
}

View File

@@ -6,7 +6,6 @@
######################################################
# Editor module
######################################################
namespace eval Editor {
variable selectionTex
# Set the editor option
@@ -94,7 +93,7 @@ namespace eval Editor {
# }
set commentProcedure "GetComment"
puts "$fileType, $commentProcedure"
# puts "$fileType, $commentProcedure"
if {$selIndex != ""} {
set lineBegin [lindex [split [lindex $selIndex 0] "."] 0]
set lineEnd [lindex [split [lindex $selIndex 1] "."] 0]
@@ -140,10 +139,10 @@ namespace eval Editor {
set cmd "regexp -nocase -indices -- {(^|\s+)\\s*($symbol\\s*)(.*)} {$str} match v1 v2 v3"
puts $cmd
# puts $cmd
# puts [eval $cmd]
if [eval $cmd] {
puts "$match, $v2, $v3"
# puts "$match, $v2, $v3"
return [list [lindex [split $v2] 0] [lindex [split $v3] 0]]
} else {
return 0
@@ -253,7 +252,7 @@ namespace eval Editor {
$txt highlight $lineBegin.0 $lineEnd.end
} else {
set str [$txt get $lineNum.0 $lineNum.end]
puts ">>>>> $str"
# puts ">>>>> $str"
if {[regexp -nocase -indices -- {(^\s*)(.*?)} $str match v1]} {
set posBegin [lindex [split $v1] 0]
set posEnd [lindex [split $v1] 1]
@@ -277,7 +276,7 @@ namespace eval Editor {
set pos [$txt index insert]
set lineNum [lindex [split $pos "."] 0]
set posNum [lindex [split $pos "."] 1]
puts "$pos"
# puts "$pos"
if {$lineNum > 1} {
# get current text
set curText [$txt get $lineNum.0 "$lineNum.0 lineend"]
@@ -398,7 +397,7 @@ namespace eval Editor {
set win .varhelper
# if { [winfo exists $win] == 0 } { return }
set ind [$win.lBox curselection]
puts ">>>>>>>>>>>> VarHelperBind <<<<<<<<<<<<<<<<"
# puts ">>>>>>>>>>>> VarHelperBind <<<<<<<<<<<<<<<<"
switch -- $K {
Prior {
@@ -443,12 +442,12 @@ namespace eval Editor {
}
} ;# proc auto_completition_key
proc VarHelperEscape {w} {
puts ">>>>>>>>>>>> VarHelperEscape <<<<<<<<<<<<<<<<"
# puts ">>>>>>>>>>>> VarHelperEscape <<<<<<<<<<<<<<<<"
# bindtags $w [list [winfo parent $w] $w Text sysAfter all]
bindtags $w [list [winfo toplevel $w] $w Ctext sysAfter all]
catch { destroy .varhelper }
puts [bindtags $w]
puts [bind $w]
DebugPuts [bindtags $w]
DebugPuts [bind $w]
}
proc VarHelper {x y w word wordType} {
@@ -461,10 +460,10 @@ namespace eval Editor {
# set win .varhelper
# Проверяем если есть выделение то блокировать появление диалога
if {[$txt tag ranges sel] != ""} {
puts "You have selected text [$txt tag ranges sel]"
DebugPuts "You have selected text [$txt tag ranges sel]"
return
}
puts "$x $y $w $word $wordType"
# puts "$x $y $w $word $wordType"
set fileType [dict get $editors $txt fileType]
if {[dict exists $editors $txt variableList] != 0} {
@@ -580,7 +579,7 @@ namespace eval Editor {
if { [set height [llength $findedVars]] > 10 } { set height 10 }
$win.lBox configure -height $height
focus $win.lBox
# focus $win.lBox
bind $win <Escape> {
destroy $Editor::win
@@ -592,7 +591,7 @@ namespace eval Editor {
focus -force $Editor::txt.t
break
}
bind $win <Control-Return> {
bind VarHelperBind <Control-Return> {
$Editor::txt delete "insert - 1 chars wordstart" "insert wordend - 1 chars"
$Editor::txt insert "insert" [.varhelper.lBox get [.varhelper.lBox curselection]]
# eval [bind VarHelperBind <Escape>]
@@ -762,7 +761,7 @@ namespace eval Editor {
}
## GET KEYS CODE ##
proc Key {key str} {
puts "Pressed key code: $key, $str"
# puts "Pressed key code: $key, $str"
if {$key >= 10 && $key <= 22} {return "true"}
if {$key >= 24 && $key <= 36} {return "true"}
if {$key >= 38 && $key <= 50} {return "true"}
@@ -786,36 +785,50 @@ namespace eval Editor {
bind $txt <Control-eacute> Quit
bind $txt <Control-igrave> "Editor::SelectionPaste $txt"
bind $txt <Control-v> "Editor::SelectionPaste $txt"
bind $txt <Control-Cyrillic_em> "Editor::SelectionPaste $txt"
bind $txt <Control-l> "SearchVariable $txt; break"
bind $txt <Control-Cyrillic_de> "SearchVariable $txt; break"
bind $txt <Control-i> "ImageBase64Encode $txt"
bind $txt <Control-Cyrillic_sha> "ImageBase64Encode $txt"
bind $txt <Control-bracketleft> "Editor::InsertTabular $txt"
bind $txt <Control-bracketright> "Editor::DeleteTabular $txt"
bind $txt <Control-comma> "Editor::Comment $txt $fileType"
bind $txt <Control-period> "Editor::Uncomment $txt $fileType"
bind $txt <Control-eacute> Find
bind $txt <Insert> {OverWrite}
# bind $txt <Insert> {OverWrite}
bind $txt <ButtonRelease-1> "Editor::SearchBrackets $txt"
bind $txt <Button-1><ButtonRelease-1> "Editor::SelectionHighlight $txt"
bind $txt <<Modified>> "SetModifiedFlag $w $nb"
bind $txt <Control-i> ImageBase64Encode
bind $txt <<Modified>> "SetModifiedFlag $w $nb auto"
bind $txt <Control-u> "Editor::SearchBrackets %W"
bind $txt <Control-Cyrillic_ghe> "Editor::SearchBrackets %W"
bind $txt <Control-J> "catch {Editor::GoToFunction $txt}"
bind $txt <Control-j> "catch {Editor::GoToFunction $txt}; break"
bind $txt <Control-y> {Redo; break}
bind $txt <Control-Cyrillic_o> "catch {Editor::GoToFunction $txt}; break"
bind $txt <Alt-w> "$txt delete {insert wordstart} {insert wordend}"
bind $txt <Alt-odiaeresis> "$txt delete {insert wordstart} {insert wordend}"
bind $txt <Alt-Cyrillic_tse> "$txt delete {insert wordstart} {insert wordend}"
bind $txt <Alt-r> "$txt delete {insert linestart} {insert lineend + 1char}"
bind $txt <Alt-ecircumflex> "$txt delete {insert linestart} {insert lineend + 1char}"
bind $txt <Alt-Cyrillic_er> "$txt delete {insert linestart} {insert lineend + 1char}"
bind $txt <Alt-b> "$txt delete {insert linestart} insert"
bind $txt <Alt-Cyrillic_i> "$txt delete {insert linestart} insert"
bind $txt <Alt-e> "$txt delete insert {insert lineend}"
bind $txt <Alt-Cyrillic_u> "$txt delete insert {insert lineend}"
bind $txt <Alt-s> "Editor::SplitEditorH $w $fileType"
bind $txt <Alt-ucircumflex> "Editor::SplitEditorH $w $fileType"
bind $txt <Alt-Cyrillic_hardsign> "Editor::SplitEditorH $w $fileType"
bind $txt <Alt-y> "Editor::TextCopy $txt"
bind $txt <Alt-Cyrillic_en> "Editor::TextCopy $txt"
bind $txt <Control-g> "Editor::GoToLineNumberDialog $txt"
bind $txt <Control-Cyrillic_pe> "Editor::GoToLineNumberDialog $txt"
bind $txt <Control-agrave> "Editor::FindDialog $w"
bind $txt <Control-f> "Editor::FindDialog $txt"
bind $txt <Control-Cyrillic_a> "Editor::FindDialog $txt"
bind $txt <Control-F> "Editor::FindDialog $txt"
bind $txt <Control-odiaeresis> FileOper::Close
bind $txt <Control-w> FileOper::Close
bind $txt <Control-Cyrillic_tse> FileOper::Close
bind $txt <Control-o> {
set filePath [FileOper::OpenDialog]
if {$filePath != ""} {
@@ -830,6 +843,16 @@ namespace eval Editor {
}
break
}
bind $txt <Control-Cyrillic_shcha> {
set filePath [FileOper::OpenDialog]
if {$filePath != ""} {
FileOper::Edit $filePath
}
break
}
bind $txt <Control-r> "Editor::SplitEditorForExecute $w $fileType $nb "
bind $txt <Control-Cyrillic_ka> "Editor::SplitEditorForExecute $w $fileType $nb "
# bind $txt.t <KeyRelease> "Editor::ReleaseKey %K $txt.t $fileType"
# bind $txt.t <KeyPress> "Editor::PressKey %K $txt.t"
# bind $txt <KeyRelease> "Editor::Key %k %K"
@@ -890,7 +913,7 @@ namespace eval Editor {
set lineNum [lindex [split $pos "."] 0]
set posNum [lindex [split $pos "."] 1]
set symbol [string trim [string trimleft $symbol "\\"]]
puts "Selindex : $selIndex, cursor position: $pos, Symbol: $symbol"
# puts "Selindex : $selIndex, cursor position: $pos, Symbol: $symbol"
if {$selIndex != ""} {
set lineBegin [lindex [split [lindex $selIndex 0] "."] 0]
set posBegin [lindex [split [lindex $selIndex 0] "."] 1]
@@ -898,13 +921,15 @@ namespace eval Editor {
set posEnd [lindex [split [lindex $selIndex 1] "."] 1]
set selText [$txt get $lineBegin.$posBegin $lineEnd.$posEnd]
# set selText $selectionText
puts "Selected text: $selText, pos: $pos, lineBegin: $lineBegin, posBegin: $posBegin, pos end: $posEnd"
# puts "Selected text: $selText, pos: $pos, lineBegin: $lineBegin, posBegin: $posBegin, pos end: $posEnd"
if {$posNum == $posEnd} {
$txt insert $lineBegin.$posBegin "$symbol"
}
if {$posNum == $posBegin} {
if {$symbol == {"} || $symbol == {_}} {
$txt insert $lineEnd.$posEnd "$selText$symbol"
$txt tag remove sel $lineBegin.$posBegin $lineEnd.$posEnd
$txt insert $lineEnd.$posEnd "$symbol"
# $txt tag add sel "$lineBegin.$posBegin + 1 char" "$lineEnd.$posEnd + 1 char"
} else {
$txt insert $lineEnd.$posEnd "$symbol"
}
@@ -913,7 +938,7 @@ namespace eval Editor {
if {$posBegin == 0} {
$txt insert $pos "$symbol"
} else {
$txt insert "$pos + 1 chars" "$symbol"
$txt insert "$pos + 0 chars" "$symbol"
}
}
$txt highlight $lineBegin.$posBegin $lineEnd.end
@@ -939,10 +964,10 @@ namespace eval Editor {
# set fileName untitled-$untitledNumber
set fileFullPath untitled-$untitledNumber
#puts [Tree::InsertItem $tree {} $fileFullPath "file" $fileName]
set nbEditorItem [NB::InsertItem $nbEditor $fileFullPath "file"]
set nbEditorItem [NB::InsertItem $nbEditor $fileFullPath "file"]
# puts "$nbEditorItem, $nbEditor"
Editor $fileFullPath $nbEditor $nbEditorItem
SetModifiedFlag $nbEditorItem $nbEditor
SetModifiedFlag $nbEditorItem $nbEditor force
focus -force $nbEditorItem.frmText.t.t
}
@@ -960,7 +985,7 @@ namespace eval Editor {
if {[eval [dict get $lexers $fileType procRegexpCommand]]} {
set procName_ [string trim $procName]
if {$treeItemName ne ""} {
puts [Tree::InsertItem $tree $treeItemName $procName_ "procedure" "$procName_ ($params)"]
Tree::InsertItem $tree $treeItemName $procName_ "procedure" "$procName_ ($params)"
}
lappend procList [list $procName_ $params]
unset procName_
@@ -984,7 +1009,7 @@ namespace eval Editor {
} else {
set varType ""
}
puts "variable: $varName, value: $varValue, type: $varType"
# puts "variable: $varName, value: $varValue, type: $varType"
lappend varList [list $varName $varValue]
}
}
@@ -994,7 +1019,7 @@ namespace eval Editor {
}
proc FindFunction {txt findString} {
puts "txt: $txt, $findString"
# puts "txt: $txt, $findString"
set pos "0.0"
$txt see $pos
set line [lindex [split $pos "."] 0]
@@ -1061,7 +1086,7 @@ namespace eval Editor {
# Вызов диалога со списком процедур или функций присутствующих в тексте
proc GoToFunction { w } {
global tree editors
puts $w
# puts $w
# set txt $w.frmText.t
set txt $w
set box [$txt bbox insert]
@@ -1071,7 +1096,7 @@ namespace eval Editor {
# puts "--$txt"
# puts $editors($txt)
foreach item [dict get $editors $txt procedureList] {
puts $item
# puts $item
lappend l [lindex $item 0]
}
if {$l ne ""} {
@@ -1163,7 +1188,7 @@ namespace eval Editor {
proc FindReplaceText {txt findString replaceString regexp} {
global nbEditor
puts [focus]
# puts [focus]
# set txt [$nbEditor select].frmText.t
$txt tag remove sel 1.0 end
# $txt see $pos
@@ -1192,7 +1217,7 @@ namespace eval Editor {
set lstFindIndex [$txt search -all -nocase -count matchIndexPair $findString $line.$x end]
# set symNumbers [string length "$findString"]
}
puts $lstFindIndex
# puts $lstFindIndex
# puts $matchIndexPair
# set lstFindIndex [$txt search -all "$selectionText" 0.0]
@@ -1206,7 +1231,7 @@ namespace eval Editor {
set selFindRow [lindex [split $ind "."] 1]
# set endInd "$selFindLine.[expr $selFindRow + $symNumbers]"
set endInd "$selFindLine.[expr [lindex $matchIndexPair $i] + $selFindRow]"
puts "$ind; $selFindLine, $selFindRow; $endInd "
# puts "$ind; $selFindLine, $selFindRow; $endInd "
if {$replaceString ne ""} {
$txt replace $ind $endInd $replaceString
# Вычисляем индекс вхождения строки после замены для выделения в тексте
@@ -1259,7 +1284,7 @@ namespace eval Editor {
} else {
if {[$nbEditor select] ne ""} {
set txt [$nbEditor select].frmText.t
puts $txt
# puts $txt
} else {
return
}
@@ -1285,7 +1310,7 @@ namespace eval Editor {
}
ttk::button $win.bBackward -state disable -image backward_20x20 -command "puts $replaceString"
ttk::button $win.bDone -image done_20x20 -state disable -command {
puts "$findString -> $replaceString, $regexpSet"
DebugPuts "$findString -> $replaceString, $regexpSet"
}
ttk::button $win.bDoneAll -image doneall_20x20 -command {
Editor::FindReplaceText $Editor::txt "$findString" "$replaceString" $regexpSet
@@ -1347,7 +1372,7 @@ namespace eval Editor {
# Horizontal split the Editor text widget
proc SplitEditorH {w fileType nb} {
global cfgVariables
puts [$w.panelTxt panes]
# puts [$w.panelTxt panes]
if [winfo exists $w.frmText2] {
$w.panelTxt forget $w.frmText2
destroy $w.frmText2
@@ -1355,6 +1380,7 @@ namespace eval Editor {
return
}
set frmText [Editor::EditorWidget $w $fileType $nb]
# puts "Editor::SplitEditorH: w - $w"
$frmText.t insert end [$w.frmText.t get 0.0 end]
# $w.panelTxt add $w.frmText -weight 0
@@ -1367,9 +1393,9 @@ namespace eval Editor {
proc SplitEditorV {fileFullPath} {
global cfgVariables
regsub -all {\.|/|\\|\s} $fileFullPath "_" itemName
regsub -all {\.|/|\\|\s|:} $fileFullPath "_" itemName
set itemName ".frmWork.nbEditor2.$itemName"
# puts $itemName
DebugPuts "Editor::SplitEditoprV: nb item - $itemName"
if {[winfo exists $itemName] == 1} {
.frmWork.nbEditor2 forget $itemName
destroy $itemName
@@ -1389,9 +1415,7 @@ namespace eval Editor {
# grid columnconfigure .frmWork .frmWork.nbEditor2 -weight 1
# grid rowconfigure .frmWork .frmWork.nbEditor2 -weight 1
.frmWork.panelNB add .frmWork.nbEditor2 -weight 0
puts [FileOper::Edit $fileFullPath .frmWork.nbEditor2]
DebugPuts [FileOper::Edit $fileFullPath .frmWork.nbEditor2]
}
proc GoToLineNumber {text lineNumber} {
@@ -1432,7 +1456,7 @@ namespace eval Editor {
bind $win.ent <Return> {
set lineNumber [.gotoline.ent get]
# $txt see insert $lineNumber
puts $Editor::txt
DebugPuts $Editor::txt
$Editor::txt mark set insert $lineNumber.0
$Editor::txt see insert
focus $Editor::txt.t
@@ -1489,8 +1513,8 @@ namespace eval Editor {
dict set editors $txt fileType $fileType
dict set editors $txt procedureList [list]
puts ">>[dict get $editors $txt fileType]"
puts ">>[dict get $editors $txt procedureList]"
# puts ">>[dict get $editors $txt fileType]"
# puts ">>[dict get $editors $txt procedureList]"
# puts ">>>>> $editors"
if {[info procs ::Highlight::$fileType] ne ""} {
@@ -1515,6 +1539,7 @@ namespace eval Editor {
ICO
XPM
}
# puts "$itemName"
set fr $itemName
if ![string match "*untitled*" $itemName] {
set lblText $fileFullPath
@@ -1524,6 +1549,8 @@ namespace eval Editor {
}
set fileType [string toupper [string trimleft [file extension $fileFullPath] "."]]
if {$fileType eq ""} {set fileType "Unknown"}
ExecutorCommandPathSetting $fileType
ttk::frame $fr.header
set lblName "lbl[string range $itemName [expr [string last "." $itemName] +1] end]"
@@ -1536,9 +1563,13 @@ namespace eval Editor {
-command "Editor::SplitEditorH $fr $fileType $nb"
ttk::button $fr.header.$btnSplitV -image split_vertical_11x11 \
-command "Editor::SplitEditorV $fileFullPath"
set btnSplitExecute "btnSplitExec[string range $itemName [expr [string last "." $itemName] +1] end]"
ttk::button $fr.header.$btnSplitExecute -image execute_11x11 \
-command "Editor::SplitEditorForExecute $fr $fileType $nb $fileFullPath"
# pack $fr.$btnSplitH $fr.$btnSplitV -side right -anchor e
pack $fr.header.$lblName -side left -expand true -fill x
pack $fr.header.$btnSplitV $fr.header.$btnSplitH -side right
pack $fr.header.$btnSplitV $fr.header.$btnSplitH $fr.header.$btnSplitExecute -side right
pack $fr.header -side top -fill x
@@ -1556,4 +1587,28 @@ namespace eval Editor {
return $fr
}
proc SplitEditorForExecute {w fileType nb {fileFullPath ""}} {
global cfgVariables tree
if {$fileFullPath eq ""} {
set treeItem "file::[string range $w [expr [string last "." $w] +1] end ]"
set fileFullPath [Tree::GetItemID $tree $treeItem]
puts $fileFullPath
}
# puts [$w.panelTxt panes]
DebugPuts "$w $fileType $nb $fileFullPath"
if [winfo exists $w.frmText2] {
$w.panelTxt forget $w.frmText2
destroy $w.frmText2
focus -force $w.frmText.t.t
return
}
set frmText [ttk::frame $w.frmText2 -border 1]
$w.panelTxt add $frmText -weight 1
# puts "SplitEditorForExecute: $w"
# focus -force $frmText.t.t
Execute $fileFullPath $frmText $w
}
}

View File

@@ -9,12 +9,42 @@
namespace eval FileOper {
variable types
global packages
variable types
set ::types {
{"All files" *}
}
# Проверка поддерживаемых типов изображений
# в зависимости устновлен пакет или нет
proc SupportImageType {type} {
if {[PackagePresent Img] eq "true"} {
switch $type {
jpeg { return true }
png { return true }
gif { return true }
bmp { return true }
svg { return true }
ppm { return true }
pgm { return true }
tiff { return true }
xbm { return true }
xpm { return true }
default { return false}
}
} else {
switch $type {
png { return true }
gif { return true }
bmp { return true }
svg { return true }
ppm { return true }
pgm { return true }
default { return false}
}
}
}
proc GetFileMimeType {fileFullPath {opt ""}} {
global cfgVariables
# Проверям наличие программы в системе, если есть то добавляем опции
@@ -35,7 +65,7 @@ namespace eval FileOper {
catch $cmd pipe
# puts $pipe
if [regexp -nocase -- {(\w+)/([\w\-_\.]+); charset=([[:alnum:]-]+)} $pipe m fType fExt fCharset] {
puts "$fType $fExt $fCharset"
DebugPuts "$fType $fExt $fCharset"
}
switch $opt {
"charset" {
@@ -47,17 +77,71 @@ namespace eval FileOper {
# линуксовый file не всегда корректно определяет тип файла
# используем пакет из tcl
lassign [::fileutil::fileType $fileFullPath] fType fBinaryType fBinaryInterp
puts "File type is $fType, $fBinaryType, $fBinaryInterp"
DebugPuts "File type is $fType, $fBinaryType, $fBinaryInterp"
set ext [string tolower [file extension $fileFullPath]]
# Установка корректного типа для svg
# Но для новых версий tcl
switch $ext {
".svg" {
set fType "binary"
set fBinaryInterp "svg"
set fBinaryType "graphic"
}
".torrent" {
set fType "binary"
set fBinaryInterp "torrent"
set fBinaryType "x-bittorrent"
}
".pdf" {
set fType "binary"
set fBinaryInterp "pdf"
set fBinaryType "binary"
}
}
DebugPuts "File type is $fType, $fBinaryType, $fBinaryInterp, $ext"
switch $fType {
"binary" {
return false
if {$fBinaryType ne ""} {
switch $fBinaryType {
"graphic" {
if {[SupportImageType $fBinaryInterp] eq "true"} {
return image
} else {
set answer [tk_messageBox -message [::msgcat::mc "The file looks like a image. Support not implemented yet."] -icon question -type ok]
switch $answer {
ok {
return false
}
}
}
}
default {
return binary
}
}
} else {
return binary
}
}
"text" {
return text
}
"image" {
return false
if {[SupportImageType $fBinaryInterp] eq "true"} {
return image
} else {
set answer [tk_messageBox -message [::msgcat::mc "The file looks like a image. Support not implemented yet."] -icon question -type ok]
switch $answer {
ok {
return false
}
}
}
}
"empty" {
return text
}
default {
return false
@@ -214,9 +298,13 @@ namespace eval FileOper {
}
}
proc Close {} {
proc Close {{nbEditorWindow ""}} {
global nbEditor modified tree editors
set nbItem [$nbEditor select]
if {$nbEditorWindow eq ""} {
set nbEditorWindow $nbEditor
}
set nbItem [$nbEditorWindow select]
# puts "Procedure FileOper::Close: item - $nbItem"
# puts "close tab $nbItem"
if {$nbItem == ""} {return}
@@ -226,14 +314,16 @@ namespace eval FileOper {
-icon question -type yesnocancel \
-detail [::msgcat::mc "Do you want to save it?"]]
switch $answer {
yes Save
yes {Save close $nbEditorWindow}
no {}
cancel {return "cancel"}
}
}
}
$nbEditor forget $nbItem
destroy $nbItem
if {[$nbEditorWindow select] eq $nbItem} {
$nbEditorWindow forget $nbItem
destroy $nbItem
}
set treeItem "file::[string range $nbItem [expr [string last "." $nbItem] +1] end ]"
if [$tree exists $treeItem] {
# delete all functions from tree item
@@ -255,28 +345,36 @@ namespace eval FileOper {
.frmStatus.lblPosition configure -text ""
.frmStatus.lblEncoding configure -text ""
.frmStatus.lblSize configure -text ""
NB::NextTab $nbEditor 0
NB::NextTab $nbEditorWindow 0
}
proc Save {} {
global nbEditor tree env activeProject
proc Save {{type ""} {nbEditorWindow ""}} {
global nbEditor tree env activeProject dir
if [info exists activeProject] {
set dir $activeProject
set dirProject $activeProject
} else {
set dir $env(HOME)
set dirProject $env(HOME)
}
set nbEditorItem [$nbEditor select]
puts "Saved editor text: $nbEditorItem"
if {$nbEditorWindow eq ""} {
set nbEditorWindow $nbEditor
set str [split [focus] "."]
set nbEditorWindow "[lindex $str 0].[lindex $str 1].[lindex $str 2]"
# puts "FileOper::Save: current window $nbEditorWindow"
}
# puts "FileOper::Save: $nbEditorWindow"
set nbEditorItem [$nbEditorWindow select]
DebugPuts "Saved editor text: $nbEditorItem"
if [string match "*untitled*" $nbEditorItem] {
set filePath [tk_getSaveFile -initialdir $dir -filetypes $::types -parent .]
set filePath [tk_getSaveFile -initialdir $dirProject -filetypes $::types -parent .]
if {$filePath eq ""} {
return
}
# set fileName [string range $filePath [expr [string last "/" $filePath]+1] end]
set fileName [file tail $filePath]
$nbEditor tab $nbEditorItem -text $fileName
$nbEditorWindow tab $nbEditorItem -text $fileName
# set treeitem [Tree::InsertItem $tree {} $filePath "file" $fileName]
set lblName "lbl[string range $nbEditorItem [expr [string last "." $nbEditorItem] +1] end]"
$nbEditorItem.header.$lblName configure -text $filePath
@@ -287,9 +385,18 @@ namespace eval FileOper {
set editedText [$nbEditorItem.frmText.t get 0.0 end]
set f [open $filePath "w+"]
puts -nonewline $f $editedText
puts "$f was saved"
# puts "$f was saved"
close $f
ResetModifiedFlag $nbEditorItem $nbEditor
ResetModifiedFlag $nbEditorItem $nbEditorWindow
if {[file tail $filePath] eq "projman.ini"} {
Config::read $dir(cfg)
}
if [string match "*untitled*" $nbEditorItem] {
FileOper::Close
if {$type ne "close"} {
FileOper::Edit $filePath
}
}
}
proc SaveAll {} {
@@ -316,7 +423,7 @@ namespace eval FileOper {
proc ReadFolder {directory {parent ""}} {
global tree dir lexers project
puts "Read the folder $directory"
# puts "Read the folder $directory"
set rList ""
if {[catch {cd $directory}] != 0} {
return ""
@@ -382,39 +489,69 @@ namespace eval FileOper {
set txt $itemName.frmText.t
if ![string match "*untitled*" $itemName] {
set file [open "$fileFullPath" r]
$txt insert end [chan read -nonewline $file]
$txt insert end [chan read -nonewline $file]
close $file
}
# Delete emty last line
if {[$txt get {end-1 line} end] eq "\n" || [$txt get {end-1 line} end] eq "\r\n"} {
$txt delete {end-1 line} end
puts ">[$txt get {end-1 line} end]<"
# puts ">[$txt get {end-1 line} end]<"
}
# ------------
# Thanks https://github.com/wandrien/
# https://github.com/wandrien/projman/commit/7d5539ac2031fbdcb0f4a97465ff19d0c348cf33
$txt edit reset
# -----------
$txt see 1.0
}
proc Edit {fileFullPath {nbEditor .frmWork.nbEditor}} {
global tree
DebugPuts "$fileFullPath"
if {[file exists $fileFullPath] == 0} {
return false
} else {
puts "$fileFullPath File type [::fileutil::magic::filetype $fileFullPath]"
# puts "$fileFullPath File type [::fileutil::magic::filetype $fileFullPath]"
set fileType [FileOper::GetFileMimeType $fileFullPath]
}
# puts "$fileType <<<<<<<<<<<"
switch $fileType {
"text" {
# return text
}
"image" {
# return image
}
"binary" {
set answer [tk_messageBox -message [::msgcat::mc "The file looks like a binary file. Open anyway?"] \
-icon question -type yesno]
switch $answer {
yes {}
no {return}
}
}
false {
return
}
}
# Проверяем размер файла и если он больше 1мб вывести предупреждение
# puts " File size = [file size $fileFullPath]"
if {[file size $fileFullPath] > 1000000} {
set answer [tk_messageBox -message [::msgcat::mc "The file size to big. Open anyway?"] \
-detail [GetFileAttr $fileFullPath "size"] \
-icon question -type yesno]
switch $answer {
yes {}
no {return}
}
}
set filePath [file dirname $fileFullPath]
set fileName [file tail $fileFullPath]
regsub -all {\.|/|\\|\s} $fileFullPath "_" itemName
regsub -all {\.|/|\\|\s|:} $fileFullPath "_" itemName
set itemName [string tolower $itemName]
set itemName "$nbEditor.$itemName"
set treeItemName [Tree::InsertItem $tree {} $fileFullPath "file" $fileName]
@@ -423,6 +560,11 @@ namespace eval FileOper {
if {[winfo exists $itemName] == 0} {
NB::InsertItem $nbEditor $fileFullPath "file"
if {$fileType eq "image"} {
ImageViewer $fileFullPath $itemName $itemName
return $itemName
}
Editor::Editor $fileFullPath $nbEditor $itemName
ReadFile $fileFullPath $itemName
$itemName.frmText.t highlight 1.0 end
@@ -430,6 +572,11 @@ namespace eval FileOper {
$itemName.frmText.t see 1.1
}
$nbEditor select $itemName
focus -force $itemName
if {$fileType eq "image"} {
# ImageViewer $fileFullPath $itemName $itemName
return $itemName
}
Editor::ReadStructure $itemName.frmText.t $treeItemName
GetVariablesFromFile $fileFullPath
$itemName.frmText.t.t mark set insert 1.0
@@ -437,6 +584,8 @@ namespace eval FileOper {
focus -force $itemName.frmText.t.t
.frmStatus.lblSize configure -text [GetFileAttr $fileFullPath "size"]
.frmStatus.lblEncoding configure -text [GetFileMimeType $fileFullPath "charset"]
# puts ">> $itemName"
return $itemName
}

View File

@@ -11,7 +11,29 @@
namespace eval Git {
variable gitCommand
# Определим путь до команды git в зависимсти от платформы
proc CommandPathSetting {} {
global cfgVariables tcl_platform
if {$cfgVariables(gitCommand) == ""} {
if {$tcl_platform(platform) eq "windows"} {
set cmd {where git}
} else {
set cmd {which git}
}
if {[catch {exec {*}$cmd} git_path]} {
puts "Git не найден в системе"
set cfgVariables(gitCommand) ""
return
}
set git_path [string trim $git_path]
set first_path [lindex [split $git_path "\n"] 0]
# puts "Git найден: $first_path"
set cfgVariables(gitCommand) $first_path
}
}
proc GetConfig {option} {
global activeProject cfgVariables
set confOptions {
@@ -69,8 +91,8 @@ namespace eval Git {
}
}
catch $cmd pipe
puts $cmd
puts $pipe
# puts $cmd
# puts $pipe
if [regexp -nocase -- {^error:} $pipe match] {
ShowMessage "Command: '$cmd' error" $pipe
return
@@ -100,7 +122,7 @@ namespace eval Git {
} else {
return ""
}
puts $activeProject
# puts $activeProject
lappend cmd $cfgVariables(gitCommand)
lappend cmd "branch"
# lappend cmd "-s"
@@ -145,7 +167,7 @@ namespace eval Git {
lappend cmd "--"
lappend cmd $activeProject
catch $cmd pipe
puts $cmd
# puts $cmd
if [regexp -nocase -- {^fatal:} $pipe match] {
ShowMessage "Command: '$cmd' error" $pipe
return
@@ -167,7 +189,7 @@ namespace eval Git {
lappend cmd "--"
lappend cmd [file join $activeProject [string trimleft $f "../"]]
catch $cmd pipe
puts $cmd
# puts $cmd
if [regexp -nocase -- {^fatal:} $pipe match] {
ShowMessage "Command: '$cmd' error" $pipe
return
@@ -228,7 +250,7 @@ namespace eval Git {
# set cmd exec
cd $activeProject
set url [Git::GetConfig remote.origin.url]
puts $url
# puts $url
if [regexp -nocase -all -- {^(http|https)://(.+)} $url match proto address] {
Git::AuthorizationDialog "[::msgcat::mc "Authorization required"] [::msgcat::mc "for"] Git" $url
} else {
@@ -248,7 +270,7 @@ namespace eval Git {
# lappend cmd "$activeProject"
# puts "$cmd"
catch $cmd pipe
puts $pipe
# puts $pipe
if [regexp -nocase -- {^fatal:} $pipe match] {
ShowMessage "Command: '$cmd' error" $pipe
return
@@ -301,7 +323,7 @@ namespace eval Git {
$w.body.lCommit delete $itemNumber
}
catch $cmd pipe
puts $cmd
# puts $cmd
$w.body.t delete 1.0 end
}
@@ -357,7 +379,7 @@ namespace eval Git {
$w.body.t delete 1.0 end
set i 0
foreach line [Git::Diff $fileName] {
puts $line
# puts $line
if {$i > 3} {
$w.body.t inser end "$line\n"
}
@@ -381,7 +403,7 @@ namespace eval Git {
$w.body.lBox delete $itemNumber
}
catch $cmd pipe
puts $cmd
# puts $cmd
$w.body.t delete 1.0 end
}
@@ -396,7 +418,7 @@ namespace eval Git {
puts $cmd
catch $cmd pipe
puts $pipe
# puts $pipe
return
}
proc Config {repo user email} {
@@ -407,7 +429,7 @@ namespace eval Git {
lappend cmd "config"
lappend cmd $repo
lappend cmd $dir
puts $cmd
# puts $cmd
# catch $cmd pipe
# puts $pipe
@@ -425,7 +447,7 @@ namespace eval Git {
lappend cmd $cfgVariables(gitCommand)
lappend cmd "init"
lappend cmd $activeProject
puts $cmd
# puts $cmd
catch $cmd pipe
if [regexp -nocase -- {^fatal:} $pipe match] {

View File

@@ -23,12 +23,14 @@ wm overrideredirect . 0
bind . <Control-q> Quit
bind . <Control-Q> Quit
bind . <Control-Cyrillic_shorti> Quit
bind . <Control-eacute> Quit
bind . <Insert> Add
bind . <Delete> Del
# bind . <Insert> Add
# bind . <Delete> Del
bind . <F1> ShowHelpDialog
bind . <Control-n> Editor::New
bind . <Control-N> Editor::New
bind . <Control-Cyrillic_te> Editor::New
bind . <Control-o> {
set filePath [FileOper::OpenDialog]
if {$filePath != ""} {
@@ -41,21 +43,45 @@ bind . <Control-O> {
FileOper::Edit $filePath
}
}
bind . <Control-k> {
bind . <Alt-k> {
set folderPath [FileOper::OpenFolderDialog]
if {$folderPath != ""} {
FileOper::ReadFolder $folderPath
}
}
bind . <Control-K> {
bind . <Alt-K> {
set folderPath [FileOper::OpenFolderDialog]
if {$folderPath != ""} {
FileOper::ReadFolder $folderPath
}
}
bind . <Alt-Cyrillic_el> {
set folderPath [FileOper::OpenFolderDialog]
if {$folderPath != ""} {
FileOper::ReadFolder $folderPath
}
}
# -------------
# Thanks https://github.com/wandrien/
# https://github.com/wandrien/projman/commit/22f6e235c3532c20573d44ee7eaaaa1fb56ad544
event add <<Copy>> <Control-Insert>
event add <<Paste>> <Shift-Insert>
event add <<Cut>> <Shift-Delete>
set latestTxtWidget {}
bind all <FocusIn> {
if {[winfo class %W] eq "Ctext"} {
global latestTxtWidget
set latestTxtWidget %W
}
}
# ---------
bind . <Control-s> {FileOper::Save}
bind . <Control-S> {FileOper::Save}
bind . <Control-Cyrillic_hardsign> {FileOper::Save}
bind . <Alt-p> {ViewFilesTree true}
bind . <Alt-Cyrillic_ze> {ViewFilesTree true}
bind . <Button-3> {catch [PopupMenu %X %Y]}
#ttk::style configure TPanedwindow -background blue
@@ -117,9 +143,14 @@ pack .frmMenu.mnuHelp -side right
# PopUP menu
menu .popup
GetFileMenu .popup
GetEditMenu .popup
GetViewMenu .popup
.popup add separator
menu .popup.file
.popup add cascade -label [::msgcat::mc "File"] -menu .popup.file
GetFileMenu .popup.file
menu .popup.view
.popup add cascade -label [::msgcat::mc "View"] -menu .popup.view
GetViewMenu .popup.view
set frmTool [ttk::frame .frmBody.frmTool]
ttk::panedwindow .frmBody.panel -orient horizontal -style TPanedwindow
@@ -134,11 +165,15 @@ grid .frmBody.panel -row 0 -column 1 -sticky nesw
grid columnconfigure .frmBody .frmBody.panel -weight 1
grid rowconfigure .frmBody .frmBody.panel -weight 1
# Панель инстурментов
ttk::button $frmTool.btn_tree -command ToolBtnTreePress -image tree_24x24
ttk::button $frmTool.btn_search -command FileOper::FindInFiles -image search_24x24
ttk::button $frmTool.btn_git -command Git::Dialog -image git_24x24
ttk::button $frmTool.btn_settings -command Settings -image settings_24x24
pack $frmTool.btn_tree $frmTool.btn_search $frmTool.btn_git -side top -padx 1 -pady 1
pack $frmTool.btn_settings -side bottom -padx 1 -pady 10
# #label $frmTool.lbl_logo -image tcl
# pack $frmTool.btn_quit -side bottom -padx 5 -pady 5
# #pack $frmTool.lbl_logo -side bottom -padx 5 -pady 5

View File

@@ -190,5 +190,25 @@ namespace eval Highlight {} {
ctext::addHighlightClassForRegexp $txt namespaces #0093ff {->|\+\+|::}
ctext::addHighlightClass $txt bool #3e803b {null false true}
}
proc ExecuteColorized {txt} {
# ctext::addHighlightClassForRegexp $txt flags orange {\s-[a-zA-Z]+}
# ctext::addHighlightClass $txt stackControl #19a2a6 [info commands]
# ctext::addHighlightClass $txt widgets #9d468d [list canvas ctext button entry label text labelframe frame toplevel scrollbar checkbutton canvas listbox menu menubar menubutton radiobutton scale entry message tk_chooseDir tk_getSaveFile tk_getOpenFile tk_chooseColor tk_optionMenu ttk::button ttk::checkbutton ttk::combobox ttk::entry ttk::frame ttk::intro ttk::label ttk::labelframe ttk::menubutton ttk::treeview ttk::notebook ttk::panedwindow ttk::progressbar ttk::radiobutton ttk::scale ttk::scrollbar ttk::separator ttk::sizegrip ttk::spinbox ]
# ctext::addHighlightClassWithOnlyCharStart $txt vars #4471ca "\$"
# ctext::addHighlightClass $txt variable_funcs gold {set global variable unset}
# # ctext::addHighlightClassForSpecialChars $txt brackets green {[]{}()}
# ctext::addHighlightClassForRegexp $txt namespaces #4f64ff {::}
# ctext::addHighlightClassForRegexp $txt qoute #b84a0c {("|'|`).+("|'|`)}
# ctext::addHighlightClassForRegexp $txt colors #68ceff {(#)(\w)+?(\s|$)}
# ctext::addHighlightClassForRegexp $txt comments #666666 {(^|;)\s*(#)[^\n\r]*}
# ctext::addHighlightClass $txt bool #3e803b {null false true}
# ctext::addHighlightClassForRegexp $txt paths lightblue {(\s)([\w]+)(=)}
# ctext::addHighlightClassForSpecialChars $txt tags lightgreen {<>/}
# ctext::addHighlightClassForRegexp $txt tags #199100 {/.+\s}
ctext::addHighlightClassForRegexp $txt gopaths lightblue {(.+?):(\d+):(\d+):}
ctext::addHighlightClassForRegexp $txt paths lightblue {(\\|/|\.|^)((\w)|(\.)|(/)|([\.\w]))+?\s}
ctext::addHighlightClass $txt compile_errors #ff5050 {error Error ERROR invalid undefined cannot}
ctext::addHighlightClassForRegexp $txt url lightblue {\w+://\w.+\w+}
}
}

View File

@@ -1912,4 +1912,38 @@ image create photo j2_16x12 -data {
waYDtkPwRhMJCQAAcy6XQBVVAwTH2sGQ25vNaAwYtjCvkcjhE5Ysd1Cwe/gmifh0nQMAwBvJ5H54
5nEG7+28M9SARyoW37c7A72MxzFpr/Dd1sUKRxpZbJg7joMDAwDgDzlS9ta5m7mUAAAAAElFTkSu
QmCC
}
}
image create photo execute_11x11 -data {
iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAABg2lDQ1BJQ0MgcHJvZmlsZQAAKJF9
kT1Iw1AUhU9TpVIqDnYQUclQneyiIo5ahSJUCLVCqw4mL/2DJg1Jiouj4Fpw8Gex6uDirKuDqyAI
/oC4C06KLlLifUmhRYwPLu/jvHcO990HCI0K06yuWUDTbTOdTIjZ3KoYekUYw1QjiMrMMuYkKQXf
9XWPAN/v4jzL/96fq1fNWwwIiMSzzDBt4g3i6U3b4LxPHGUlWSU+Jx43qUHiR64rHr9xLros8Myo
mUnPE0eJxWIHKx3MSqZGPEUcUzWd8oWsxyrnLc5apcZaffIXRvL6yjLXqYaQxCKWIEGEghrKqMBG
nHadFAtpOk/4+Addv0QuhVxlMHIsoAoNsusH/4Pfs7UKkxNeUiQBdL84zscoENoFmnXH+T52nOYJ
EHwGrvS2v9oAZj5Jr7e12BHQtw1cXLc1ZQ+43AEGngzZlF0pSCUUCsD7GX1TDui/BcJr3txa5zh9
ADI0q9QNcHAIjBUpe93n3T2dc/v3Tmt+P5frcrXBnzRwAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
WXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH6QodCiMdxWTpZwAAABl0RVh0Q29tbWVudABDcmVhdGVk
IHdpdGggR0lNUFeBDhcAAABHSURBVBjTjY/BDQAwCAKNUzleux1b2Y+PxgiRJ7kjalYBkADSRLwX
SvCpZIKzlUlwdWMXJFw5Kzgi7mr5A/XyBI4wA9kzFHrskxvBNKQinAAAAABJRU5ErkJggg==
}
image create photo settings_24x24 -data {
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABg2lDQ1BJQ0MgcHJvZmlsZQAAKJF9
kT1Iw1AUhU9TpVIqDnYQUclQneyiIo5ahSJUCLVCqw4mL/2DJg1Jiouj4Fpw8Gex6uDirKuDqyAI
/oC4C06KLlLifUmhRYwPLu/jvHcO990HCI0K06yuWUDTbTOdTIjZ3KoYekUYw1QjiMrMMuYkKQXf
9XWPAN/v4jzL/96fq1fNWwwIiMSzzDBt4g3i6U3b4LxPHGUlWSU+Jx43qUHiR64rHr9xLros8Myo
mUnPE0eJxWIHKx3MSqZGPEUcUzWd8oWsxyrnLc5apcZaffIXRvL6yjLXqYaQxCKWIEGEghrKqMBG
nHadFAtpOk/4+Addv0QuhVxlMHIsoAoNsusH/4Pfs7UKkxNeUiQBdL84zscoENoFmnXH+T52nOYJ
EHwGrvS2v9oAZj5Jr7e12BHQtw1cXLc1ZQ+43AEGngzZlF0pSCUUCsD7GX1TDui/BcJr3txa5zh9
ADI0q9QNcHAIjBUpe93n3T2dc/v3Tmt+P5frcrXBnzRwAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
WXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH6QodESQY6jzHvgAAABl0RVh0Q29tbWVudABDcmVhdGVk
IHdpdGggR0lNUFeBDhcAAAHySURBVEjHrZZPSFVREMZ/iomaBm1SApFHIEoL+6e7ROHTFkEbaWNb
95YgSFiLyECIoJXtIkEXZqSrIoYwQiEScVOCguQylCzKpyFBm3PjvcO5f8L3wV3cufPNnHNmvjO3
jAwws06gxTN/lTSfxq0gGx4BFz3bAVCdRizPmOBswFZlZg1HTmBm9UBVzOczafwyL9groAGYAJ4D
bcDDwPFE+AKMADPAdWAAaATOSfpdlMDM+oDZAvJPoC7jEf4CagveRySN/0tgZtXAKtBMabAH5CRt
RzUYyhj80D1pOA48KCzyQArhE9AlqVJSJXAeeJvC6TezY1GCXmAtxnEd6JD0LjJIWnWchRjOFtAj
6bDcETaAS8DLgPNdSXnfKOkPMBzw/wC0S1oq0oEL8jpAWIw7A0nLAfOypO3/UfKJBBGG+AdBJZtZ
DhgMEK4mJL8WsN0ws8tFSnYimwRqAoQfQJukLW/1jcB7oClmF7ckPYkSbAK5hJXmXV9HNWoH7gCn
U9R9KrquR4GpBOca4L57smJM0n7UptNuu6XCOvDY76KbntMC8C1DsDzwxrPdlrTv62AFuOeu6lZJ
3W5MPksIPgdckHTF1XAMeCrpRXAexPT6yYSddEj6eKSJJmk3IcFGqWby51AbSvpeqr+KPjcKC7GT
hfgXbteIc85F7RUAAAAASUVORK5CYII=
}

View File

@@ -1,8 +1,9 @@
proc ImageViewer {f w node} {
global factor cfgVariables
set factor($node) 1.0
ttk::frame $w.f
pack $w.f -side left -fill both -expand true
canvas $w.f.c -xscrollcommand "$w.f.x set" -yscrollcommand "$w.y set"
canvas $w.f.c -xscrollcommand "$w.f.x set" -yscrollcommand "$w.y set" -bg $cfgVariables(backGround)
ttk::scrollbar $w.f.x -ori hori -command "$w.f.c xview"
ttk::scrollbar $w.y -ori vert -command "$w.f.c yview"
@@ -20,15 +21,15 @@ proc ImageViewer {f w node} {
}
proc openImg {fn w node} {
global im1
global im1 factor
set im1 [image create photo -file $fn]
#scale $w
scale $w $factor($node) $node
list [file size $fn] bytes, [image width $im1]x[image height $im1]
$w create image 1 1 -image $im1 -anchor nw -tag img
}
proc scale {w {n 1} node} {
global im1 im2 factor noteBook tab_label
global im1 im2 factor tab_label
set factor($node) [expr {$factor($node) * $n}]
$w delete img
catch {image delete $im2}
@@ -41,7 +42,8 @@ proc scale {w {n 1} node} {
$im2 copy $im1 -subsample $f $f
}
$w create image 1 1 -image $im2 -anchor nw -tag img
$noteBook itemconfigure $node -text "$tab_label (size x$factor($node))"
set noteBook [file extension $node]
# $noteBook itemconfigure $node -text "(size x$factor($node))"
$w config -scrollregion [$w bbox all]
}
@@ -52,6 +54,7 @@ proc ImageBase64Encode {text} {
{"GIF" {.gif}}
{"JPEG" {.jpg}}
{"BMP" {.bmp}}
{"SVG" {.svg}}
{"All files" *}
}
set img [tk_getOpenFile -initialdir $env(HOME) -filetypes $types -parent .]
@@ -65,5 +68,3 @@ proc ImageBase64Encode {text} {
$text insert [Position] "image create photo $name -data {\n$data\n}"
}
}

View File

@@ -28,12 +28,12 @@ proc GetFileMenu {m} {
menu $m.openRecent
$m add cascade -label [::msgcat::mc "Open recent"] -menu $m.openRecent
foreach item $cfgVariables(recentFolder) {
$m.openRecent add command -label $item -command [list FileOper::ReadFolder $item]
$m.openRecent add command -label $item -command [list OpenRecentProject $item]
}
$m add separator
$m add command -label [::msgcat::mc "Open folder"] -accelerator "Ctrl+K" -command {
$m add command -label [::msgcat::mc "Open folder"] -accelerator "Alt+K" -command {
set folderPath [FileOper::OpenFolderDialog]
if {$folderPath != ""} {
# set activeProject $folderPath
@@ -76,7 +76,8 @@ proc GetEditMenu {m} {
$m add separator
$m add command -label [::msgcat::mc "Insert image"] -accelerator "Ctrl+I"\
-command ImageBase64Encode
$m add separator
$m add command -label [::msgcat::mc "Settings"] -command Settings
}
proc GetViewMenu {m} {

View File

@@ -59,12 +59,16 @@
::msgcat::mcset en "Editor font bold"
::msgcat::mcset en "Error open URL"
::msgcat::mcset en "Editor settings"
::msgcat::mcset en "Enter command for execute file"
::msgcat::mcset en "Exit"
::msgcat::mcset en "File"
::msgcat::mcset en "File already exists. Overwrite?"
::msgcat::mcset en "File modify"
::msgcat::mcset en "File was modifyed. Close?"
::msgcat::mcset en "File was modifyed. Save?"
::msgcat::mcset en "The file looks like a binary file. Open anyway?"
::msgcat::mcset en "The file looks like a image. Support not implemented yet."
::msgcat::mcset en "The file size to big. Open anyway?"
::msgcat::mcset en "File saved"
::msgcat::mcset en "Files"
::msgcat::mcset en "Find"
@@ -182,6 +186,3 @@

View File

@@ -77,6 +77,7 @@
::msgcat::mcset ru "Editor settings" "Настройки редактора"
::msgcat::mcset ru "Editor helpers" "Подсказки при вводе"
::msgcat::mcset ru "Encode" "Перекодировка"
::msgcat::mcset ru "Enter command for execute file" "Введите команду для запуска текущего файла"
::msgcat::mcset ru "Authorisation required" "Требуется авторизация"
::msgcat::mcset ru "Error open URL" "Ошибка открытия URL"
::msgcat::mcset ru "Exit" "Выход"
@@ -88,6 +89,9 @@
::msgcat::mcset ru "File was modifyed" "Файл был изменен"
::msgcat::mcset ru "File modify" "Файл изменен"
::msgcat::mcset ru "File saved" "Файл сохранен"
::msgcat::mcset ru "The file looks like a binary file. Open anyway?" "Файл похож на двоичный. Открыть все равно?"
::msgcat::mcset ru "The file looks like a image. Support not implemented yet." "Файл выглядит как изображение. Поддержка пока не реализована."
::msgcat::mcset ru "The file size to big. Open anyway?" "Файл большого размера. Открыть все равно?"
::msgcat::mcset ru "Find" "Найти"
::msgcat::mcset ru "Found" "Найдено"
::msgcat::mcset ru "Find in files" "Найти в файлах"
@@ -196,7 +200,7 @@
::msgcat::mcset ru "Select directory" "Выбор директории"
::msgcat::mcset ru "Selected directory" "Директория"
::msgcat::mcset ru "Selection color" "Цвет выделения"
::msgcat::mcset ru "Settings" "Установки"
::msgcat::mcset ru "Settings" "Настройки"
::msgcat::mcset ru "Statusbar" "Строка статуса"
::msgcat::mcset ru "Show backup files" "Показывать временные файлы"
::msgcat::mcset ru "Show the Menu" "Показывать меню"

View File

@@ -13,7 +13,9 @@ namespace eval NB {
proc InsertItem {nb item type} {
switch $type {
file {
regsub -all {\.|/|\\|\s} $item "_" itemName
set item [string tolower $item]
regsub -all {\.|/|\\|\s|:} $item "_" itemName
# puts "$item -> $itemName"
if [winfo exists $nb.$itemName] {
set fm $nb.$itemName
} else {
@@ -49,11 +51,16 @@ namespace eval NB {
return
}
if {[$w identify $x $y] == "close_button"} {
FileOper::Close
# puts "NB::PressTab: w - $w"
FileOper::Close $w
} else {
set txt [$w select].frmText.t
if [winfo exists $txt] {
focus -force $txt.t
if {[winfo exists [$w select].frmText2] == 1} {
focus -force [$w select].frmText2.frame.text.t
} else {
if [winfo exists $txt] {
focus -force $txt.t
}
}
}
}
@@ -61,7 +68,12 @@ namespace eval NB {
proc NextTab {w step} {
global tree
set i [expr [$w index end] - 1]
# puts "NB::NextTab $w"
if {[$w select] eq ""} {
# puts "NB::NextTab no items availabels"
if {$w eq ".frmWork.nbEditor2"} {
.frmWork.panelNB forget .frmWork.nbEditor2
}
return
}
set nbItemIndex [$w index [$w select]]
@@ -73,13 +85,17 @@ namespace eval NB {
$w select [expr $nbItemIndex + $step]
}
set nbItem [string trimleft [$w select] "$w."]
# puts $nbItem
append treeItemName "file" "::" $nbItem
Tree::SelectItem $treeItemName
set txt [$w select].frmText.t
if [winfo exists $txt] {
focus -force $txt.t
DebugPuts "NextTab: [$w select]"
if {[winfo exists [$w select].frmText2] == 1} {
focus -force [$w select].frmText2.frame.text.t
} else {
if [winfo exists $txt] {
focus -force $txt.t
}
}
}
}

View File

@@ -195,9 +195,19 @@ proc ResetModifiedFlag {w nbEditor} {
# puts "ResetModifiedFlag: $lbl"
$nbEditor tab $w -text $lbl
}
proc SetModifiedFlag {w nbEditor} {
proc SetModifiedFlag {w nbEditor flag} {
global modified
#$w.frmText.t edit modified false
# ------------
# Thanks https://github.com/wandrien/
# https://github.com/wandrien/projman/commit/04e5c892ae06d3e013472d292cd4435804184f6b
if {$flag eq "force"} {
$w.frmText.t edit modified true
} else {
if {![$w.frmText.t edit modified]} {
return
}
}
# ---------
set modified($w) "true"
set lbl [$nbEditor tab $w -text]
# puts "SetModifiedFlag: $w; $modified($w); >$lbl<"
@@ -254,11 +264,13 @@ proc FindImage {ext} {
namespace eval Help {
proc About {} {
global projman
global projman tcl_version tk_version
set msg "Tcl/Tk project Manager\n\n"
append msg "Version: " $projman(Version) "\n" \
"Release: " $projman(Release) "\n" \
"Build: " $projman(Build) "\n\n" \
"Build: " $projman(Build) "\n" \
"Tcl Version: " $tcl_version "\n" \
"Tk Version: " $tk_version "\n\n" \
"Author: " $projman(Author) "\n" \
"Home page: " $projman(Homepage)
# foreach name [array names projman] {
@@ -277,17 +289,17 @@ namespace eval Help {
proc SearchVariable {txt} {
global fileStructure project variables
set varName [$txt get {insert wordstart} {insert wordend}]
puts ">>>$varName<<<"
# puts ">>>$varName<<<"
if {[info exists project] == 0} {return}
foreach f [array names project] {
puts "--$f"
puts "----"
# puts "--$f"
# puts "----"
foreach a $project($f) {
puts "-----$variables($a)"
# puts "-----$variables($a)"
foreach b $variables($a) {
puts "------$b -- [lindex $b 0]"
# puts "------$b -- [lindex $b 0]"
if {$varName eq [lindex $b 0]} {
puts "УРААААААА $varName = $b в файле $a \n\t [lindex $b 0]"
# puts "УРААААААА $varName = $b в файле $a \n\t [lindex $b 0]"
# FindVariablesDialog $txt "$varName: \[...\][file tail $a]"
lappend l [list $varName [lindex $b 1] $a]
}
@@ -355,7 +367,7 @@ proc FindVariablesDialog {txt args} {
foreach { word } $args {
foreach lst $word {
# set l [split $lst " "]
puts "[lindex $lst 0] -[lindex $lst 1] -[lindex $lst 2]"
# puts "[lindex $lst 0] -[lindex $lst 1] -[lindex $lst 2]"
# lappend l2 [lindex $l 0] [lindex $l 1] [file tail [lindex $l 2]]
# $win.lBox insert {} end -values $lst -text {1 2 3}
$win.lBox insert end "[lindex $lst 0] > [lindex $lst 1] > [lindex $lst 2]\n"
@@ -441,7 +453,7 @@ proc SearchStringInFolder {str} {
if {$tcl_platform(platform) == "windows"} {
} elseif {$tcl_platform(platform) == "mac"} {
} elseif {$tcl_platform(platform) == "unix"} {
puts "$cfgVariables(searchCommand) $cfgVariables(searchCommandOptions) $str $activeProject"
# puts "$cfgVariables(searchCommand) $cfgVariables(searchCommandOptions) $str $activeProject"
# Составляем строку (точнее список) для запуска команды
set cmd exec
regsub -all {\[} $str {\\[} str
@@ -688,7 +700,7 @@ proc SetActiveProject {path} {
proc OpenRecentProject {path} {
SetActiveProject $path
FileOper::ReadFolder $path
ReadFilesFromDirectory $path $path
ReadFilesFromDirectory $path $path
}
proc AddRecentEditedFolder {path} {
@@ -715,3 +727,450 @@ proc AddRecentEditedFolder {path} {
.frmMenu.mnuFile.m.openRecent add command -label $path -command [list OpenRecentProject $path]
}
# ================== OLD ====================
proc launchBrowser {url} {
global tcl_platform
if {$tcl_platform(platform) eq "windows"} {
set command [list {*}[auto_execok start] {}]
if {[file isdirectory $url]} {
set url [file nativename [file join $url .]]
}
} elseif {$tcl_platform(os) eq "Darwin"} {
set command [list open]
} else {
set command [list xdg-open]
}
exec {*}$command $url &
}
## EXEC EXTERNAL BROWSER AND GOTO URL ##
proc GoToURL {url} {
global env tcl_platform
if {$tcl_platform(platform) == "windows"} {
set pipe [open "|iexplore $url" "r"]
} elseif {$tcl_platform(platform) == "mac"} {
set pipe [open "|iexplore $url" "r"]
} elseif {$tcl_platform(platform) == "unix"} {
#$env(BROWSER)
#set pipe [open "|$env(BROWSER) $url" "r"]
launchBrowser $url
return
}
fileevent $pipe readable
fconfigure $pipe -buffering none -blocking no
}
## MAKING TAR ARCHIVE ##
proc MakeTGZ {} {
global activeProject tgzDir tgzNamed workDir projDir env tcl_platform
if {$activeProject == ""} {
set answer [tk_messageBox\
-message [::msgcat::mc "Not found active project"]\
-type ok -icon warning\
-title [::msgcat::mc "Warning"]]
case $answer {
ok {return 0}
}
}
FileDialog tree save_all
set file [open [file join $workDir $activeProject.proj] r]
while {[gets $file line]>=0} {
scan $line "%s" keyWord
set string [string range $line [string first "\"" $line] [string last "\"" $line]]
set string [string trim $string "\""]
if {$keyWord == "ProjectDirName"} {
set dir "$string"
}
if {$keyWord == "ProjectVersion"} {
set version "$string"
}
if {$keyWord == "ProjectRelease"} {
set release "$string"
}
}
close $file
set res [split $tgzNamed "-"]
set name [lindex $res 0]
set ver [lindex $res 1]
set rel [lindex $res 2]
if {$name == "projectName"} {
set name $activeProject
}
if {$ver == "version"} {
append name "-$version"
}
if {$rel == "release"} {
append name "-$release"
}
# multiplatform featuring #
if {$tcl_platform(platform) == "windows"} {
append name ".zip"
} elseif {$tcl_platform(platform) == "mac"} {
append name ".zip"
} elseif {$tcl_platform(platform) == "unix"} {
append name ".tar.gz"
}
catch {cd $projDir} res
if {[file exists [file join $tgzDir $name]] == 1} {
set answer [tk_messageBox\
-message "[::msgcat::mc "File already exists. Overwrite?"] \"$name\" ?"\
-type yesno -icon question -default yes\
-title [::msgcat::mc "Question"]]
case $answer {
yes {file delete [file join $tgzDir $name]}
no {return 0}
}
}
# multiplatform featuring #
if {$tcl_platform(platform) == "windows"} {
catch [exec pkzip -r -p [file join $tgzDir $name] [file join $activeProject *]] err
} elseif {$tcl_platform(platform) == "mac"} {
catch [exec zip -c [file join $tgzDir $name] $activeProject] err
} elseif {$tcl_platform(platform) == "unix"} {
catch [exec tar -czvf [file join $tgzDir $name] $activeProject] err
}
# message dialog #
set msg "[::msgcat::mc "Archive created in"] [file join $tgzDir $name]"
set icon info
set answer [tk_messageBox\
-message "$msg"\
-type ok -icon $icon]
case $answer {
ok {return 0}
}
}
# Процедура для проверки, находится ли редактирование в последней строке
proc IsLastLine {widget} {
set current_line [lindex [split [$widget index insert] .] 0]
set last_line [lindex [split [$widget index end-1c] .] 0]
return [expr {$current_line == $last_line}]
}
# Процедура для проверки выделения в последней строке
proc IsSelectionInLastLine {widget} {
if {![$widget tag ranges sel]} {
return 0
}
set last_line [lindex [split [$widget index end-1c] .] 0]
set sel_start_line [lindex [split [$widget index sel.first] .] 0]
set sel_end_line [lindex [split [$widget index sel.last] .] 0]
return [expr {$sel_start_line == $last_line && $sel_end_line == $last_line}]
}
# Процедура-обертка для проверки последней строки
proc CheckLastLineAndRun {txt w filePath} {
# Проверяем, находится ли курсор в последней строке
set current_line [lindex [split [$txt index insert] .] 0]
set last_line [lindex [split [$txt index end-1c] .] 0]
if {$current_line == $last_line} {
# Разрешаем выполнение в последней строке
$txt insert insert "\n"
Run $w $filePath
} else {
# Запрещаем в других строках
bell
$txt mark set insert end
}
}
## MAKE PROJ PROCEDURE (RUNNING PROJECT) ##
proc Execute {filePath w activeEditor} {
global activeProject cfgVariables
if {$activeProject == ""} {
set answer [tk_messageBox\
-message "[::msgcat::mc "Not found active project"]"\
-type ok -icon warning\
-title [::msgcat::mc "Warning"]]
case $answer {
ok {return 0}
}
}
FileOper::Save
set file $filePath
set action run
# create array with file names #
frame $w.frame -borderwidth 2 -relief ridge -background $cfgVariables(backGround)
pack $w.frame -side top -fill both -expand true
set txt $w.frame.text
ctext $txt -yscrollcommand "$w.frame.yscroll set" -linemap 0 \
-bg $cfgVariables(backGround) -fg $cfgVariables(foreground) \
-relief sunken -wrap word -highlightthickness 0 -font $cfgVariables(font) \
-selectborderwidth 0 -selectbackground $cfgVariables(selectbg) -width 10 -height 10
scrollbar $w.frame.yscroll -relief sunken -borderwidth {1} -width {10} -takefocus 0 \
-command "$txt yview" -background $cfgVariables(backGround)
Highlight::ExecuteColorized $txt
pack $txt -side left -fill both -expand true
pack $w.frame.yscroll -side left -fill y
bind $txt <Return> [list Run $w $filePath]
bind $txt <Control-r> [list CloseExecuteDialog $w $activeEditor]
bind $txt <Control-Cyrillic_er> [list CloseExecuteDialog $w $activeEditor]
# focus -force $w.frmBtn.btnOk
# $noteBook raise $node
# insert debug data into text widget #
$txt tag configure bold -font $cfgVariables(fontBold)
$txt tag configure error -font $cfgVariables(fontBold) -foreground red
$txt tag add bold 0.0 0.end
$txt insert end "[::msgcat::mc "Enter command for execute file"] $filePath >\n"
set pos [$w.frame.text index insert]
set lineNum [lindex [split $pos "."] 0]
$w.frame.text insert 0.0 "======================================================================================\n"
# Added executor from config
set fileType [string toupper [string trimleft [file extension $filePath] "."]]
if {[info exists cfgVariables($fileType)] != 0 && $cfgVariables($fileType) ne ""} {
$w.frame.text insert end "$cfgVariables($fileType) %f"
}
unset fileType
# $w.frame.text insert end [string toupper [string trimleft [file extension $filePath] "."]]
# $w.frame.text insert end cfgVariables($fileType)
$w.frame.text tag add bold $lineNum.0 $lineNum.end
Highlight::ExecuteColorized $w.frame.text
# focus -force $w.frame.text
# Привязки событий для защиты от редактирования
# bind $txt <KeyPress> {
# if {![IsLastLine %W]} {
# break
# }
# }
# bind $txt <KeyPress-Return> {
# # Разрешаем Enter только в последней строке
# if {![IsLastLine %W]} {
# break
# } else {
# list Run $w $filePath
# }
# }
# bind $txt <KeyPress-Return> [list CheckLastLineAndRun $txt $w $filePath]
#
# bind $txt <BackSpace> {
# if {[%W tag ranges sel] ne ""} {
# if {![IsSelectionInLastLine %W]} {
# break
# }
# } else {
# if {![IsLastLine %W]} {
# break
# }
# }
# }
# bind $txt <Delete> {
# if {[%W tag ranges sel] ne ""} {
# if {![IsSelectionInLastLine %W]} {
# break
# }
# } else {
# if {![IsLastLine %W]} {
# break
# }
# }
# }
# # Защита от вставки
# bind $txt <<Paste>> {
# if {[%W tag ranges sel] ne ""} {
# if {![IsSelectionInLastLine %W]} {
# break
# }
# } else {
# if {![IsLastLine %W]} {
# break
# }
# }
# }
# # Защита от вырезания
# bind $txt <<Cut>> {
# if {[%W tag ranges sel] ne ""} {
# if {![IsSelectionInLastLine %W]} {
# break
# }
# } else {
# break
# }
# }
focus -force $w.frame.text.t
}
proc CloseExecuteDialog {w activeEditor} {
destroy $w
focus $activeEditor.frmText.t.t
}
proc Run {w filePath} {
# Получаем индекс конца последней строки
set endIndex [$w.frame.text index "end-1c"]; # или "end-1l lineend"
# Получаем индекс начала последней строки
set startIndex [$w.frame.text index "end-1l linestart"]
set command [$w.frame.text get $startIndex $endIndex end]
# Заменяем знак %f на имя текущего файла
regsub -all "%f" $command "$filePath" fullCommand
$w.frame.text replace $startIndex $endIndex $fullCommand
# $w.frame.text insert "end-4l linestart"
cd [file dirname $filePath]
set pipe [open "|$fullCommand 2> [file join [file dirname $filePath] errors]" "r"]
set f [open [file join [file dirname $filePath] errors] "r"]
set processPID [pid $pipe]
bind $w.frame.text <Control-c> [list SendSignal $processPID "SIGINT"]
bind $w.frame.text <Control-z> [list SendSignal $processPID "SIGTSTP"]
bind $w.frame.text <Control-d> [list SendSignal $processPID "SIGKILL"]
# set pipe [open "|$command $filePath" "r"]
# set f [open [file join ~ tmp errors] "r"]
fileevent $pipe readable [list DebugInfo $w.frame.text $pipe $f]
fconfigure $pipe -buffering none -blocking no
}
## INSERT DEBUG INFORMATION INTO TEXT WIDGET ##
proc DebugInfo {widget file f} {
$widget configure -state normal
if {[eof $file]} {
catch [close $file] msg
if {$msg != ""} {
puts $msg
$widget insert "end-4l linestart" "[::msgcat::mc "Program failed"]: $msg\n";
} else {
# Highlight::ExecuteColorized $widget
puts $msg
$widget see "end-1l lineend"
$widget delete "end-1l lineend" end
# $widget insert end "\n-------------------------------------------------\n"
# $widget insert end "[::msgcat::mc "Program finished successfully"]\n"
}
Highlight::ExecuteColorized $widget
# close $f
} else {
# Highlight::ExecuteColorized $widget
$widget insert "end-4l linestart" "[read $file]"
}
while {[gets $f line]>=0} {
Highlight::ExecuteColorized $widget
$widget insert "end-4l linestart" "$line\n"
# puts $line
}
# close $f
$widget see end
$widget tag add error 0.0 0.end
# $widget configure -state disabled
}
# Функция для отправки сигнала процессу
proc SendSignal {pid signal} {
global tcl_platform
if {$tcl_platform(platform) eq "unix"} {
# На Unix-системах
switch -- $signal {
"SIGINT" {catch {exec kill -INT $pid}} ; # Ctrl+C
"SIGTERM" {catch {exec kill -TERM $pid}} ; # Завершение
"SIGTSTP" {catch {exec kill -TSTP $pid}} ; # Ctrl+Z (приостановка)
"SIGKILL" {catch {exec kill -KILL $pid}} ; # Принудительное завершение
}
} else {
# На Windows
switch -- $signal {
"SIGINT" - "SIGTERM" {
# Используем taskkill для завершения
catch {exec taskkill /PID $pid /T}
}
"SIGKILL" {
# Принудительное завершение на Windows
catch {exec taskkill /PID $pid /T /F}
}
}
}
}
# Правка файла настроек
proc Settings {} {
global dir
FileOper::Edit [file join $dir(cfg) projman.ini]
# Config::read $dir(cfg)
}
# Определяем пути до программ для запуска исходников
proc ExecutorCommandPathSetting {fileType} {
global cfgVariables tcl_platform
# puts $cfgVariables($fileType)
if {[info exists cfgVariables($fileType)] == 1 && $cfgVariables($fileType) ne ""} {
if {$tcl_platform(platform) eq "windows"} {
set cmd "where $cfgVariables($fileType)"
} else {
set cmd "which $cfgVariables($fileType)"
}
DebugPuts "ExecutorCommandPathSetting $fileType"
DebugPuts [catch {exec {*}$cmd} executor_path]
DebugPuts "executor_path $executor_path"
if {[catch {exec {*}$cmd} executor_path]} {
DebugPuts "Программа $cfgVariables($fileType) для выполнения файлов $fileType не найдена в системе"
set cfgVariables($fileType) ""
return
}
set full_path [string trim $executor_path]
set first_path [lindex [split $executor_path "\n"] 0]
# puts "Git найден: $first_path"
set cfgVariables($fileType) $first_path
DebugPuts "first_path $first_path"
}
if {[info exists cfgVariables($fileType)] == 0} {
set cfgVariables($fileType) ""
DebugPuts $cfgVariables($fileType)
}
}
# -----------
# Thanks https://github.com/wandrien/
# https://github.com/wandrien/projman/commit/22f6e235c3532c20573d44ee7eaaaa1fb56ad544
proc SendEventToLatestTxtWidget {ev} {
global latestTxtWidget
if {$latestTxtWidget eq ""} {
return
} elseif {[winfo exists $latestTxtWidget] && [winfo class $latestTxtWidget] eq "Ctext"} {
event generate ${latestTxtWidget}.t $ev
} else {
set latestTxtWidget ""
}
}
proc Cut {} { SendEventToLatestTxtWidget <<Cut>> }
proc Copy {} { SendEventToLatestTxtWidget <<Copy>> }
proc Paste {} { SendEventToLatestTxtWidget <<Paste>> }
proc Undo {} { SendEventToLatestTxtWidget <<Undo>> }
proc Redo {} { SendEventToLatestTxtWidget <<Redo>> }
# ------------
proc DebugPuts {msg} {
global cfgVariables
if ![info exists cfgVariables(debug)] {
return 0
}
if ![info exists cfgVariables(debugOut)] {
return 0
}
if {$cfgVariables(debug) eq "true"} {
if {$cfgVariables(debugOut) eq "stdout"} {
puts "$msg"
} elseif {$cfgVariables(debugOut) ne "" } {
set logFile [open $cfgVariables(debugOut) "a+"]
puts $logFile $::configDefault
close $logFile
}
}
}

View File

@@ -9,7 +9,7 @@
#
######################################################
package require fileutil
package require Thread
# package require Thread
# TCL procedure
@@ -20,7 +20,7 @@ proc GetVariablesFromFile {fileName} {
set varList ""
set params ""
set varsBegin false
puts $fileName
# puts $fileName
set f [open "$fileName" r]
if {[dict exists $lexers $fileType] == 0} {return}
while {[gets $f line] >=0 } {
@@ -32,7 +32,7 @@ proc GetVariablesFromFile {fileName} {
set indentSize 0
}
set varsBegin true
puts "====== $varsBegin $indentSize"
# puts "$varsBegin $indentSize"
continue
# lappend varList [list $varName $varValue]
}
@@ -41,13 +41,13 @@ proc GetVariablesFromFile {fileName} {
set l [GetVarFromLine $line $fileType]
if {$line eq ""} {
set varsBegin false
puts "====== $varsBegin $indentSize [lindex $l 3]"
# puts "$varsBegin $indentSize [lindex $l 3]"
continue
}
if {[lindex $l 3] ne ""} {
if [expr [lindex $l 3] <= $indentSize] {
set varsBegin false
puts "====== $varsBegin $indentSize >[lindex $l 3]<"
# puts "$varsBegin $indentSize >[lindex $l 3]<"
continue
}
}
@@ -79,7 +79,7 @@ proc GetVarFromLine {line fileType} {
set varType ""
}
set indentLength [string length $indent]
puts "variable: $varName, value: $varValue, type: $varType, indent: >$indent< $indentLength"
# puts "variable: $varName, value: $varValue, type: $varType, indent: >$indent< $indentLength"
return [list $varName $varValue $varType $indentLength]
}
}
@@ -90,7 +90,7 @@ proc GetVariablesFromVarFile {fileName} {
set procList ""
set varList ""
set params ""
puts $fileName
# puts $fileName
set f [open "$fileName" r]
if {[dict exists $lexers $fileType] == 0} {return}
while {[gets $f line] >=0 } {
@@ -122,7 +122,7 @@ proc ReadFilesFromDirectory {directory root {type ""}} {
return ""
}
foreach fileName [glob -nocomplain *] {
puts "Find file: $fileName [lsearch -exact -nocase $l $fileName]"
# puts "Find file: $fileName [lsearch -exact -nocase $l $fileName]"
if {[lsearch -exact $l $fileName] != -1 && [file isdirectory [file join $root $directory $fileName]] == 1} {
# puts "--- $root $fileName"
ReadFilesFromDirectory [file join $directory $fileName] $root "var"
@@ -179,8 +179,8 @@ proc ReadFilesFromDirectory {directory root {type ""}} {
#
proc Accept { dirLib directory } {
global dir
puts $dir(lib)
puts $dirLib
# puts $dir(lib)
# puts $dirLib
# переменная с указанием ваших действия перед порождением потока
set threadinit {
# если необходимо, загружаем исходный tcl код, расположенный в других файлах

View File

@@ -18,7 +18,8 @@ namespace eval Tree {
# puts "$tree $parent $item $type $text"
switch $type {
file {
regsub -all {\.|/|\\|\s} $item "_" subNode
regsub -all {\.|/|\\|\s|:} $item "_" subNode
set subNode [string tolower $subNode]
# puts "Inserted tree node: $subNode"
set fileExt [string trimleft [file extension $text] "."]
#set fileName [string trimleft [file extension $text] "."]
@@ -41,7 +42,8 @@ namespace eval Tree {
}
}
directory {
regsub -all {\.|/|\\|\s} $item "_" subNode
regsub -all {\.|/|\\|\s|:} $item "_" subNode
set subNode [string tolower $subNode]
# puts $subNode
if {[string match {*debian*} [string tolower [file tail $item]]]} {
set image [::FindImage debian]
@@ -104,7 +106,7 @@ namespace eval Tree {
set key [lindex [split $id "::"] 0]
if {$values eq "" || $key eq ""} {return}
# puts "$key $tree $values"
DebugPuts "$key $tree $values"
switch -regexp $key {
directory {
FileOper::ReadFolder $values
@@ -112,6 +114,7 @@ namespace eval Tree {
}
file {
set v [FileOper::Edit $values $nbEditor]
DebugPuts $v
if {$v eq false} {
$tree delete $id
}

85
openbsd/build-package-bsd.sh Executable file
View File

@@ -0,0 +1,85 @@
#!/bin/bash
# create-openbsd-pkg.sh
PKG_NAME="projman"
WORK_DIR=projman_openbsd
VERSION=$(grep Version ../projman.tcl | grep -oE '\b[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}\b')
RELEASE=$(grep "# Release" ../projman.tcl | grep -oE '[0-9A-Za-z]+$')
BUILD_DATE=$(date +%d%m%Y%H%M%S)
TXT="# Build: ${BUILD_DATE}"
echo "$VERSION, $RELEASE, $BUILD_DATE"
PKG_VERSION="${VERSION}${RELEASE}"
PKG_FULLNAME="${PKG_NAME}-${PKG_VERSION}"
mkdir -p ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin
mkdir -p ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman
mkdir -p ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/man/man1
cp -r ../lib ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
cp -r ../theme ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
cp ../projman.tcl ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman
cp ../changelog-gen.tcl ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/changeloggen
cp ../tkregexp.tcl ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/tkregexp
cp ../LICENSE ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
cp ../README.md ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
cp ../CHANGELOG ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
cp ../projman.desktop ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
cp ../projman.png ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
sed -i "/# Build:.*/c$TXT" ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman
# ./changelog-gen.tcl --project-name projman --project-version ${VERSION} --project-release ${RELEASE} --out-file debian/changelog --deb --last
sed -i "s+^set\ dir(lib)+set\ dir(lib)\ /usr/local/share/projman/lib ;#+g" ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman
sed -i "s+\[pwd\]+/usr/local/share/projman+g" ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman
# cat > ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman << 'EOF'
# #!/bin/sh
# exec /usr/local/bin/wish8.6 "/usr/local/share/projman/projman.tcl" "$@"
# EOF
# chmod +x ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman
cat > ${WORK_DIR}/${PKG_FULLNAME}/+CONTENTS << EOF
@name ${PKG_NAME}-${PKG_VERSION}
@version ${PKG_VERSION}
@depend lang/tk:tk-*:tcl-*
@depend devel/tcllib:tcllib-*:tcl-*
@depend devel/tklib:tklib-*:tcl-*
@comment Editor for Tcl/Tk and other languages.
@arch amd64
@wantlib pthread
@ignore
@cwd /usr/local
EOF
(cd ${WORK_DIR}/${PKG_FULLNAME}/usr/local && find . -type f | sed 's/^\.\///') | while read file; do
echo "$file" >> ${WORK_DIR}/${PKG_FULLNAME}/+CONTENTS
done
cat >> ${WORK_DIR}/${PKG_FULLNAME}/+CONTENTS << 'EOF'
@exec mkdir -p /var/log/projman 2>/dev/null || true
@exec echo "Package ${PKG_NAME} installed successfully"
@unexec rm -rf /var/log/projman 2>/dev/null || true
EOF
echo "ProjMan is a code editor writen in TCL/Tk" > ${WORK_DIR}/${PKG_FULLNAME}/+COMMENT
cat > ${WORK_DIR}/${PKG_FULLNAME}/+DESC << 'EOF'
ProjMan (also known as "Tcl/Tk Project Manager") is a feature-rich editor
for programming in Tcl/Tk and other languages.
It includes a source editor with syntax highlighting and
code navigation, a context-sensitive help system, Git support, a
pseudo-terminal, image viewer and much more.
Supported languages for highlighting and navigation:
Tcl/Tk, GO, Perl, Python, Ruby, Shell (BASH), Markdown, YAML (Ansible), Lua.
EOF
(cd ${WORK_DIR} && tar -czf ../../../${PKG_FULLNAME}.tgz ${PKG_FULLNAME}/)
echo "Package created: ${PKG_FULLNAME}.tgz"
rm -rf ${WORK_DIR}

View File

@@ -1,6 +1,6 @@
#!/bin/sh
# Tcl ignores the next line -*- tcl -*- \
exec wish "$0" -- "$@"
exec wish8.6 "$0" -- "$@"
######################################################
# Tcl/Tk Project manager 2.0
@@ -9,8 +9,8 @@ exec wish "$0" -- "$@"
# Home page: https://nuk-svk.ru
######################################################
# Version: 2.0.0
# Release: alpha17
# Build: 21102025154120
# Release: beta1
# Build: 22012026174911
######################################################
# определим текущую версию, релиз и т.д.
@@ -34,15 +34,32 @@ while {[gets $f line] >=0} {
}
close $f
package require msgcat
package require inifile
package require ctext
package require base64
package require fileutil
package require Thread
# package require Thread
package require fileutil::magic::filetype
# Определим установлен ли пакет Img для расширенной поддержки изображений
proc PackagePresent {pkg} {
# puts $pkg
foreach item [package names] {
# puts [string match -nocase Img $item]
if {[string match -nocase Img $item] == 1} {
# puts "The $pkg package was found"
return true
}
}
}
if {[PackagePresent "Img"] eq "true"} {
package require Img
} else {
puts "Img not present"
}
# Устанавливаем текущий каталог
set dir(root) [pwd]
set dir(doc) [file join $dir(root) doc]
@@ -52,7 +69,7 @@ if { $::argc > 0 } {
foreach arg $::argv {
lappend opened $arg
}
puts $opened
# puts $opened
}
@@ -80,7 +97,7 @@ source [file join $dir(lib) config.tcl]
foreach modFile [lsort [glob -nocomplain [file join $dir(lib) *.tcl]]] {
if {[file tail $modFile] ne "gui.tcl" && [file tail $modFile] ne "config.tcl"} {
source $modFile
puts "Loading module $modFile"
# puts "Loading module $modFile"
}
}
@@ -89,10 +106,10 @@ set dir(theme) "[file join $dir(root) theme]"
foreach modFile [lsort [glob -nocomplain [file join $dir(theme) *]]] {
if [file isdirectory $modFile] {
source $modFile/[file tail $modFile].tcl
puts "Loading theme $modFile.tcl"
# puts "Loading theme $modFile.tcl"
} elseif {[file extension $modFile] eq ".tcl"} {
source $modFile
puts "Loading theme $modFile"
# puts "Loading theme $modFile"
}
}
@@ -102,16 +119,19 @@ if {[file exists [file join $dir(cfg) projman.ini]] ==0} {
Config::create $dir(cfg)
}
Config::read $dir(cfg)
Config::CheckVariables
::msgcat::mclocale $cfgVariables(locale)
if [::msgcat::mcload [file join $dir(lib) msgs]] {
puts "Load locale messages... OK"
}
puts "Setting the locale... [::msgcat::mclocale]"
DebugPuts "Setting the locale... [::msgcat::mclocale]"
source [file join $dir(lib) gui.tcl]
Git::CommandPathSetting
# Open the PATH if command line argument has been setting
if [info exists opened] {
foreach path $opened {

View File

@@ -6,8 +6,8 @@
#
# $Id: black.tcl,v 1.2 2009/10/25 19:21:30 oberdorfer Exp $
package require Tk 8.4; # minimum version for Tile
package require tile 0.8; # depends upon tile
package require Tk; # minimum version for Tile
package require tile; # depends upon tile
namespace eval ttk {
@@ -39,6 +39,7 @@ namespace eval ttk::theme::black {
-lightest "#ffffff"
-selectbg "#4a6984"
-selectfg "#ffffff"
-font "#c8c8c8"
}
if {[info commands ::ttk::style] ne ""} {
set styleCmd ttk::style
@@ -46,78 +47,84 @@ namespace eval ttk::theme::black {
set styleCmd style
}
$styleCmd theme create black -parent clam -settings {
$styleCmd theme create black -parent clam -settings {
# -----------------------------------------------------------------
# Theme defaults
#
$styleCmd configure "." \
-background $colors(-frame) \
-foreground white \
-bordercolor $colors(-darkest) \
-darkcolor $colors(-dark) \
-lightcolor $colors(-lighter) \
-troughcolor $colors(-darker) \
-selectbackground $colors(-selectbg) \
-selectforeground $colors(-selectfg) \
-selectborderwidth 0 \
-font "{Droid Sans Mono} 9" \
;
# -----------------------------------------------------------------
# Theme defaults
#
$styleCmd configure "." \
-background $colors(-frame) \
-foreground white \
-bordercolor $colors(-darkest) \
-darkcolor $colors(-dark) \
-lightcolor $colors(-lighter) \
-troughcolor $colors(-darker) \
-selectbackground $colors(-selectbg) \
-selectforeground $colors(-selectfg) \
-selectborderwidth 0 \
-font "{Droid Sans Mono} 9" \
;
$styleCmd map "." \
-background [list disabled $colors(-frame) \
active $colors(-lighter)] \
-foreground [list disabled $colors(-disabledfg)] \
-selectbackground [list !focus $colors(-darkest)] \
-selectforeground [list !focus white] \
;
# ttk widgets.
$styleCmd configure TButton \
-width -8 -padding {5 1} -relief link
$styleCmd configure TMenubutton \
-relief flat -arrowsize 0
$styleCmd configure TCheckbutton \
-indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1}
$styleCmd configure TRadiobutton \
-indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1}
$styleCmd configure TEntry \
-fieldbackground gray20 -foreground $colors(-font) \
-padding {2 0} -border -1
$styleCmd configure TCombobox \
-fieldbackground white -foreground $colors(-font)\
-padding {2 0}
$styleCmd configure TSpinbox \
-fieldbackground white -foreground $colors(-font) \
-padding {2 0}
$styleCmd configure TNotebook \
-border -1
$styleCmd configure TNotebook.Tab \
-padding {6 2 6 2} \
-border -1
$styleCmd map TNotebook.Tab -background [list \
selected $colors(-lighter)]
# tk widgets.
$styleCmd map Menu \
-background [list active $colors(-dark)] \
-foreground [list disabled $colors(-lightest)] \
$styleCmd configure TreeCtrl \
-background gray30 -itembackground {gray60 gray50} \
-itemfill white -itemaccentfill yellow -border -1
$styleCmd map Treeview\
-background [list selected $colors(-lighter)] \
-foreground [list selected $colors(-selectfg)]
# -background [list selected $colors(-selectbg)] \
$styleCmd configure Treeview -fieldbackground gray25
$styleCmd map "." \
-background [list disabled $colors(-frame) \
active $colors(-lighter)] \
-foreground [list disabled $colors(-disabledfg)] \
-selectbackground [list !focus $colors(-darkest)] \
-selectforeground [list !focus white] \
;
# ttk widgets.
$styleCmd configure TButton \
-width -8 -padding {5 1} -relief link
$styleCmd configure TMenubutton\
-relief flat -arrowsize 0
$styleCmd configure TCheckbutton \
-indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1}
$styleCmd configure TRadiobutton \
-indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1}
$styleCmd configure TEntry \
-fieldbackground gray20 -foreground black \
-padding {2 0} -border -1
$styleCmd configure TCombobox \
-fieldbackground white -foreground black \
-padding {2 0}
$styleCmd configure TSpinbox \
-fieldbackground white -foreground black \
-padding {2 0}
$styleCmd configure TNotebook \
-border -1
$styleCmd configure TNotebook.Tab \
-padding {6 2 6 2} \
-border -1
$styleCmd map TNotebook.Tab -background [list \
selected $colors(-lighter)]
# tk widgets.
$styleCmd map Menu \
-background [list active $colors(-lighter)] \
-foreground [list disabled $colors(-disabledfg)]
$styleCmd configure TreeCtrl \
-background gray30 -itembackground {gray60 gray50} \
-itemfill white -itemaccentfill yellow -border -1
$styleCmd map Treeview\
-background [list selected $colors(-lighter)] \
-foreground [list selected $colors(-selectfg)]
# -background [list selected $colors(-selectbg)] \
$styleCmd configure Treeview -fieldbackground gray25
}
puts [ttk::style element names]
$styleCmd map Canvas \
-background [list selected $colors(-lighter)] \
-foreground [list selected $colors(-selectfg)] \
-highlightbackground [list selected $colors(-lighter)]
}
# puts [ttk::style element names]
}
# A few tricks for Tablelist.

View File

@@ -1,7 +1,7 @@
#!/bin/sh
#-*-tcl-*-
# the next line restarts using wish \
exec wish "$0" -- ${1+"$@"}
exec wish8.6 "$0" -- ${1+"$@"}
set version 3.0
@@ -1365,6 +1365,3 @@ proc make-regexp::make-regexp {words} {
set regexp
}
#==============================================================================================