Exemplo n.º 1
0
Arquivo: iup_key.c Projeto: defdef/iup
int iupKeyProcessMnemonic(Ihandle* ih, int code)
{
  Ihandle *ih_mnemonic, *dialog = IupGetDialog(ih);
  char attrib[16] = "_IUP_MNEMONIC_ ";
  attrib[14] = (char)code;
  iupStrUpper(attrib, attrib);
  ih_mnemonic = (Ihandle*)IupGetAttribute(dialog, attrib);
  if (iupObjectCheck(ih_mnemonic))
  {
    if (IupClassMatch(ih_mnemonic, "label"))
    {
      Ihandle* ih_next = iupFocusNextInteractive(ih_mnemonic);
      if (ih_next)
      {
        if (IupClassMatch(ih_next, "button") || IupClassMatch(ih_next, "toggle"))
          iupdrvActivate(ih_next);
        else
          IupSetFocus(ih_next);
      }
    }
    else if (IupClassMatch(ih_mnemonic, "tabs"))
      IupSetAttribute(ih_mnemonic, "VALUEPOS", IupGetAttribute(ih_mnemonic, attrib));
    else if (ih_mnemonic->handle)  /* button or toggle */
      iupdrvActivate(ih_mnemonic);

    return 1;
  }

  return 0;
}
Exemplo n.º 2
0
static int iScintillaSetSearchFlagsAttrib(Ihandle* ih, const char* value)
{
  if (!value)
    IupScintillaSendMessage(ih, SCI_SETSEARCHFLAGS, 0, 0);
  else
  {
    int flags = 0;
    char* VALUE = iupStrDup(value);
    iupStrUpper(VALUE, VALUE);

    if (strstr(VALUE, "MATCHCASE"))
      flags |= SCFIND_MATCHCASE;
    if (strstr(VALUE, "WHOLEWORD"))
      flags |= SCFIND_WHOLEWORD;
    if (strstr(VALUE, "WORDSTART"))
      flags |= SCFIND_WORDSTART;
    if (strstr(VALUE, "REGEXP"))
      flags |= SCFIND_REGEXP;
    if (strstr(VALUE, "POSIX"))
      flags |= SCFIND_POSIX;

    IupScintillaSendMessage(ih, SCI_SETSEARCHFLAGS, flags, 0);
    free(VALUE);
  }

  return 0;
}
Exemplo n.º 3
0
Arquivo: iup_key.c Projeto: defdef/iup
void iupKeySetMnemonic(Ihandle* ih, int code, int pos)
{
  Ihandle* ih_dialog = IupGetDialog(ih);
  char attrib[16] = "_IUP_MNEMONIC_ ";
  attrib[14] = (char)code;
  iupStrUpper(attrib, attrib);

  IupSetAttribute(ih_dialog, attrib, (char*)ih);
  if (IupClassMatch(ih, "tabs"))
    IupSetInt(ih, attrib, pos);
}