예제 #1
0
 @Override
 LRESULT WM_IME_ENDCOMPOSITION(long /*int*/ wParam, long /*int*/ lParam) {
   if (ime != null) {
     LRESULT result = ime.WM_IME_ENDCOMPOSITION(wParam, lParam);
     if (result != null) return result;
   }
   return super.WM_IME_ENDCOMPOSITION(wParam, lParam);
 }
예제 #2
0
 @Override
 LRESULT WM_LBUTTONDOWN(long /*int*/ wParam, long /*int*/ lParam) {
   if (ime != null) {
     LRESULT result = ime.WM_LBUTTONDOWN(wParam, lParam);
     if (result != null) return result;
   }
   return super.WM_LBUTTONDOWN(wParam, lParam);
 }
예제 #3
0
 @Override
 LRESULT WM_KILLFOCUS(long /*int*/ wParam, long /*int*/ lParam) {
   if (ime != null) {
     LRESULT result = ime.WM_KILLFOCUS(wParam, lParam);
     if (result != null) return result;
   }
   Caret caret = this.caret;
   LRESULT result = super.WM_KILLFOCUS(wParam, lParam);
   if (caret != null) caret.killFocus();
   return result;
 }
예제 #4
0
 @Override
 void releaseChildren(boolean destroy) {
   if (caret != null) {
     caret.release(false);
     caret = null;
   }
   if (ime != null) {
     ime.release(false);
     ime = null;
   }
   super.releaseChildren(destroy);
 }
예제 #5
0
  @Override
  LRESULT WM_IME_COMPOSITION(long /*int*/ wParam, long /*int*/ lParam) {
    if (ime != null) {
      LRESULT result = ime.WM_IME_COMPOSITION(wParam, lParam);
      if (result != null) return result;
    }

    /*
     * Bug in Windows.  On Korean Windows XP, the IME window
     * for the Korean Input System (MS-IME 2002) always opens
     * in the top left corner of the screen, despite the fact
     * that ImmSetCompositionWindow() was called to position
     * the IME when focus is gained.  The fix is to position
     * the IME on every WM_IME_COMPOSITION message.
     */
    if (!OS.IsWinCE && OS.WIN32_VERSION == OS.VERSION(5, 1)) {
      if (OS.IsDBLocale) {
        short langID = OS.GetSystemDefaultUILanguage();
        short primaryLang = OS.PRIMARYLANGID(langID);
        if (primaryLang == OS.LANG_KOREAN) {
          if (caret != null && caret.isFocusCaret()) {
            POINT ptCurrentPos = new POINT();
            if (OS.GetCaretPos(ptCurrentPos)) {
              COMPOSITIONFORM lpCompForm = new COMPOSITIONFORM();
              lpCompForm.dwStyle = OS.CFS_POINT;
              lpCompForm.x = ptCurrentPos.x;
              lpCompForm.y = ptCurrentPos.y;
              long /*int*/ hIMC = OS.ImmGetContext(handle);
              OS.ImmSetCompositionWindow(hIMC, lpCompForm);
              OS.ImmReleaseContext(handle, hIMC);
            }
          }
        }
      }
    }
    return super.WM_IME_COMPOSITION(wParam, lParam);
  }
예제 #6
0
 /**
  * Sets the receiver's IME.
  *
  * @param ime the new IME for the receiver, may be null
  * @exception IllegalArgumentException
  *     <ul>
  *       <li>ERROR_INVALID_ARGUMENT - if the IME has been disposed
  *     </ul>
  *
  * @exception SWTException
  *     <ul>
  *       <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  *       <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  *     </ul>
  *
  * @since 3.4
  */
 public void setIME(IME ime) {
   checkWidget();
   if (ime != null && ime.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
   this.ime = ime;
 }
예제 #7
0
 @Override
 void reskinChildren(int flags) {
   if (caret != null) caret.reskin(flags);
   if (ime != null) ime.reskin(flags);
   super.reskinChildren(flags);
 }