Scripts plugin
- Author
- Message
-
Offline
- Site Admin
- Posts: 6403
- Joined: Thu Jul 06, 2006 7:20 am
Добавлено: метод 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
Добавлено: в методе 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
-
Offline
- Posts: 3234
- Joined: Wed Nov 29, 2006 1:19 pm
- Location: Киев, Русь
- Contact:
У меня здесь не работало.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*/);
}
Здорово! Теперь и FeyFre поднимет настроениеInstructor wrote:Scripts plugin v6.5

-
Offline
- Posts: 3234
- Joined: Wed Nov 29, 2006 1:19 pm
- Location: Киев, Русь
- Contact:
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
There is written:FeyFre wrote:Find for description of message edit window message AEM_GETSEL in AkelEdit.h.
#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?
-
Offline
- Posts: 2248
- Joined: Tue Aug 07, 2007 2:03 pm
- Location: Vinnitsa, Ukraine
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)
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)
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
This is reading for professionals. I am a novice amateur.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...
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.
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
Is the selected text vertically, eg. 3 columns, 6 rows.Instructor wrote:Give a concrete example.KDJ wrote:I have a question, maybe someone knows how to do it.
How to read, and then set the vertical selection?
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.
-
Offline
- Posts: 1873
- Joined: Mon Aug 06, 2007 1:07 pm
- Contact:
Oh, I forgot about unused copyResult variable (Ctrl+C works fine for results dialog). Script updated.KDJ wrote:script textStatistics.js (written by Infocatcher)
-
Offline
- Posts: 3234
- Joined: Wed Nov 29, 2006 1:19 pm
- Location: Киев, Русь
- Contact:
-
Offline
- Site Admin
- Posts: 6403
- Joined: Thu Jul 06, 2006 7:20 am
KDJ
Here is simple way to do this:
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);
}
-
Offline
- Posts: 1873
- Joined: Mon Aug 06, 2007 1:07 pm
- Contact: