SpellCheck plugin

Discuss and announce AkelPad plugins
  • Author
  • Message
Offline
Site Admin
Posts: 6403
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

KDJ
Add "_" to word delimiter list. "Settings...->Advanced->Word delimiters"

FeyFre
Когда ошибка подчеркнута линия затирает символ "_" несмотря на то, что установлен междустрочный интервал. Чтобы этого не происходило, можно использовать следующий код:

Code: Select all

SendMessage(hWndEdit, AEM_GETCHARSIZE, AECS_HEIGHT, 0);
А это сообщение получает сам междустрочный интервал:

Code: Select all

SendMessage(hWndEdit, AEM_GETLINEGAP, 0, 0);

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

Post by FeyFre »

Instructor
Пользуюсь обоими для 4.x.x

Code: Select all

		dc = GetDC(hWnd);
		hFont=CreateFontIndirectW((LOGFONTW *)SendMessage(hMainWindow, AKD_GETFONTW, (WPARAM)hWnd, 0));
		LONG shift = 0;
		LONG tmHeightLocal;
		if (bAkelEdit)
		{
			tmHeightLocal = shift = SendMessageW(hWnd, AEM_GETCHARSIZE, AECS_HEIGHT, 0)-1;
			shift -= SendMessageW(hWnd, AEM_GETLINEGAP,0,0);
		}
		else
			shift = (tmHeightLocal = tm.tmHeight) - 1;
(shift - смещение от верхнего края строки, там будет рисоваться линия)
Опускать ниже пробовал... не вариант(при отрисовке нижней строки окна при нулевом междустрочным линии вообще не было, видать выходило за регион перерисовки)

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

Post by Instructor »

FeyFre
Ну можно как-нибудь так:

Code: Select all

         gap = SendMessageW(hWnd, AEM_GETLINEGAP,0,0);
         shift -= gap;
         if (gap > 0) shift += 1;
Если это имеет значение, в первом варианте tmHeightLocal будет на единицу меньше, чем в RichEdit.

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

Post by FeyFre »

Instructor
Можно(но я что-то не хочу в этот кусок лазить.... там по коду 5-кратное вложение if, и 3-кратное while - как бы чего не поломать :lol:)
Если это имеет значение, в первом варианте tmHeightLocal будет на единицу меньше, чем в RichEdit.
В обоих вариантах одинаково(и там, и там есть вычитается 1 из высоты, только для RichEdit беру высоту из TextMetrics шрифта(hOldFont=(HFONT)SelectObject(dc, hFont);GetTextMetricsW(dc,&tm);), а для AkelEdit спрашиваю у него).


ЗЫ: получили ответ? я с другого ящика отсылал.

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

Post by Instructor »

Всего кода мне не видно, но из того что есть - во втором варианте:

Code: Select all

shift = (tmHeightLocal = tm.tmHeight) - 1;
tmHeightLocal будет равен tm.tmHeight, но не tm.tmHeight - 1. Приглядитесь :)

Ответа нет.

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

Post by FeyFre »

Instructor
Приглядитесь
Забили. Я вчера целые сутки не мог заставить отладчик студии подхватывать библиотеку(при чем древнейший ntsd всё хватает), злой как бегемот.

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

Post by KDJ »

Instructor, FeyFre
Add "_" to word delimiter list.
This solves the problem of the sign '_'.

But what to do with numbers and dates "123789", "15-06-2010"?
Whether to add "0123456789" to the list of delimiters?
Then the keyboard shortcuts Ctrl+Left, Ctrl+Right are acting strangely - they are jumping over all numbers and dates.

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

Post by FeyFre »

Then the keyboard shortcuts Ctrl+Left, Ctrl+Right are acting strangely - they are jumping over all numbers and dates.
They acting as you setup them(jump to begin of word, jump to end of word, skipping all delimiters). So SpellCheck will, and so will not mark them as incorrect "words".

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

Post by KDJ »

Now check spelling does not mark as wrong numbers and dates ("123789", "15-06-2010").
But the use of digits as a separator of words seems to me strange and unnatural.

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

Post by FeyFre »

But the use of digits as a separator of words seems to me strange and unnatural.
The choice is yours. I'll try to implement this feature letter, after 1.0 release(probably you have noticed that plugin in FeatureFreeze state). For now, there are a lot of undone work in SpellCheck to make it fully compatible with AkelPad, before I'll have right to declare "SpellCheck is stable".

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

Post by FeyFre »

Обновление 1.0 RC

Updated to 1.0 RC

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

Post by KDJ »

If you remove "\n" from the list of words delimiters and you enable function "SpellCheck:: Background", then AkelPad is hung.

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

Post by FeyFre »

KDJ
That was definitely bad idea. :wink:

Fixed in RC2.

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

Post by FeyFre »

Обновление 1.0 RC2

Updated to 1.0 RC2

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

Post by KDJ »

FeyFre
You forgot to update the link to your file.
I found it. It is here: http://staynormal.org.ua/aspell/SpellCheck-RC2.7z
Now it works well.
Even you can do so that the ESC key and Alt+F4 and click the mouse on the button [x], causing closure of the window "SpellCheck::CheckDocument".
Now working as pressing the "Skip" button.
Post Reply