Scripts plugin

Discuss and announce AkelPad plugins
  • Author
  • Message
Offline
Posts: 767
Joined: Mon Sep 28, 2009 10:03 am
Location: Minsk, Belarus

Post by se7h »

Instructor, а как насчет
se7h wrote:сделать возможным выделение (удерживая shift или ctrl) сразу нескольких скриптов для дальнейшего их изменения, в случае мультивыделения кнопки "Запустить" и "Назначить" становились бы неактивными

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

Post by KDJ »

Instructor
Thank you for multiline label.
You can yet expand the window and add text wrapping.

For example the path:
"C:\Documents and Settings\Default User\Dane aplikacji\Microsoft\Internet Explorer\"
has been shortened to:
"C:\Documents and Settings\Default User\Dane"
http://desmond.imageshack.us/Himg9/scal ... res=medium

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

Post by KDJ »

One more thing.
InputBox does not display an ampersand character ("&") contained in pLabel.
Instructor, can you add SS_NOPREFIX style to the static control?

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

Post by Instructor »

KDJ wrote:...has been shortened to:...
"Long string\n\n\n"
KDJ wrote:... can you add SS_NOPREFIX style to the static control?
Done.

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

Post by KDJ »

Instructor wrote:"Long string\n\n\n"
Long string is a path, and its length is variable.
And I don't know where to insert breaks ("\n"), so that the parts were matched to the width of the window.
Can you use SS_EDITCONTROL style?

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

Post by Instructor »

Добавлено: SearchReplace.js - возможность найти все вхождения и вывести в окно вывода (требуется Log плагин).
Добавлено: SearchReplace.js - возможность использования скрипта в окнах редактирования плагинов, таких как, ContextMenu, ToolBar, Log::Output, Clipboard::Capture, HexSel::Main.
Добавлено: возможность с помощью метода MessageBox отображать сообщение с заданным набором кнопок.
Добавлено: метод SetEditWnd - установить дескриптор активного окна редактирования вручную.
Добавлено: необязательный параметр в метод SetSel для задания флагов выделения.
Добавлено: необязательный параметр в метод IsAkelEdit для определения принадлежности окна к классу "AkelEdit".

Added: SearchReplace.js - opportunity to find all occurrences and display them in output window (requires Log plugin).
Added: SearchReplace.js - possibility to use the script in plugins edit windows, such as, ContextMenu, ToolBar, Log::Output, Clipboard::Capture, HexSel::Main.
Added: possibility to use custom buttons in MessageBox method.
Added: method SetEditWnd - set active edit window handle manually.
Added: optional parameter to SetSel method for selection flags setting.
Added: optional parameter to IsAkelEdit method for determining window class.


Scripts plugin v10.6

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

Post by KDJ »

Instructor
You can not run the script from another location than the default e.g.:
AkelPad.Call("Scripts::Main", 1, "F:\\OtherScripts\\Script.js");
Can you fix it?

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

Post by FeyFre »

KDJ, I think that was done intentionally. Security reasons. If you want, you can do next trick(on JScript only)

Code: Select all

var scr = AkelPad.ReadFile(file); (eval,eval)(scr);

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

Post by Instructor »

KDJ
It is by design. But you can use relative paths:
AkelPad.Call("Scripts::Main", 1, "..\OtherScripts\Script.js");

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

Post by KDJ »

Instructor
But this is probably not possible to do, if AkelPad and script are on different drives:
D:\Program\Txt\AkelPad\AkelFiles\Plugs\Scripts
F:\OtherScripts\Script.js

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

Post by KDJ »

FeyFre wrote:

Code: Select all

var scr = AkelPad.ReadFile(file); (eval,eval)(scr);
Why is the repeated "eval"?

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

Post by FeyFre »

KDJ
Why is the repeated "eval"?
Indirect call of eval function. See ecma262 standard 15.1.2.1 and samples and explanations here. In short - it forces Program in eval to be run in global scope. In some case you can require such behaviour.

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

Post by KDJ »

Instructor wrote:KDJ
It is by design. But you can use relative paths:
AkelPad.Call("Scripts::Main", 1, "..\OtherScripts\Script.js");
If you use relative path, then this is the title of the window:
Image

Offline
Posts: 1862
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

Instructor wrote:Добавлено: SearchReplace.js - возможность найти все вхождения и вывести в окно вывода (требуется Log плагин).
Теперь напрашивается вывод кликабельных строк с выделением найденного цветом. :D
В принципе, для выделения цветом достаточно научить текстовое поле подсветке синтаксиса и подсветить каждую найденную строку.

Offline
Posts: 3217
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

Infocatcher wrote:Теперь напрашивается вывод кликабельных строк с выделением найденного цветом.
В принципе, для выделения цветом достаточно научить текстовое поле подсветке синтаксиса и подсветить каждую найденную строку.
Я только сегодня хотел опять просить в теме Coder-плагина, чтобы сделали возможность всем плагам использовать одни и те же настройки цветовых переменных, как это сделано в самом Coder'е (окошко фолдинга), и добавить в каждом плаге галку "Использовать цветовую тему Coder'а для плагов", если отжата, то отображать так, как сейчас.
Код "кликабельности" строк в принципе тоже уже реализован в рамках Coder'а (окошко фолдинга), так что не вижу сложностей, разве что только время.
Post Reply