diff options
-rw-r--r-- | win32/ScintillaWin.cxx | 64 |
1 files changed, 36 insertions, 28 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 77dd71288..90cb275a5 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -69,8 +69,10 @@ #include <commctrl.h> #ifndef __BORLANDC__ +#ifndef __DMC__ #include <zmouse.h> #endif +#endif #include <ole2.h> #ifndef MK_ALT @@ -406,40 +408,44 @@ LRESULT ScintillaWin::WndPaint(unsigned long wParam) { } static BOOL IsNT() { - OSVERSIONINFO osv = {sizeof(OSVERSIONINFO),0,0,0,0,""}; - ::GetVersionEx(&osv); - return osv.dwPlatformId == VER_PLATFORM_WIN32_NT; + OSVERSIONINFO osv = {sizeof(OSVERSIONINFO),0,0,0,0,""}; + ::GetVersionEx(&osv); + return osv.dwPlatformId == VER_PLATFORM_WIN32_NT; } sptr_t ScintillaWin::HandleComposition(uptr_t wParam, sptr_t lParam) { - if ((lParam & GCS_RESULTSTR) && (IsNT())) { - HIMC hIMC = ::ImmGetContext(wMain.GetID()); - if (hIMC) { - const int maxLenInputIME = 200; - wchar_t wcs[maxLenInputIME]; - LONG bytes = ::ImmGetCompositionStringW(hIMC, - GCS_RESULTSTR, wcs, (maxLenInputIME-1)*2); - int wides = bytes / 2; - if (IsUnicodeMode()) { - char utfval[maxLenInputIME * 3]; - unsigned int len = UTF8Length(wcs, wides); - UTF8FromUCS2(wcs, wides, utfval, len); - utfval[len] = '\0'; - AddCharUTF(utfval, len); - } else { - char dbcsval[maxLenInputIME * 2]; - int size = ::WideCharToMultiByte(InputCodePage(), - 0, wcs, wides, dbcsval, sizeof(dbcsval) - 1, 0, 0); - for (int i=0; i<size; i++) { - AddChar(dbcsval[i]); - } +#ifdef __DMC__ + return 0; +#else + if ((lParam & GCS_RESULTSTR) && (IsNT())) { + HIMC hIMC = ::ImmGetContext(wMain.GetID()); + if (hIMC) { + const int maxLenInputIME = 200; + wchar_t wcs[maxLenInputIME]; + LONG bytes = ::ImmGetCompositionStringW(hIMC, + GCS_RESULTSTR, wcs, (maxLenInputIME-1)*2); + int wides = bytes / 2; + if (IsUnicodeMode()) { + char utfval[maxLenInputIME * 3]; + unsigned int len = UTF8Length(wcs, wides); + UTF8FromUCS2(wcs, wides, utfval, len); + utfval[len] = '\0'; + AddCharUTF(utfval, len); + } else { + char dbcsval[maxLenInputIME * 2]; + int size = ::WideCharToMultiByte(InputCodePage(), + 0, wcs, wides, dbcsval, sizeof(dbcsval) - 1, 0, 0); + for (int i=0; i<size; i++) { + AddChar(dbcsval[i]); } - ::ImmReleaseContext(wMain.GetID(), hIMC); } - return 0; - } else { - return ::DefWindowProc(wMain.GetID(), WM_IME_COMPOSITION, wParam, lParam); + ::ImmReleaseContext(wMain.GetID(), hIMC); } + return 0; + } else { + return ::DefWindowProc(wMain.GetID(), WM_IME_COMPOSITION, wParam, lParam); + } +#endif } // Translate message IDs from WM_* and EM_* to SCI_* so can partly emulate Windows Edit control @@ -1301,6 +1307,7 @@ DropTarget::DropTarget() { * Called when IME Window opened. */ void ScintillaWin::ImeStartComposition() { +#ifndef __DMC__ if (caret.active) { // Move IME Window to current caret position HIMC hIMC = ::ImmGetContext(wMain.GetID()); @@ -1339,6 +1346,7 @@ void ScintillaWin::ImeStartComposition() { // Caret is displayed in IME window. So, caret in Scintilla is useless. DropCaret(); } +#endif } /** Called when IME Window closed. */ |