version 1.21, 2007/01/31 11:58:12
|
version 1.22, 2007/01/31 15:30:21
|
Line 453 Element InstantiateUse (XTigerTemplate t
|
Line 453 Element InstantiateUse (XTigerTemplate t
|
} |
} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
|
InstantiateRepeat |
|
Check for min and max param and validate xt:repeat element content. |
|
@param registerUndo True to register undo creation sequences. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
void InstantiateRepeat (XTigerTemplate t, Element el, Document doc) |
void InstantiateRepeat (XTigerTemplate t, Element el, Document doc, ThotBool registerUndo) |
{ |
{ |
#ifdef TEMPLATES |
#ifdef TEMPLATES |
int curVal, minVal, maxVal; |
int curVal, minVal, maxVal; |
Line 532 void InstantiateRepeat (XTigerTemplate t
|
Line 535 void InstantiateRepeat (XTigerTemplate t
|
sprintf(text,"%d",minVal); |
sprintf(text,"%d",minVal); |
TtaAttachAttribute(el, minAtt, doc); |
TtaAttachAttribute(el, minAtt, doc); |
TtaSetAttributeText(minAtt, text, el, doc); |
TtaSetAttributeText(minAtt, text, el, doc); |
|
if(registerUndo) |
|
TtaRegisterAttributeCreate(minAtt, el, doc); |
} |
} |
|
|
if (!maxAtt) |
if (!maxAtt) |
Line 543 void InstantiateRepeat (XTigerTemplate t
|
Line 548 void InstantiateRepeat (XTigerTemplate t
|
sprintf(text,"*"); |
sprintf(text,"*"); |
TtaAttachAttribute(el, maxAtt, doc); |
TtaAttachAttribute(el, maxAtt, doc); |
TtaSetAttributeText(maxAtt, text, el, doc); |
TtaSetAttributeText(maxAtt, text, el, doc); |
|
if(registerUndo) |
|
TtaRegisterAttributeCreate(maxAtt, el, doc); |
} |
} |
|
|
if (!curAtt) |
if (!curAtt) |
Line 551 void InstantiateRepeat (XTigerTemplate t
|
Line 558 void InstantiateRepeat (XTigerTemplate t
|
sprintf(text,"%d",curVal); |
sprintf(text,"%d",curVal); |
TtaAttachAttribute(el, curAtt, doc); |
TtaAttachAttribute(el, curAtt, doc); |
TtaSetAttributeText(curAtt, text, el, doc); |
TtaSetAttributeText(curAtt, text, el, doc); |
|
if(registerUndo) |
|
TtaRegisterAttributeCreate(curAtt, el, doc); |
} |
} |
|
|
if (text) |
if (text) |
Line 582 void InstantiateRepeat (XTigerTemplate t
|
Line 591 void InstantiateRepeat (XTigerTemplate t
|
//Create a new child |
//Create a new child |
newChild = TtaCopyTree(child, doc, doc, el); |
newChild = TtaCopyTree(child, doc, doc, el); |
TtaInsertSibling(newChild, child, FALSE, doc); |
TtaInsertSibling(newChild, child, FALSE, doc); |
|
if(registerUndo) |
|
TtaRegisterElementCreate(newChild, doc); |
child = newChild; |
child = newChild; |
childrenCount++; |
childrenCount++; |
} |
} |
Line 657 static void ParseTemplate (XTigerTemplat
|
Line 668 static void ParseTemplate (XTigerTemplat
|
InstantiateAttribute (t, el, doc); |
InstantiateAttribute (t, el, doc); |
break; |
break; |
case Template_EL_repeat : |
case Template_EL_repeat : |
InstantiateRepeat (t, el, doc); |
InstantiateRepeat (t, el, doc, FALSE); |
break; |
break; |
default : |
default : |
break; |
break; |