From 944bf4364d72cef3c55f212628a3414ffcbf961c Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 21 Apr 2000 01:59:43 +0000 Subject: Changed font sizing to use more Windows compatible calculation Some unfinished work on fixing folding bugs. --- win32/ScintillaWin.cxx | 48 ++++++++++-------------------------------------- 1 file changed, 10 insertions(+), 38 deletions(-) (limited to 'win32/ScintillaWin.cxx') diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 114f7aa41..2663dff2e 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -410,36 +410,9 @@ LRESULT ScintillaWin::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam) { } else return ::DefWindowProc(wMain.GetID(), iMessage, wParam, lParam); - case WM_CHAR: { - char utfval[4]="\0\0\0"; - if (IsUnicodeMode()) { - if ((wParam > 0xff) || (!iscntrl(wParam))) { - int inputCodePage = InputCodePage(); - char ansiChars[3]; - ansiChars[0] = static_cast(wParam); - ansiChars[1] = '\0'; - ansiChars[2] = '\0'; - wchar_t wcs[2]; - //int nRet = - ::MultiByteToWideChar(inputCodePage, 0, ansiChars, 1, wcs, 1); - wchar_t uchar = wcs[0]; - unsigned int len = UTF8Length(&uchar, 1); - UTF8FromUCS2(&uchar, 1, utfval, len); - utfval[len] = '\0'; - AddCharUTF(utfval,len); - /* - wchar_t uchar = wParam; - unsigned int len = UTF8Length(&uchar, 1); - UTF8FromUCS2(&uchar, 1, utfval, len); - utfval[len] = '\0'; - AddCharUTF(utfval,len); - */ - } - } else { - if (!iscntrl(wParam&0xff)) { - AddChar(static_cast(wParam&0xff)); - } - } + case WM_CHAR: + if (!iscntrl(wParam&0xff)) { + AddChar(static_cast(wParam&0xff)); } return 1; @@ -500,11 +473,11 @@ LRESULT ScintillaWin::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam) { break; case WM_IME_STARTCOMPOSITION: // dbcs - //ImeStartComposition(); + ImeStartComposition(); return ::DefWindowProc(wMain.GetID(), iMessage, wParam, lParam); case WM_IME_ENDCOMPOSITION: // dbcs - //ImeEndComposition(); + ImeEndComposition(); return ::DefWindowProc(wMain.GetID(), iMessage, wParam, lParam); case WM_IME_COMPOSITION: @@ -519,15 +492,13 @@ LRESULT ScintillaWin::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam) { if (inputCodePage) { char utfval[4]="\0\0\0"; char ansiChars[3]; - ansiChars[0] = static_cast(wParam & 0xff); - ansiChars[1] = static_cast(wParam >> 8); + ansiChars[0] = HIBYTE(wParam); + ansiChars[1] = LOBYTE(wParam); ansiChars[2] = '\0'; wchar_t wcs[2]; nRet = ::MultiByteToWideChar(inputCodePage, 0, ansiChars, 2, wcs, 1); - wchar_t uchar = wcs[0]; - uchar = wParam; - unsigned int len = UTF8Length(&uchar, 1); - UTF8FromUCS2(&uchar, 1, utfval, len); + unsigned int len = UTF8Length(wcs, 1); + UTF8FromUCS2(wcs, 1, utfval, len); utfval[len] = '\0'; AddCharUTF(utfval,len); } @@ -1081,6 +1052,7 @@ void ScintillaWin::ImeStartComposition() { if (sizeZoomed <= 2) // Hangs if sizeZoomed <= 1 sizeZoomed = 2; Surface surface; + surface.Init(); int deviceHeight = (sizeZoomed * surface.LogPixelsY()) / 72; // The negative is to allow for leading lf.lfHeight = -(abs(deviceHeight)); -- cgit v1.2.3