void iupMatrixExRegisterUndo(Iclass* ic)
{
  /* Already defined in IupMatrix, redefined here */
  if (!iMatrixSetUndoRedoAttrib)
    iupClassRegisterGetAttribute(ic, "UNDOREDO", NULL, &iMatrixSetUndoRedoAttrib, NULL, NULL, NULL);
  iupClassRegisterReplaceAttribFunc(ic, "UNDOREDO", NULL, iMatrixExSetUndoRedoAttrib);

  iupClassRegisterAttribute(ic, "UNDO", iMatrixGetUndoAttrib, iMatrixSetUndoAttrib, NULL, NULL, IUPAF_NO_INHERIT);
  iupClassRegisterAttribute(ic, "REDO", iMatrixGetRedoAttrib, iMatrixSetRedoAttrib, NULL, NULL, IUPAF_NO_INHERIT);
  iupClassRegisterAttribute(ic, "UNDOCLEAR", NULL, iMatrixSetUndoClearAttrib, NULL, NULL, IUPAF_WRITEONLY|IUPAF_NO_INHERIT);
  iupClassRegisterAttributeId(ic, "UNDONAME", iMatrixGetUndoNameAttrib, NULL, IUPAF_READONLY|IUPAF_NO_INHERIT);
  iupClassRegisterAttribute(ic, "UNDOCOUNT", iMatrixGetUndoCountAttrib, NULL, NULL, NULL, IUPAF_READONLY|IUPAF_NO_INHERIT);

  /* Internal attributes */
  iupClassRegisterAttributeId2(ic, "UNDOPUSHCELL", NULL, iMatrixSetUndoPushCellAttrib, IUPAF_WRITEONLY|IUPAF_NO_INHERIT);
  iupClassRegisterAttribute(ic, "UNDOPUSHBEGIN", NULL, iMatrixSetUndoPushBeginAttrib, NULL, NULL, IUPAF_WRITEONLY|IUPAF_NO_INHERIT);
  iupClassRegisterAttribute(ic, "UNDOPUSHEND", NULL, iMatrixSetUndoPushEndAttrib, NULL, NULL, IUPAF_WRITEONLY|IUPAF_NO_INHERIT);

  if (iupStrEqualNoCase(IupGetGlobal("LANGUAGE"), "ENGLISH"))
  {
    IupSetLanguageString("IUP_PASTECLIP", "Paste from Clipboard");
    IupSetLanguageString("IUP_PASTEDATA", "Paste from Buffer");
    IupSetLanguageString("IUP_PASTEFILE", "Paste from File (Import)");
    IupSetLanguageString("IUP_COPYCOLTO:ALL", "Copy To All Lines");
    IupSetLanguageString("IUP_COPYCOLTO:TOP", "Copy To Top");
    IupSetLanguageString("IUP_COPYCOLTO:BOTTOM", "Copy To Bottom");
    IupSetLanguageString("IUP_COPYCOLTO:MARKED", "Copy To Marked");
    IupSetLanguageString("IUP_COPYCOLTO:INTERVAL", "Copy To Interval");
    IupSetLanguageString("IUP_UNDONAME", "Undo");  /* To avoid conflict with the menu item string */
    IupSetLanguageString("IUP_REDONAME", "Redo");
    IupSetLanguageString("IUP_SETCELL", "Set Cell");
    IupSetLanguageString("IUP_EDITCELL", "Edit Cell");
    IupSetLanguageString("IUP_CLEARVALUE", "Clear Value");
  }
  else if (iupStrEqualNoCase(IupGetGlobal("LANGUAGE"), "PORTUGUESE"))
  {
    IupSetLanguageString("IUP_PASTECLIP", "Colar do Clipboard");
    IupSetLanguageString("IUP_PASTEDATA", "Colar de um Buffer");
    IupSetLanguageString("IUP_PASTEFILE", "Colar de Arquivo (Importar)");
    IupSetLanguageString("IUP_COPYCOLTO:ALL", "Copiar para Todas as Linhas");
    IupSetLanguageString("IUP_COPYCOLTO:TOP", "Copiar para Topo");
    IupSetLanguageString("IUP_COPYCOLTO:BOTTOM", "Copiar para fim");
    IupSetLanguageString("IUP_COPYCOLTO:MARKED", "Copiar para Selecionadas");
    IupSetLanguageString("IUP_COPYCOLTO:INTERVAL", "Copiar para Intervalo");
    IupSetLanguageString("IUP_UNDONAME", "Desfazer");
    IupSetLanguageString("IUP_REDONAME", "Refazer");
    IupSetLanguageString("IUP_SETCELL", "Modificar Célula");
    IupSetLanguageString("IUP_EDITCELL", "Editar Célula");
    IupSetLanguageString("IUP_CLEARVALUE", "Limpar Valores");

    if (IupGetInt(NULL, "UTF8MODE"))
    {
      IupSetLanguageString("IUP_SETCELL", "Modificar Célula");
      IupSetLanguageString("IUP_EDITCELL", "Editar Célula");
    }
  }
}
Example #2
0
Iclass* iupScrollBoxNewClass(void)
{
  Iclass* ic = iupClassNew(iupRegisterFindClass("canvas"));

  ic->name   = "scrollbox";
  ic->format = "h";   /* one ihandle */
  ic->nativetype = IUP_TYPECANVAS;
  ic->childtype  = IUP_CHILDMANY+1;  /* 1 child */
  ic->is_interactive = 1;

  /* Class functions */
  ic->New = iupScrollBoxNewClass;
  ic->Create  = iScrollBoxCreateMethod;

  ic->ComputeNaturalSize = iScrollBoxComputeNaturalSizeMethod;
  ic->SetChildrenCurrentSize = iScrollBoxSetChildrenCurrentSizeMethod;
  ic->SetChildrenPosition = iScrollBoxSetChildrenPositionMethod;
  ic->LayoutUpdate = iScrollBoxLayoutUpdate;

  /* Base Container */
  iupClassRegisterAttribute(ic, "EXPAND", iupBaseContainerGetExpandAttrib, NULL, IUPAF_SAMEASSYSTEM, "YES", IUPAF_NOT_MAPPED|IUPAF_NO_INHERIT);
  iupClassRegisterAttribute(ic, "CLIENTOFFSET", iupBaseGetClientOffsetAttrib, NULL, NULL, NULL, IUPAF_NOT_MAPPED|IUPAF_READONLY|IUPAF_NO_INHERIT);
  {
    IattribGetFunc drawsize_get = NULL;
    iupClassRegisterGetAttribute(ic, "DRAWSIZE", &drawsize_get, NULL, NULL, NULL, NULL);
    iupClassRegisterAttribute(ic, "CLIENTSIZE", drawsize_get, NULL, NULL, NULL, IUPAF_NOT_MAPPED|IUPAF_READONLY|IUPAF_NO_INHERIT);
  }

  /* replace IupCanvas behavior */
  iupClassRegisterReplaceAttribFunc(ic, "BGCOLOR", iupBaseNativeParentGetBgColorAttrib, NULL);
  iupClassRegisterReplaceAttribDef(ic, "BGCOLOR", "DLGBGCOLOR", NULL);
  iupClassRegisterReplaceAttribDef(ic, "BORDER", "NO", NULL);
  iupClassRegisterReplaceAttribFlags(ic, "BORDER", IUPAF_NO_INHERIT);
  iupClassRegisterReplaceAttribDef(ic, "SCROLLBAR", "YES", NULL);

  return ic;
}