AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Scripts discussion (3)
Goto page Previous  1, 2, 3, 4, 5, 6 ... 29, 30, 31  Next
 
Post new topic   Reply to topic    AkelPad Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5454

PostPosted: Mon May 12, 2014 4:11 am    Post subject: Reply with quote

KDJ wrote:
In which case, RegisterCallback returns false (0)?
If you will look at sources RegisterCallback returns NULL, for example, if script try to register 31 callback. But plugin also set HRESULT to DISP_E_BADINDEX to specify error for user, because RegisterCallback error it is a stop execution error.

CreateDialog_functions.js wrote:
var hDC = oSys.Call("User32::GetDC", 0);
Just for information - on Windows with aero effect getting entire screen device context even single time could take more than second.
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1413
Location: Poland

PostPosted: Mon May 12, 2014 7:23 pm    Post subject: Reply with quote

Instructor
So the following code should work faster?
Code:
var hDC = oSys.Call("User32::GetDC", AkelPad.GetMainWnd());
Back to top
View user's profile Send private message
Infocatcher



Joined: 06 Aug 2007
Posts: 1639

PostPosted: Mon May 12, 2014 8:09 pm    Post subject: Reply with quote

Instructor
Hmm...
Code:
var t = new Date().getTime();
oSys.Call("User32::GetDC", 0);
WScript.Echo((new Date().getTime() - t) + " ms");

"0 ms" for me on Windows 7 x86 (with Aero enabled). But some effects are disabled.

Back to top
View user's profile Send private message Visit poster's website
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5454

PostPosted: Tue May 13, 2014 2:04 pm    Post subject: Reply with quote

KDJ
Yes. I'd rather use AkelPad.GetMainWnd() instead of zero.

Infocatcher
Помню была проблема с медленной прорисовкой активного столбца на Win7 с aero - там я также получал GetDC с 0. Уже запамятовал, но возможно уское место было именно при прорисовке. В любом случае лучше получить DC окна AkelPad'а, чтобы избежать возможных проблем с быстродействием.
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1413
Location: Poland

PostPosted: Sat May 17, 2014 10:02 pm    Post subject: Reply with quote

AkelPadRestart.js
Added: support for SDI mode.
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1413
Location: Poland

PostPosted: Sun May 18, 2014 5:31 pm    Post subject: Reply with quote

AkelPadRestart.js
Changed: saving modified documents before restart.
Added: possibility to translate language strings.
Back to top
View user's profile Send private message
Andrey_A_A



Joined: 03 Jun 2010
Posts: 590
Location: Сочи, Хоста

PostPosted: Tue May 20, 2014 9:08 am    Post subject: Reply with quote

KDJ, не могли ли бы ввести новый параметр в скрипт Translator.js
чтобы при вызове автоматически переводился текст

к примеру Call("Scripts::Main", 1, "Translator.js", `"ru en" "autotrans"')

Заранее спасибо.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
KDJ



Joined: 06 Mar 2010
Posts: 1413
Location: Poland

PostPosted: Tue May 20, 2014 10:04 am    Post subject: Reply with quote

Andrey_A_A
Options->Settings, turn on: "Load source text to panel at start" and "Start immediately translate".
Back to top
View user's profile Send private message
Andrey_A_A



Joined: 03 Jun 2010
Posts: 590
Location: Сочи, Хоста

PostPosted: Tue May 20, 2014 10:13 am    Post subject: Reply with quote

KDJ
я поставил галочку, но всё равно не происходит перевода при старте.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
KDJ



Joined: 06 Mar 2010
Posts: 1413
Location: Poland

PostPosted: Tue May 20, 2014 6:03 pm    Post subject: Reply with quote

Andrey_A_A
Well, sometimes it does not work.
Try this test version Translator_test.js: KDJ.zip
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1413
Location: Poland

PostPosted: Tue May 20, 2014 8:13 pm    Post subject: Reply with quote

AkelPadRestart.js
Fixed: does not work if the option "Don't open a program twice" is not set.
Back to top
View user's profile Send private message
Andrey_A_A



Joined: 03 Jun 2010
Posts: 590
Location: Сочи, Хоста

PostPosted: Tue May 20, 2014 8:19 pm    Post subject: Reply with quote

KDJ wrote:
Andrey_A_A
Well, sometimes it does not work.
Try this test version Translator_test.js


Спасибо, в этой версии работает!

------------- Добавлено ----------------
Ваш скрипт AkelPadRestart.js у меня не работает, просто закрывает программу. Думаю не хватает паузы, а лучше сделать ожидание завершения процесса, потому что вкладок может быть достаточно много
Back to top
View user's profile Send private message Send e-mail Visit poster's website
San_dr



Joined: 06 Dec 2010
Posts: 161
Location: г.Харьков, Русь

PostPosted: Wed May 21, 2014 9:48 am    Post subject: Reply with quote

Мне нужно вызвать окно AkelPad с заранее сформированным видом, развернутое (но с панелью заголовка, не FullScreen).
Конструкция вида
Code:
-"Основная развёрнутая" Call("Scripts::Main", 1, "EvalCmd.js", `AkelPad.Call("Scripts::Main", 1, "ScreenView.js", '-View="DefaultFS" -FullScreen=0'); {AkelPad.Command(4331);}`)

работает, но окно через раз развернуто/восстановленно. Меняю метод с Command(4331) на Show(3) - т.е. показавать развернутым

Code:
-"Основная развёрнутая" Call("Scripts::Main", 1, "EvalCmd.js", `AkelPad.Call("Scripts::Main", 1, "ScreenView.js", '-View="DefaultFS" -FullScreen=0'); {AkelPad.Show(3);}`)


и это вызывает ошибку скрипта EvalCmd.js
пробовал менять последовательность
Code:
 -"Основная развёрнутая" Call("Scripts::Main", 1, "EvalCmd.js", `AkelPad.Show(3);  {AkelPad.Call("Scripts::Main", 1, "ScreenView.js", '-View="DefaultFS" -FullScreen=0');}`)

- без разницы, ошибка скрипта: Объект не поддерживает это свойство или метод...
Как правильно собрать такой... паровоз?
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1413
Location: Poland

PostPosted: Wed May 21, 2014 5:42 pm    Post subject: Reply with quote

San_dr
Code:
-"Основная развёрнутая" Call("Scripts::Main", 1, "EvalCmd.js", `AkelPad.Call("Scripts::Main", 1, "ScreenView.js", '-View="DefaultFS" -FullScreen=0'); AkelPad.SystemFunction().Call("User32::ShowWindow", AkelPad.GetMainWnd(), 3 /*SW_MAXIMIZE*/);`)

#or

-"Основная развёрнутая" Call("Scripts::Main", 1, "EvalCmd.js", `AkelPad.Call("Scripts::Main", 1, "ScreenView.js", '-View="DefaultFS" -FullScreen=0'); AkelPad.SendMessage(AkelPad.GetMainWnd(), 274 /*WM_SYSCOMMAND*/, 0xF030 /*SC_MAXIMIZE*/, 0);`)
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1413
Location: Poland

PostPosted: Wed May 21, 2014 7:38 pm    Post subject: Reply with quote

Translator.js
Fixed: option "Start immediately translate" sometimes does not work.

Andrey_A_A wrote:

Ваш скрипт AkelPadRestart.js у меня не работает, просто закрывает программу. Думаю не хватает паузы, а лучше сделать ожидание завершения процесса, потому что вкладок может быть достаточно много

What versions of Windows and AkelPad are you using (32/64 bit)?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Plugins All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6 ... 29, 30, 31  Next
Page 5 of 31

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group