version 1.74, 2006/09/15 15:17:14
|
version 1.75, 2006/09/15 16:14:07
|
Line 166 static char *createMenuString (const str
|
Line 166 static char *createMenuString (const str
|
ThotBool UseToBeCreated (NotifyElement *event) |
ThotBool UseToBeCreated (NotifyElement *event) |
{ |
{ |
#ifdef TEMPLATES |
#ifdef TEMPLATES |
Element el, parent; |
Element el; |
Document doc; |
Document doc; |
|
|
el = event->element; |
el = event->element; |
Line 295 ThotBool UseMenuClicked (NotifyElement *
|
Line 295 ThotBool UseMenuClicked (NotifyElement *
|
TtaWaitShowProcDialogue(); |
TtaWaitShowProcDialogue(); |
TtaDestroyDialogue (BaseDialog + OptionMenu); |
TtaDestroyDialogue (BaseDialog + OptionMenu); |
/* result: items[ReturnOption].label @@@@@ */ |
/* result: items[ReturnOption].label @@@@@ */ |
dec = GetDeclaration(t, items[ReturnOption].label); |
if (ReturnOption != -1) |
|
dec = GetDeclaration(t, items[ReturnOption].label); |
TtaFreeMemory (items); |
TtaFreeMemory (items); |
|
if (ReturnOption == -1) |
|
return FALSE; |
if (dec) |
if (dec) |
{ |
{ |
switch(dec->nature) |
switch(dec->nature) |
Line 333 ThotBool UseMenuClicked (NotifyElement *
|
Line 336 ThotBool UseMenuClicked (NotifyElement *
|
ThotBool OptionMenuClicked (NotifyElement *event) |
ThotBool OptionMenuClicked (NotifyElement *event) |
{ |
{ |
#ifdef TEMPLATES |
#ifdef TEMPLATES |
|
Element child, grandChild, next; |
|
ElementType elType, elType1; |
|
Document doc; |
|
XTigerTemplate t; |
|
|
|
doc = event->document; |
|
child = TtaGetFirstChild (event->element); |
|
if (!child) |
|
return FALSE; |
|
elType = TtaGetElementType (child); |
|
elType1 = TtaGetElementType (event->element); |
|
if (elType.ElTypeNum != Template_EL_useEl || |
|
elType.ElSSchema != elType1.ElSSchema) |
|
return FALSE; |
|
grandChild = TtaGetFirstChild (child); |
|
if (!grandChild) |
|
/* the "use" element is empty. Instanciate it */ |
|
{ |
|
t = (XTigerTemplate) Get(templates, DocumentMeta[doc]->template_url); |
|
if (!t) |
|
return FALSE; // no template ?!?! |
|
InstanciateUse (t, child, doc, TRUE); |
|
} |
|
else |
|
/* remove the content of the "use" element */ |
|
{ |
|
do |
|
{ |
|
next = grandChild; |
|
TtaNextSibling (&next); |
|
TtaDeleteTree (grandChild, doc); |
|
grandChild = next; |
|
} |
|
while (next); |
|
} |
return FALSE; |
return FALSE; |
#endif /* TEMPLATES */ |
#endif /* TEMPLATES */ |
return TRUE; |
return TRUE; |