org.eclipse.swt.widgets.Spinner.imContext()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中org.eclipse.swt.widgets.Spinner.imContext()方法的一些代码示例,展示了Spinner.imContext()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Spinner.imContext()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Spinner
类名称:Spinner
方法名:imContext

Spinner.imContext介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

void fixIM () {
  /*
  *  The IM filter has to be called one time for each key press event.
  *  When the IM is open the key events are duplicated. The first event
  *  is filtered by SWT and the second event is filtered by GTK.  In some
  *  cases the GTK handler does not run (the widget is destroyed, the
  *  application code consumes the event, etc), for these cases the IM
  *  filter has to be called by SWT.
  */
  if (gdkEventKey != 0 && gdkEventKey != -1) {
    int /*long*/ imContext = imContext ();
    if (imContext != 0) {
      OS.gtk_im_context_filter_keypress (imContext, gdkEventKey);
      gdkEventKey = -1;
      return;
    }
  }
  gdkEventKey = 0;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

void fixIM () {
  /*
  *  The IM filter has to be called one time for each key press event.
  *  When the IM is open the key events are duplicated. The first event
  *  is filtered by SWT and the second event is filtered by GTK.  In some
  *  cases the GTK handler does not run (the widget is destroyed, the
  *  application code consumes the event, etc), for these cases the IM
  *  filter has to be called by SWT.
  */
  if (gdkEventKey != 0 && gdkEventKey != -1) {
    long /*int*/ imContext = imContext ();
    if (imContext != 0) {
      OS.gtk_im_context_filter_keypress (imContext, gdkEventKey);
      gdkEventKey = -1;
      return;
    }
  }
  gdkEventKey = 0;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

void fixIM () {
  /*
  *  The IM filter has to be called one time for each key press event.
  *  When the IM is open the key events are duplicated. The first event
  *  is filtered by SWT and the second event is filtered by GTK.  In some
  *  cases the GTK handler does not run (the widget is destroyed, the
  *  application code consumes the event, etc), for these cases the IM
  *  filter has to be called by SWT.
  */
  if (gdkEventKey != 0 && gdkEventKey != -1) {
    int /*long*/ imContext = imContext ();
    if (imContext != 0) {
      OS.gtk_im_context_filter_keypress (imContext, gdkEventKey);
      gdkEventKey = -1;
      return;
    }
  }
  gdkEventKey = 0;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
void deregister () {
  super.deregister ();
  int /*long*/ imContext = imContext ();
  if (imContext != 0) display.removeWidget (imContext);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
void deregister () {
  super.deregister ();
  int /*long*/ imContext = imContext ();
  if (imContext != 0) display.removeWidget (imContext);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
void deregister () {
  super.deregister ();
  long /*int*/ imContext = imContext ();
  if (imContext != 0) display.removeWidget (imContext);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
void register () {
  super.register ();
  long /*int*/ imContext = imContext ();
  if (imContext != 0) display.addWidget (imContext, this);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
void register () {
  super.register ();
  int /*long*/ imContext = imContext ();
  if (imContext != 0) display.addWidget (imContext, this);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
boolean filterKey (int keyval, int /*long*/ event) {
  int time = OS.gdk_event_get_time (event);
  if (time != lastEventTime) {
    lastEventTime = time;
    int /*long*/ imContext = imContext ();
    if (imContext != 0) {
      return OS.gtk_im_context_filter_keypress (imContext, event);
    }
  }
  gdkEventKey = event;
  return false;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
boolean filterKey (int keyval, long /*int*/ event) {
  int time = OS.gdk_event_get_time (event);
  if (time != lastEventTime) {
    lastEventTime = time;
    long /*int*/ imContext = imContext ();
    if (imContext != 0) {
      return OS.gtk_im_context_filter_keypress (imContext, event);
    }
  }
  gdkEventKey = event;
  return false;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
void register () {
  super.register ();
  int /*long*/ imContext = imContext ();
  if (imContext != 0) display.addWidget (imContext, this);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
boolean filterKey (int keyval, int /*long*/ event) {
  int time = OS.gdk_event_get_time (event);
  if (time != lastEventTime) {
    lastEventTime = time;
    int /*long*/ imContext = imContext ();
    if (imContext != 0) {
      return OS.gtk_im_context_filter_keypress (imContext, event);
    }
  }
  gdkEventKey = event;
  return false;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
boolean translateTraversal (GdkEventKey keyEvent) {
  int key = keyEvent.keyval;
  switch (key) {
    case OS.GDK_KP_Enter:
    case OS.GDK_Return: {
      long /*int*/ imContext =  imContext ();
      if (imContext != 0) {
        long /*int*/ [] preeditString = new long /*int*/ [1];
        OS.gtk_im_context_get_preedit_string (imContext, preeditString, null, null);
        if (preeditString [0] != 0) {
          int length = OS.strlen (preeditString [0]);
          OS.g_free (preeditString [0]);
          if (length != 0) return false;
        }
      }
    }
  }
  return super.translateTraversal (keyEvent);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
boolean translateTraversal (GdkEventKey keyEvent) {
  int key = keyEvent.keyval;
  switch (key) {
    case OS.GDK_KP_Enter:
    case OS.GDK_Return: {
      int /*long*/ imContext =  imContext ();
      if (imContext != 0) {
        int /*long*/ [] preeditString = new int /*long*/ [1];
        OS.gtk_im_context_get_preedit_string (imContext, preeditString, null, null);
        if (preeditString [0] != 0) {
          int length = OS.strlen (preeditString [0]);
          OS.g_free (preeditString [0]);
          if (length != 0) return false;
        }
      }
    }
  }
  return super.translateTraversal (keyEvent);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
boolean translateTraversal (GdkEventKey keyEvent) {
  int key = keyEvent.keyval;
  switch (key) {
    case OS.GDK_KP_Enter:
    case OS.GDK_Return: {
      int /*long*/ imContext =  imContext ();
      if (imContext != 0) {
        int /*long*/ [] preeditString = new int /*long*/ [1];
        OS.gtk_im_context_get_preedit_string (imContext, preeditString, null, null);
        if (preeditString [0] != 0) {
          int length = OS.strlen (preeditString [0]);
          OS.g_free (preeditString [0]);
          if (length != 0) return false;
        }
      }
    }
  }
  return super.translateTraversal (keyEvent);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
void hookEvents () {
  super.hookEvents();
  OS.g_signal_connect_closure (handle, OS.changed, display.getClosure (CHANGED), true);
  OS.g_signal_connect_closure (handle, OS.insert_text, display.getClosure (INSERT_TEXT), false);
  OS.g_signal_connect_closure (handle, OS.delete_text, display.getClosure (DELETE_TEXT), false);
  OS.g_signal_connect_closure (handle, OS.value_changed, display.getClosure (VALUE_CHANGED), false);
  OS.g_signal_connect_closure (handle, OS.activate, display.getClosure (ACTIVATE), false);
  OS.g_signal_connect_closure (handle, OS.populate_popup, display.getClosure (POPULATE_POPUP), false);
  long /*int*/ imContext = imContext ();
  if (imContext != 0) {
    OS.g_signal_connect_closure (imContext, OS.commit, display.getClosure (COMMIT), false);
    int id = OS.g_signal_lookup (OS.commit, OS.gtk_im_context_get_type ());
    int mask =  OS.G_SIGNAL_MATCH_DATA | OS.G_SIGNAL_MATCH_ID;
    OS.g_signal_handlers_block_matched (imContext, mask, id, 0, 0, 0, handle);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
void hookEvents () {
  super.hookEvents();
  OS.g_signal_connect_closure (handle, OS.changed, display.getClosure (CHANGED), true);
  OS.g_signal_connect_closure (handle, OS.insert_text, display.getClosure (INSERT_TEXT), false);
  OS.g_signal_connect_closure (handle, OS.delete_text, display.getClosure (DELETE_TEXT), false);
  OS.g_signal_connect_closure (handle, OS.value_changed, display.getClosure (VALUE_CHANGED), false);
  OS.g_signal_connect_closure (handle, OS.activate, display.getClosure (ACTIVATE), false);
  OS.g_signal_connect_closure (handle, OS.populate_popup, display.getClosure (POPULATE_POPUP), false);
  int /*long*/ imContext = imContext ();
  if (imContext != 0) {
    OS.g_signal_connect_closure (imContext, OS.commit, display.getClosure (COMMIT), false);
    int id = OS.g_signal_lookup (OS.commit, OS.gtk_im_context_get_type ());
    int mask =  OS.G_SIGNAL_MATCH_DATA | OS.G_SIGNAL_MATCH_ID;
    OS.g_signal_handlers_block_matched (imContext, mask, id, 0, 0, 0, handle);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
void hookEvents () {
  super.hookEvents();
  OS.g_signal_connect_closure (handle, OS.changed, display.getClosure (CHANGED), true);
  OS.g_signal_connect_closure (handle, OS.insert_text, display.getClosure (INSERT_TEXT), false);
  OS.g_signal_connect_closure (handle, OS.delete_text, display.getClosure (DELETE_TEXT), false);
  OS.g_signal_connect_closure (handle, OS.value_changed, display.getClosure (VALUE_CHANGED), false);
  OS.g_signal_connect_closure (handle, OS.activate, display.getClosure (ACTIVATE), false);
  OS.g_signal_connect_closure (handle, OS.populate_popup, display.getClosure (POPULATE_POPUP), false);
  int /*long*/ imContext = imContext ();
  if (imContext != 0) {
    OS.g_signal_connect_closure (imContext, OS.commit, display.getClosure (COMMIT), false);
    int id = OS.g_signal_lookup (OS.commit, OS.gtk_im_context_get_type ());
    int mask =  OS.G_SIGNAL_MATCH_DATA | OS.G_SIGNAL_MATCH_ID;
    OS.g_signal_handlers_block_matched (imContext, mask, id, 0, 0, 0, handle);
  }
}

相关文章