Page 28 of 96

Posted: Wed Apr 11, 2012 11:50 am
by Instructor
maddogmax wrote:Ребят, такой вопрос. Есть ли плагин (скрипт) под akelpad для валидации php?
Есть такой вариант:
1. Скачиваем PHPLint.
2. Распаковываем в папку "[AkelPad]\AkelFiles\Tools".
3. Переименовываем папку "[AkelPad]\AkelFiles\Tools\phplint-windows-1.1_20120402" в "[AkelPad]\AkelFiles\Tools\phplint".
4. Создаем вызов в ToolBar или ContextMenu или HotKeys плагине:

Code: Select all

-"PHP validator" Call("Log::Output", 1, `"%a\AkelFiles\Tools\phplint\src\phplint.exe" --modules-path ./modules "%f"`, "%a\AkelFiles\Tools\phplint", "(.*):(\d+):", "/FILE=$1 /GOTOLINE=$2:0", -1, -1, 4) Icon(0)
5. Чтобы PHPLint не ругался на стандартые функции необходимо добавить в начало проверяемого php файла:

Code: Select all

<?php
/*.
    require_module 'standard';
    require_module 'mysql';
    require_module 'pcre';
.*/

Posted: Wed Apr 11, 2012 5:22 pm
by KDJ
PlugTextToAkelPad.js

Added support for multiple files ToolBar*.dll

Posted: Wed Apr 11, 2012 6:43 pm
by KDJ
I need to change the icon associated with the dialog box.
I think, I can do it this way:
AkelPad.SendMessage(hWndDlg, 0x0080 /*WM_SETICON*/, 0 /*ICON_SMALL*/, hIcon);
But I don't know, how to get the handle to the icon contained in a file (.exe, .dll or .ico).
Maybe using LoadIcon() or LoadImage() functions.
Please help me.

Posted: Wed Apr 11, 2012 6:45 pm
by FeyFre
Tested some KDJs scripts, have warnings.
PlugTextToAkelPad.js
When I use it and Templates::Main in running, it opens templates selection dialog, which is redundant it this case I think. Script should prevent it.
PlugToolBarAkelFont.js
When I run it by hotkey is as stated sets font, but it also sets focus to AkelPad main window. I think it should return focus back. However, I'm not sure it is bug of script. Possible it is APs/Scritps bug.

Posted: Wed Apr 11, 2012 8:24 pm
by KDJ
FeyFre wrote:PlugTextToAkelPad.js
When I use it and Templates::Main in running, it opens templates selection dialog, which is redundant it this case I think. Script should prevent it.
As always, you're right.
Soon I will correct this.
And I think, that such behavior occurs in several other scripts.
PlugToolBarAkelFont.js
When I run it by hotkey is as stated sets font, but it also sets focus to AkelPad main window. I think it should return focus back. However, I'm not sure it is bug of script. Possible it is APs/Scritps bug.
It's probably a bug in Scripts plugin.
If you replace
AkelPad.Command(4332);
with
oSys.Call("user32::SetFocus", hCtrlWnd);
it also does not work properly.

Posted: Thu Apr 12, 2012 1:18 am
by Instructor
KDJ
MSDN wrote:SetFocus function
Sets the keyboard focus to the specified window. The window must be attached to the calling thread's message queue.
ToolBar has its own thread.

Posted: Thu Apr 12, 2012 5:10 am
by KDJ
Yes, indeed.
Maybe this will solve the problem:
oSys.Call("user32::SetForegroundWindow", hPlugWnd);

Posted: Thu Apr 12, 2012 7:58 am
by FeyFre
KDJ, oSys.Call("kernel32::AttachThreadInput",idAttach,idAttachTo,tru/false). Google it.

Posted: Thu Apr 12, 2012 1:51 pm
by DV
Был ли уже такой скрипт, который формирует строки заданной ширины (в символах), заполняя промежутки между словами дополнительными пробелами? Т.е. результатом его работы будет что-то вроде

Code: Select all

Hello,   my   pork,
Hello,   my  honey!
Pig is really neat.
Oh           pig!!!
(ширина = 20 символов).

Posted: Thu Apr 12, 2012 2:10 pm
by maddogmax
Instructor wrote:
maddogmax wrote:Ребят, такой вопрос. Есть ли плагин (скрипт) под akelpad для валидации php?
Есть такой вариант:
1. Скачиваем PHPLint.
2. Распаковываем в папку "[AkelPad]\AkelFiles\Tools".
3. Переименовываем папку "[AkelPad]\AkelFiles\Tools\phplint-windows-1.1_20120402" в "[AkelPad]\AkelFiles\Tools\phplint".
4. Создаем вызов в ToolBar или ContextMenu или HotKeys плагине:

Code: Select all

-"PHP validator" Call("Log::Output", 1, `"%a\AkelFiles\Tools\phplint\src\phplint.exe" --modules-path ./modules "%f"`, "%a\AkelFiles\Tools\phplint", "(.*):(\d+):", "/FILE=$1 /GOTOLINE=$2:0", -1, -1, 4) Icon(0)
5. Чтобы PHPLint не ругался на стандартые функции необходимо добавить в начало проверяемого php файла:

Code: Select all

<?php
/*.
    require_module 'standard';
    require_module 'mysql';
    require_module 'pcre';
.*/
Все классно, но слишком много дебаг информации, если не закрыта, допустим, скобка, и разобраться становится невозможно :(

Posted: Thu Apr 12, 2012 2:25 pm
by KDJ
DV wrote:Был ли уже такой скрипт, который формирует строки заданной ширины (в символах), заполняя промежутки между словами дополнительными пробелами?
AlignJustify.js

Posted: Thu Apr 12, 2012 2:39 pm
by DV
KDJ wrote:AlignJustify.js
Fantastic!

Posted: Thu Apr 12, 2012 4:58 pm
by KDJ
FeyFre wrote:oSys.Call("kernel32::AttachThreadInput",idAttach,idAttachTo,tru/false). Google it.
Thank you for the advice.
It seems to me, that the easiest way is by using SetForegroundWindow() function.

Posted: Thu Apr 12, 2012 7:06 pm
by KDJ
PluginText.js
PlugTextToAkelPad.js
Fixed: conflict with Templates plugin.

PlugToolBarAkelFont.js
Fixed: setting dialog box of ToolBar plugin to the foreground.

Posted: Thu Apr 12, 2012 7:47 pm
by KDJ
FileAndStream.js

Changed: instead AkelPad.InputBox() method, uses own function InputBox().
InputBox window width fits to the length of label text.