Change from element qualities

Top  Previous  Next

/* Change from element qualities */

/ * =================================*/

#include "database.h"

 

long int to EXPORTENTRY EigenschaftenAendern (int argc, char *argv [], PROOT root)

{

PPLANS flat;

POBJECT obj;

PELEMENT el;

PSTRING_ELEMENT string;

STRING_SETTINGS strSet;

PTEXT_ELEMENT text;

TEXT_SETTINGS tSet;

PSYMBOL_ELEMENT symbol;

SYMBOL_SETTINGS sySet;

T_PPOINT point;

POINT_SETTINGS pSet;

int pointertyp;

 

flat = DBgetOpenPlan (root);

if (! flat) {

IOwprintf (DBgetIOpipes (root), "no plan geöffnet\n", strSet.zeichenschluessel);

}

obj = DBgetOpenObject (root);

if (! obj) {

obj = DBfirstObjectOfPlan (flat);

}

if (! obj) {

IOwprintf (DBgetIOpipes (root), "plan has no Objekte\n",

strSet.zeichenschluessel);

return 1;

}

 

el = DBgetOpenElement (root);

if (! el) {

el = DBfirstElementOfObject (obj);

}

if (! el) {

IOwprintf (DBgetIOpipes (root), "object has no Elemente\n",

strSet.zeichenschluessel);

return 1;

}

pointertyp = DBreturnPointerTyp (el);

switch (pointertyp) {

case TYP_STRING_ELEMENT:

DBreturnStringSettings (el, &strSet, 1);

strSet.zeichenschluessel = 12;

DBmodifyStringSettings (el, STRING_MODIFY_ZEICHENSCHLUESSEL, &strSet, 1);

IOwprintf (DBgetIOpipes (root), "DKY changed in %d\n", strSet.zeichenschluessel);

break;

case TYP_TEXT_ELEMENT:

DBreturnTextSettings (el, &tSet, 1);

tSet.zeichenschluessel = 15;

DBmodifyTextSettings (el, TEXT_MODIFY_ZEICHENSCHLUESSEL, &tSet, 1);

IOwprintf (DBgetIOpipes (root), "DKY changed in %d\n", tSet.zeichenschluessel);

break;

case TYP_SYMBOL_ELEMENT:

DBreturnSymbolSettings (el, &sySet, 1);

sySet.symbol = 103;

DBmodifySymbolSettings (el, SYMBOL_MODIFY_SYMBOL, &sySet, 1);

IOwprintf (DBgetIOpipes (root), "number changed in %d\n", sySet.symbol);

break;

default:

IOwprintf (DBgetIOpipes (root), the "first element is nobody graphic element\n");

}

return 0;

}

 

/*---------------------------------------------------------------------------*/