Page 19 of 74
Posted: Fri Jul 23, 2010 1:38 pm
by FeyFre
KDJ
Find for description of message edit window message AEM_GETSEL in AkelEdit.h in source of AkelPad.
Posted: Fri Jul 23, 2010 1:38 pm
by Instructor
VladSh wrote:5. TextFind...
Все работает.
Posted: Fri Jul 23, 2010 1:50 pm
by Instructor
Добавлено: метод GetTextRange() для получения заданного диапазона текста.
Добавлено: в методе SaveFile() теперь кодировка и BOM являются не обязательными параметрами.
Добавлено: тип DT_BYTE для методов MemCopy и MemRead, а также тип DT_WORD теперь равен 4.
Added: method GetTextRange() for retrieving a specified range of text.
Added: in method SaveFile() now encoding and BOM are not required parameters.
Added: type DT_BYTE for methods MemCopy and MemRead, and also the type DT_WORD now equal to 4.
Scripts plugin v6.5
Posted: Fri Jul 23, 2010 1:55 pm
by VladSh
Instructor wrote:VladSh wrote:5. TextFind...
Все работает.
У меня
здесь не работало.
Код изначально был такой:
Code: Select all
AkelPad.TextFind(AkelPad.GetEditWnd(), pSearchText, 0x00200000 /*FR_DOWN|FR_BEGINNING*/);
for (var n = nCycles - 1; n > 0; n--)
{
AkelPad.TextFind(AkelPad.GetEditWnd(), pSearchText, 0x00000001 /*FR_DOWN*/);
}
Баг видно, когда файл с докой не открываешь, а вызываешь доку (этот же скрипт) повторно несколько раз - начинает искать не то вхождение. Потому и пришлось отказаться от такого способа в пользу AkelPad.SetSel(0, 0); перед каждым поиском.
Instructor wrote:Scripts plugin v6.5
Здорово! Теперь и FeyFre поднимет настроение

Posted: Fri Jul 23, 2010 2:06 pm
by Instructor
VladSh
0x00200000 != /*FR_DOWN|FR_BEGINNING*/
0x00200001 == /*FR_DOWN|FR_BEGINNING*/
Posted: Fri Jul 23, 2010 2:14 pm
by VladSh
Instructor
Я это из Scripts-Rus.txt скопировал.
Теперь понятно...
Posted: Fri Jul 23, 2010 2:29 pm
by KDJ
FeyFre wrote:Find for description of message edit window message AEM_GETSEL in AkelEdit.h.
There is written:
#Define AEM_GETSEL (WM_USER + 2101).
I do not know what value is AEM_GETSEL and WM_USER.
Can I use the function:
SendMessage(hWndEdit, AEM_GETSEL, WPARAM, LPARAM)?
What value should have the arguments:
AEM_GETSEL, WPARAM, LPARAM?
Posted: Fri Jul 23, 2010 2:38 pm
by FeyFre
KDJ
1. Read carefully, and you will find sample snippets.
2. If there something you cannot find or understand first of all you should read official WINAPI documentation from Microsoft(start here
http://msdn.microsoft.com/en-us/library ... S.85).aspx)
Posted: Fri Jul 23, 2010 3:43 pm
by Instructor
KDJ wrote:I have a question, maybe someone knows how to do it.
How to read, and then set the vertical selection?
Give a concrete example.
Posted: Fri Jul 23, 2010 7:50 pm
by KDJ
FeyFre wrote:1. Read carefully, and you will find sample snippets.
2. If there something you cannot find or understand first of all you should read official WINAPI documentation from Microsoft...
This is reading for professionals. I am a novice amateur.
In the AkelPad source files I not found WM_USER declaration.
My guess is, that it is 0x400, which is equal 1024.
If "# Define AEM_GETSEL (WM_USER + 2101)", does it mean that AEM_GETSEL==3125 ?
But still I do not know, what the value of WPARAM, LPARAM use.
Posted: Fri Jul 23, 2010 8:23 pm
by KDJ
Instructor wrote:KDJ wrote:I have a question, maybe someone knows how to do it.
How to read, and then set the vertical selection?
Give a concrete example.
Is the selected text vertically, eg. 3 columns, 6 rows.
I need select another piece of text, with the same size - 3x6 (not copy).
When the selection is normal (not verticaly), it can be done like this (shift selection of 100 characters):
var nMinSel = AkelPad.GetSelStart() + 100;
var nMaxSel = AkelPad.GetSelEnd() + 100;
AkelPad.SetSel(nMinSel, nMaxSel);
How to do it in the script:
1. Check whether the selection is normal or vertical.
2. Select a different text vertically with the same size (3x6) - shifted on 100 characters or 8 columns to the right and 3 rows below.
The problem occurs for example in the script
textStatistics.js (written by
Infocatcher) which does not restore vertical selection.
Posted: Sat Jul 24, 2010 12:17 am
by Infocatcher
Oh, I forgot about unused copyResult variable (Ctrl+C works fine for results dialog). Script updated.
Posted: Sat Jul 24, 2010 9:21 am
by VladSh
Infocatcher, это ссылка на обновлённый скрипт? Я смотрю, что номер версии и дата не изменились...
Posted: Sat Jul 24, 2010 10:54 am
by Instructor
KDJ
Here is simple way to do this:
Code: Select all
var hWndEdit=AkelPad.GetEditWnd();
var nSelStart;
var nSelEnd;
if (AkelPad.SendMessage(hWndEdit, 3127 /*AEM_GETCOLUMNSEL*/, 0, 0))
{
nSelStart=AkelPad.GetSelStart();
nSelEnd=AkelPad.GetSelEnd();
AkelPad.SetSel(nSelStart + 1, nSelEnd + 1);
AkelPad.SendMessage(hWndEdit, 3128 /*AEM_UPDATESEL*/, 0x1 /*AESELT_COLUMNON*/, 0);
}
Posted: Sat Jul 24, 2010 12:36 pm
by Infocatcher
VladSh wrote:Infocatcher, это ссылка на обновлённый скрипт? Я смотрю, что номер версии и дата не изменились...
Так и код не изменился – я убрал фрагмент, который не использовался.