Scripts discussion (2)

Discuss and announce AkelPad plugins
Locked
  • Author
  • Message
KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »


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

Post by KDJ »

FileAndStream_functions.js

Fixed: EnumStreams() function.
On WinVista and Win7, function returned incorrect name of NTFS streams.
As a result, it was impossible to perform any operations on streams in script FileAndStream.js.
Required: Scripts plugin ver. 11.0.

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

Post by KDJ »

FileAndStream.js
Added: history of directories and undo/redo.
Fixed: minor bugs.
Changed: *.lng files.

Please also download new version of FileAndStream_functions.js (2012-05-17).

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

Post by KDJ »

Updated: FileAndStream_2052.lng by cnnnc.

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

Post by KDJ »

VladSh
In script FullScreenWithToolBar.js, can you add: full screen with main menu?

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

Post by VladSh »

KDJ
Yes, but do not know how to do it.
Actually, I want to change the script so that can further customize the display: statusbar, codefold, explorer, main menu.

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

Post by KDJ »

VladSh
Try to do something like that:

Code: Select all

...
else      //Переход из в обычного режима в полноэкранный
{
var oSys = AkelPad.SystemFunction();
var hMainWnd = AkelPad.GetMainWnd();
var hMenu = oSys.Call("user32::GetMenu", hMainWnd);

if (AkelPad.IsPluginRunning(pToolBar))
   AkelPad.Call(pToolBar);      //без этой строки не работает, т.е. надо сначала отключить тулбар
   
   AkelPad.Call(pFullScreen);
   
oSys.Call("user32::SetMenu", hMainWnd, hMenu);

//   if (!AkelPad.IsPluginRunning(pToolBar))      //если тулбар отключён - включаем
      AkelPad.Call(pToolBar);
}

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

Post by KDJ »

EnumerateWindows_functions.js
Added: EnumTopLevelWindows() function returns also handle to menu assigned to the window.

WindowsList.js
Added: info about handle to menu assigned to the window.
Changed: keyboard shortcut F5 -> F9.

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

Post by VladSh »

FullScreenWithToolBar.js, по причине доработки функционала, переименован в FullScreenEx.js, изменились правила задания аргументов; прошу прощения за неудобство :)

KDJ
Thanks!


Есть ограничение (думаю, что оно временное): если запустить скрипт такой строкой:

Code: Select all

-"Clipboard + Log" Call("Scripts::Main", 1, "FullScreenEx.js", `-Clipboard=true -Log=true`)
затем выйти из полноэкранного режима, а затем опять вызвать скрипт этой же строкой, то прога падает.

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

Post by KDJ »

VladSh
In FullScreenEx.js, I propose to reduce length of argument strings:

Code: Select all

...
// -"С тулбаром по умолчанию" Call("Scripts::Main", 1, "FullScreenEx.js", `-ToolBar="ToolBar"`)
// -"С панелями для работы с XML" Call("Scripts::Main", 1, "FullScreenEx.js", `-ToolBar="ToolBar-XML" -CodeFold=1`)
// -"Псевдо-SDI" Call("Scripts::Main", 1, "FullScreenEx.js", `-ToolBar="ToolBar" -Menu=1 -StatusBar=1`)
...
var pToolBar = AkelPad.GetArgValue("ToolBar", "");
if (pToolBar)
   pToolBar += "::Main";
...
   var bLog = AkelPad.GetArgValue("Log", 0);
   var bClipboard = AkelPad.GetArgValue("Clipboard", 0);
...

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

Post by KDJ »

FileInfo.js
Added: now the script works also in SDI mode.

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

Post by VladSh »

KDJ
Yes, yesterday was just thinking about it :)
Changed.

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

Post by KDJ »

VladSh
I think, you can still add a dialog box for setting arguments ("FullScreen settings") and saving them in .ini file.
Have you thought about this too? :wink:

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

Post by VladSh »

KDJ
Save to ini suggests - it's one set, the arguments are much more flexible. I do not consider it appropriate.
Although it is possible to make a other script that will work with the dialogue and save to ini and call my script for basic work. In my opinion, this is the best option.

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

Post by KDJ »

VladSh
I don't want to use INI file instead of arguments.
I meant to extend functionality of the script by adding argument "Settings".
If argument "Settings" was not used, the script works as before.
If "-Settings=1" then script reads the variables (bToolBar, bToolBar1, ..., bLog, bClipboard, bExplorer, bCodeFold, bStatusBar, bMenu) from INI file.
If "-Settings=2", the script calls dialog with checkboxes to set the variables and save them in INI file:
------------------------
FullScreen settings
------------------------
Visible:
[v]Menu
[ ]ToolBar
[v]ToolBar1
[ ]ToolBar2
...
[ ]Log
[ ]Clipboard
[ ]Explorer
[v]CodeFold
[ ]StatusBar
----------------------
OK Cancel
----------------------
Locked