ContextMenu plugin

Discuss and announce AkelPad plugins
  • Author
  • Message
Offline
Posts: 670
Joined: Thu Jun 03, 2010 8:47 am
Location: Сочи, Хоста
Contact:

Post by Andrey_A_A »

Lenchik, попробуй вписать вместо hFont числа , пример

Code: Select all

AkelPad.SendMessage(hCtrlWnd, 48 /*WM_SETFONT*/, "-418749268", true)
Arial 14 "-418749268"
Arial 12 "-871756172"

Tahoma 14 "671774494"
Tahoma 12 "1628076145"

=========
у меня Виста 32 - всё работает

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

Post by KDJ »

Lenchik wrote:Если шрифт подгружается автономно, через плагин Font, то этот скрипт не работает?
On WinXP works properly.
In AkelPad, you must have at least one file open.
Because the script retrieves the font from AkelPad edit window.

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

Post by Instructor »

KDJ

Code: Select all

var hFont=AkelPad.SendMessage(hMainWnd, 1233 /*AKD_GETFONTW*/, 0, 0);

Offline
Posts: 366
Joined: Mon Jan 10, 2011 5:28 pm
Contact:

Post by Lenchik »

Instructor wrote:

Code: Select all

var hFont=AkelPad.SendMessage(hMainWnd, 1233 /*AKD_GETFONTW*/, 0, 0);
Выдаёт ошибку, дескать hMainWnd не назначен.

У меня заработало. Оказывается нельзя закрывать окошко плагина ContextMenu. Жаль, что бесполезно назначать горячую клавишу для скрипта. И в ToolBar хотелось бы то же.

Instructor, может быть возможно добавить в формы ContextMenu и ToolBar кнопочки, по нажатию которых брались бы настройки шрифта Акельпада (те, которые по command(4201))?

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

Post by KDJ »

Instructor
Thank you for the hint.
Please tell me, what is the difference between AKD_GETFONT and AKD_GETFONTW.

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

Post by KDJ »

Lenchik wrote:Выдаёт ошибку, дескать hMainWnd не назначен.
Replace hMainWnd on AkelPad.GetMainWnd().

Code: Select all

var hFont = AkelPad.SendMessage(AkelPad.GetMainWnd(), 1233 /*AKD_GETFONTW*/, 0, 0);

Offline
Posts: 366
Joined: Mon Jan 10, 2011 5:28 pm
Contact:

Post by Lenchik »

Script called from opened tab in MDI mode shows Contextmenu window without any changes. Called next without closing Contextmenu window change font as supposed.

Похоже не получает изменения вызванное окошко под Win 7 x64 (Akelpad x86).

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

Post by KDJ »

Lenchik
Try lengthening the waiting time.
In the script replace:
WScript.Sleep(20);
with
WScript.Sleep(100);

Offline
Posts: 366
Joined: Mon Jan 10, 2011 5:28 pm
Contact:

Post by Lenchik »

Great! It works now! :)

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

Post by KDJ »

KDJ wrote:Instructor
Thank you for the hint.
Please tell me, what is the difference between AKD_GETFONT and AKD_GETFONTW.
Do I well understand, that can use AKD_GETFONT instead AKD_GETFONTA and AKD_GETFONTW.

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

Post by FeyFre »

KDJ
AKD_GETFONT is equal to AKD_GETFONTW on Windows NT derivatives(2000,XP,2003,Vista,7,8 in Unicode systems), and is equal to AKD_GETFONTA on Windows98.

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

Post by KDJ »

FeyFre
So AKD_GETFONT may be apply universally.

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

Post by KDJ »

In the file ContextMenu-Eng.txt I found Russian words (line 209):
Icon(["файл"], [индекс])

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

Post by Instructor »

KDJ
Corrected.

Offline
Posts: 173
Joined: Mon Dec 06, 2010 9:53 am
Location: г.Харьков, Русь

Post by San_dr »

Подскажите, в чем проблема:
У меня при Автообновлении не обновляются ContextMenu и TulBar пишет "Ошибок: 2" Image
(7. Использую свой шрифт)
--------------------------------------------------
В ХР нормально обновляет
Post Reply