Scripts discussion (2)

Discuss and announce AkelPad plugins
Locked
  • Author
  • Message
Offline
Site Admin
Posts: 6403
Joined: Thu Jul 06, 2006 7:20 am

Post 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';
.*/

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

PlugTextToAkelPad.js

Added support for multiple files ToolBar*.dll

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post 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.

Offline
Posts: 2248
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post 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.

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post 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.

Offline
Site Admin
Posts: 6403
Joined: Thu Jul 06, 2006 7:20 am

Post 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.

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

Yes, indeed.
Maybe this will solve the problem:
oSys.Call("user32::SetForegroundWindow", hPlugWnd);

Offline
Posts: 2248
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

KDJ, oSys.Call("kernel32::AttachThreadInput",idAttach,idAttachTo,tru/false). Google it.

DV
Offline
Posts: 1291
Joined: Thu Nov 16, 2006 11:53 am
Location: Kyiv, Ukraine

Post by DV »

Был ли уже такой скрипт, который формирует строки заданной ширины (в символах), заполняя промежутки между словами дополнительными пробелами? Т.е. результатом его работы будет что-то вроде

Code: Select all

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

Offline
Posts: 5
Joined: Sun Aug 30, 2009 2:16 pm

Post 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';
.*/
Все классно, но слишком много дебаг информации, если не закрыта, допустим, скобка, и разобраться становится невозможно :(

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

DV wrote:Был ли уже такой скрипт, который формирует строки заданной ширины (в символах), заполняя промежутки между словами дополнительными пробелами?
AlignJustify.js

DV
Offline
Posts: 1291
Joined: Thu Nov 16, 2006 11:53 am
Location: Kyiv, Ukraine

Post by DV »

KDJ wrote:AlignJustify.js
Fantastic!

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post 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.

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

PluginText.js
PlugTextToAkelPad.js
Fixed: conflict with Templates plugin.

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

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

FileAndStream.js

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