예제 #1
0
static void iDialogAfterShow(Ihandle* ih)
{
  Ihandle* old_focus;
  IFni show_cb;
  int show_state;

  /* process all pending messages */
  IupFlush();

  old_focus = IupGetFocus();
  show_state = ih->data->show_state;

  show_cb = (IFni)IupGetCallback(ih, "SHOW_CB");
  if (show_cb && show_cb(ih, show_state) == IUP_CLOSE)
  {
    IupExitLoop();
    return;
  }

  if (show_state == IUP_SHOW)
  {
    if (show_cb)
      IupFlush();  /* again to update focus */

    /* do it only if show_cb did NOT changed the current focus */
    if (old_focus == IupGetFocus())
    {
      Ihandle *startfocus = IupGetAttributeHandle(ih, "STARTFOCUS");
      if (startfocus)
        IupSetFocus(startfocus);
      else
        IupNextField(ih);
    }
  }
}
예제 #2
0
static Window motClipboardGetWindow(void)
{
  Ihandle* focus = IupGetFocus();
  Ihandle* dlg;
  if (!focus) return (Window)NULL;
  dlg = IupGetDialog(focus);
  if (dlg)
    return XtWindow(dlg->handle);
  else
    return (Window)NULL;
}
예제 #3
0
파일: iup_focus.c 프로젝트: Archs/iup-aio
Ihandle *IupSetFocus(Ihandle *ih)
{
  Ihandle* old_focus = IupGetFocus();

  iupASSERT(iupObjectCheck(ih));
  if (!iupObjectCheck(ih))
    return old_focus;

  /* Current focus is NOT set here, 
     only in the iupCallGetFocusCb */

  if (iupFocusCanAccept(ih))  
    iupdrvSetFocus(ih);

  return old_focus;
}
예제 #4
0
파일: iup_focus.c 프로젝트: Archs/iup-aio
void iupCallKillFocusCb(Ihandle *ih)
{
  Icallback cb;

  if (ih != IupGetFocus())  /* avoid duplicate messages */
    return;

  cb = IupGetCallback(ih, "KILLFOCUS_CB");
  if (cb) cb(ih);

  if (ih->iclass->nativetype == IUP_TYPECANVAS)
  {
    IFni cb2 = (IFni)IupGetCallback(ih, "FOCUS_CB");
    if (cb2) cb2(ih, 0);
  }

  iupSetCurrentFocus(NULL);
}
예제 #5
0
파일: iuplua_api.c 프로젝트: LuaDist/iup
static int GetFocus(lua_State *L)
{
  iuplua_pushihandle(L, IupGetFocus());
  return 1;
}
예제 #6
0
static void GetFocus(void)
{
  iuplua_pushihandle(IupGetFocus());
}