Page 27 of 96

Posted: Mon Apr 09, 2012 7:17 am
by Andrey_A_A
KDJ
скрипт PlugTextToAkelPad.js в ToolBar почему-то не срабатывает

скрипт PlugToolBarAkelFont.js так же в ToolBar не срабаывает
раньше работал, может в сязи с новой версией AkelPad

===================
Добавлено:
KDJ, если тебе не трудно сделай пожалуйста скрипт соединяющий всю информацию ContextMenu и всех ToolBars в один файл ...\Plugs\AkelMenu\AkelAllMenu.Akelmenu с разделителем:

\n[Имя плагина + Дополнительно]\n

Дополнительно - ContextMenu - Link Menu , ContextMenu - Show ...

Ещё хорошо бы параметр в этот скрипт, который бы проверял в AkelAllMenu.Akelmenu все имена скриптов. Если какого-то имени физически не существует, то создавался бы список и выводился в новой вкладке, если все есть выдавалось бы сообщение: "Не существующих скриптов не найдено"
...
У тебя в этом опыта побольше. Заранее спасибо

Posted: Mon Apr 09, 2012 11:54 am
by KDJ
Andrey_A_A
For me everything is working properly.
At first, you must display dialog box ToolBar plugin.
PlugTextToAkelPad.js wrote:// Usage:
// First, display dialog box of ContextMenu/ToolBar plugin and then
// Call("Scripts::Main", 1, "PlugTextToAkelPad.js")
PlugToolBarAkelFont.js wrote:// You must first open ToolBar plugin dialog box, and then run the script.
// Because there is no way to call ToolBar dialog box from the script.

Posted: Mon Apr 09, 2012 12:12 pm
by Andrey_A_A
PlugTextToAkelPad.js, PlugToolBarAkelFont.js
KDJ в ContextMenu работает
в ToolBar нету меня у ToolBar имена ToolBar_01.dll; ToolBar_02.dll; ToolBar_03.dll; ToolBar_04.dll; ToolBar_05.dll; ToolBar_06.dll; ToolBar_07.dll; ToolBar_08.dll; ToolBar_09.dll;

может из-за имён

Posted: Mon Apr 09, 2012 12:38 pm
by KDJ
Andrey_A_A
Yes, these scripts work only for ToolBar.dll.
It seems to me, that what you need is in the script: PluginText.js

Posted: Mon Apr 09, 2012 3:41 pm
by Andrey_A_A
KDJ, спасибо я видел ваш плагин - очень хорошая работа, вот несколько моментов:
1. Можно ли сделать окно не статичным, а изменяющимся как по горизонтали, так и по вертикали, при русификации часть фраз не помещаются...
2. Зачем вы во все скрипты добавляете к горячим кнопкам скобки: (F1), (F2)... когда привычнее просто F1, F2 ...
----
если возможно, то хорошо бы подправить PlugToolBarAkelFont.js под разные ToolBar, если нет, то отпишитесь...

Posted: Mon Apr 09, 2012 4:52 pm
by KDJ
Andrey_A_A wrote:1. Можно ли сделать окно не статичным, а изменяющимся как по горизонтали, так и по вертикали, при русификации часть фраз не помещаются...
I'll try to do it, as I'll have some free time.
2. Зачем вы во все скрипты добавляете к горячим кнопкам скобки: (F1), (F2)... когда привычнее просто F1, F2 ...
It seems to me, that this is more readable.
если возможно, то хорошо бы подправить PlugToolBarAkelFont.js под разные ToolBar
OK, I'll do this in the near future.

Posted: Mon Apr 09, 2012 7:51 pm
by KDJ
I need to use this function:
oSys.Call("Gdi32::GetTextExtentPoint32W", hDC, sText, sText.length, lpSize);
lpSize
is a pointer to a SIZE structure that receives the dimensions of the string (sText), in logical units.
I'll ask for explanation:
what are logical units and how to convert them to screen pixels?

Posted: Mon Apr 09, 2012 9:19 pm
by KDJ
Andrey_A_A
Done: PlugToolBarAkelFont.js

Posted: Mon Apr 09, 2012 10:03 pm
by FeyFre
what are logical units
Logical units -
is a kind of device independent measurement system used by Ms(and any other smart software/OS/Hardware vendors). It allow to unify algorithms and formulas in calculations and make result and makes results equally observable on different devices with different scales, aspect rations and resolutions etc.
You have hDC - paintable device context. It has selected font (HFONT object). This font has its size, for instance 12pt = 1/6inch. In GDI, it is possible to work with GDI-device in different logical units modes(called Map mode).
Let say this device is in Map mode called MM_TEXT, where one logical unit is equal one physical unit - pixel. Your device has physical resolution 300dpi. So size of font in logical units is 300dpi * 1/6inch = 50 physical dots(pixels).
Let say this device is in Map mode called MM_LOENGLISH, where one logical unit equal 0.01inch. So out font size in logical units is 1/6inch / 0.01inch ~16 logical units.
I thing you understand this.
Now most valuable: you have task to draw 10cm line on device(monitor/printer/etc). What you will do? Next:
1) You will get its context handle: HDC
2) You will set its map mode to MM_LOMETRIC: SetMapMode(hDC,MM_LOMETRIC) (MM_LOMETRIC - 1 logical unit equal 0.1 physical millimetre of device)
3) You will draw line of length 100 mm / 0.1 /mm per logical units = 1000 logical units.
As you see, you must not know nor resolution of device, nor its physical sizes, nor pixel size. Your code is device independent, event if device is 70 inched monitor hang on the wall, it will draw real 10cm line.
About map modes you cant see here.
How to easily convert logical unit to device depended units(pixels) you can see here.


Posted: Mon Apr 09, 2012 11:24 pm
by Andrey_A_A
KDJ, спасибо!
===========
Добавлено:


Можно ли сделать поддержку относительных путей для программы Просмотр (F3) , Сравнить (F12)
%WINDIR%\ ... %a\

кроме того убрать или изменить проверку внешней программы просмотра, потому что большинство программ просмотра имеют ещё и параметры, которые невозможно внести...

К примеру:
отлично работает
sViewer="D:\\TC Image\\TOTALCMD.EXE /S=L";
если закомментировать строки
// if ((! IsFileExists(sViewer)) && (! SetExternalApp(0)))
// return;

поэтому надо пересмотреть внесение внешней программы

а хотелось бы для портабельности, чтобы можно было вносить такие строки:
sViewer="%COMMANDER_PATH%\\TOTALCMD.EXE /S=L";
или
sViewer="a%\\TOTALCMD.EXE /S=L";
-----------------------------------------------------
Так же для сравнения, хотелось бы поддержку передачи параметров программе сравнения, а именно
%p - активная панель
%t - не активная,
%n имя файла с расширением в активной панели
%m имя файла с расширением в не активной панели
%o - имя без расширения
%е - расширение
и тогда можно сделать полноценное сравнение файлов:

%COMMANDER_PATH%\Utilities\Comparison\BCompare\BCompare.exe %p%n %t%m

это был только пример, решать вам

Posted: Tue Apr 10, 2012 5:40 pm
by KDJ
FeyFre
Thank you very much for the clarification of logical units.
I understand, that if you set the map mode to MM_TEXT, then function GetTextExtentPoint32W returns value in screen pixels.
But even before that, you should probably select font in hDC eg. SelectObject(hDC, hGuiFont).

Posted: Tue Apr 10, 2012 9:20 pm
by FeyFre
I understand, that if you set the map mode to MM_TEXT, then function GetTextExtentPoint32W returns value in screen pixels.
Yes. It is most widely used mapping mode in simple window applications. (Complex window application where picture sizes and scales are important such as document viewers/editor are use appropriate modes).
But even before that, you should probably select font in hDC eg. SelectObject(hDC, hGuiFont).
If I remember correctly, it is not necessary to select font before/after changing map mode. It should work identically. Fonts are always measured in its own typographical unit - pt which is defined to have its constant physical dimension(1pt ~1/72inch), so it is always possible to remap font units to different logical units types on fly. But you should recheck, I have worked with it long time ago so could forget something.

Posted: Wed Apr 11, 2012 2:37 am
by maddogmax
Ребят, такой вопрос. Есть ли плагин (скрипт) под akelpad для валидации php?

Posted: Wed Apr 11, 2012 7:17 am
by FeyFre
maddogmax, нету :)

Posted: Wed Apr 11, 2012 10:41 am
by Fr0sT
Exec-ать php.exe с выводом в Log, либо написать простенький скрипт, который будет делать это в фоне, но еще добавить парсинг выводимого результата