version 1.225, 2008/11/25 09:21:08
|
version 1.226, 2008/12/02 16:55:34
|
Line 915 ThotBool BagButtonClicked (NotifyElement
|
Line 915 ThotBool BagButtonClicked (NotifyElement
|
listtypes = Template_GetListTypes (t, bagEl); |
listtypes = Template_GetListTypes (t, bagEl); |
if (listtypes) |
if (listtypes) |
{ |
{ |
#ifdef TEMPLATE_DEBUG |
|
printf("BagButtonClicked : \n > %s\n", listtypes); |
|
// { |
|
// DLList list = DLList_Create(); |
|
// FillInsertableElemList (doc, TtaGetFirstChild(bagEl), list); |
|
// DLListNode node; |
|
// ForwardIterator iter = DLList_GetForwardIterator(list); |
|
// ITERATOR_FOREACH(iter, DLListNode, node) |
|
// { |
|
// ElemListElement elem = (ElemListElement)node->elem; |
|
// printf(" + %s\n", ElemListElement_GetName(elem)); |
|
// } |
|
// DLList_Destroy(list); |
|
// } |
|
#endif /* TEMPLATE_DEBUG */ |
|
result = QueryStringFromMenu (doc, listtypes); |
result = QueryStringFromMenu (doc, listtypes); |
TtaFreeMemory (listtypes); |
TtaFreeMemory (listtypes); |
if (result) |
if (result) |
Line 946 ThotBool BagButtonClicked (NotifyElement
|
Line 931 ThotBool BagButtonClicked (NotifyElement
|
/* Prepare insertion.*/ |
/* Prepare insertion.*/ |
oldStructureChecking = TtaGetStructureChecking (doc); |
oldStructureChecking = TtaGetStructureChecking (doc); |
TtaSetStructureChecking (FALSE, doc); |
TtaSetStructureChecking (FALSE, doc); |
TtaOpenUndoSequence (doc, NULL, NULL, 0, 0); |
|
|
|
/* Insert */ |
/* Insert */ |
if (el == bagEl) |
newEl = Template_InsertBagChild (doc, el, bagEl, decl, FALSE); |
{ |
|
el = TtaGetFirstChild (el); |
|
TtaSelectElement (doc, el); |
|
TtaInsertAnyElement (doc, TRUE); |
|
} |
|
else |
|
{ |
|
TtaSelectElement (doc, el); |
|
TtaInsertAnyElement (doc, FALSE); |
|
} |
|
newEl = Template_InsertBagChild (doc, bagEl, decl, FALSE); |
|
|
|
/* Finish insertion.*/ |
/* Finish insertion.*/ |
TtaCloseUndoSequence (doc); |
|
TtaSetDocumentModified (doc); |
TtaSetDocumentModified (doc); |
TtaSetStructureChecking (oldStructureChecking, doc); |
TtaSetStructureChecking (oldStructureChecking, doc); |
// restore the display |
// restore the display |
Line 1108 ThotBool RepeatButtonClicked (NotifyElem
|
Line 1080 ThotBool RepeatButtonClicked (NotifyElem
|
|
|
} |
} |
else /* if (Template_CanInsertRepeatChild(repeatEl)) */ |
else /* if (Template_CanInsertRepeatChild(repeatEl)) */ |
{ |
TtaSetStatus(doc, view, TtaGetMessage (AMAYA, AM_NUMBER_OCCUR_HAVE_MAX), NULL); |
TtaSetStatus(doc, view, TtaGetMessage (AMAYA, AM_NUMBER_OCCUR_HAVE_MAX), NULL); |
|
} |
|
} |
} |
return TRUE; /* don't let Thot perform normal operation */ |
return TRUE; /* don't let Thot perform normal operation */ |
#endif /* TEMPLATES */ |
#endif /* TEMPLATES */ |
Line 1128 ThotBool UseButtonClicked (NotifyElement
|
Line 1098 ThotBool UseButtonClicked (NotifyElement
|
Element el = event->element; |
Element el = event->element; |
Element child; |
Element child; |
ElementType elType, childType; |
ElementType elType, childType; |
|
View view; |
XTigerTemplate t; |
XTigerTemplate t; |
Declaration decl; |
Declaration decl; |
Element firstEl; |
Element firstEl, newEl = NULL; |
Element newEl = NULL; |
char *types, *listtypes = NULL, *result = NULL; |
char* types; |
|
ThotBool oldStructureChecking; |
ThotBool oldStructureChecking; |
View view; |
|
char* listtypes = NULL; |
|
char* result = NULL; |
|
|
|
if (!TtaGetDocumentAccessMode (doc)) |
if (!TtaGetDocumentAccessMode (doc)) |
return TRUE; |
return TRUE; |
Line 1213 ThotBool UseButtonClicked (NotifyElement
|
Line 1180 ThotBool UseButtonClicked (NotifyElement
|
} |
} |
} |
} |
} |
} |
TtaFreeMemory(types); |
TtaFreeMemory (types); |
TtaFreeMemory(listtypes); |
TtaFreeMemory (listtypes); |
TtaFreeMemory(result); |
TtaFreeMemory (result); |
} |
} |
|
|
return TRUE; |
return TRUE; |