- From: web2 <soft@earthlink.net>
- Date: Wed, 25 Feb 1998 18:58:35 -0800
- To: Irene.Vatton@imag.fr
- CC: www-amaya@w3.org
Irene, I implemented your design below and it works fine except the text input fields and submit buttons do not work. Essentially, what is happening is that when a text input field is selected the field is highlighted but CheckType is never invoked. CheckType is invoked when I press the enter key but typing text has no effect. By the way the enter key causes a newline to be inserted into the TEXT_UNIT preceding the Text_Input element. The Editor documentation says that the return from the callback for ElemTextModify.Pre is ignored, unlike most of the other .Pre events, is that part of the problem. I know this is a vague question but can you give a hint as to where to look for what's wrong? Also note that I have removed all the menu items and buttons that allow the document to be edited. Could this cause a problem? Gary Beauregard soft@earthlink.net Irene VATTON wrote: > Sorry, I forgot the cc option. This is my answer: > > Yes, there is a solution. Instead of using TtaSetDocumentAccessMode(doc,0), > you have to trap all > modification in the document and let Thot performs only those which concern > form fields. > > It's easy to do that: > a) In HTML.A you remove all events ElemNew, ElemPaste, ElemDelete, > ElemTextModify, > ElemChange. > b) In HTML.A you add in DEFAULT section > ElemNew.Pre -> NoEdit; > ElemPaste.Pre -> NoEdit; > ElemDelete.Pre -> NoEdit; > ElemTextModify.Pre -> CheckType; > ElemChange.Pre -> CheckType; > > c) In HTMLactions.c you write the functions > /*---------------------------------------------------------------------- > -----------------------------------------------------------------------*/ > #ifdef __STDC__ > boolean NoEdit (NotifyElement *event) > #else /* __STDC__*/ > boolean NoEdit(event) > NotifyElement *event; > #endif /* __STDC__*/ > { > return TRUE; /* don't let Thot perform normal operation */ > } > > /*---------------------------------------------------------------------- > -----------------------------------------------------------------------*/ > #ifdef __STDC__ > boolean CheckType (NotifyElement *event) > #else /* __STDC__*/ > boolean CheckType (event) > NotifyElement *event; > #endif /* __STDC__*/ > { > elType = TtaGetElementType (event->element); > elType.ElTypeNum = HTML_EL_Form; > elFound = TtaGetTypedAncestor (event->element, elType); > if (elFound != NULL) > return FALSE; /* let Thot perform normal operation */ > else > return TRUE; /* don't let Thot perform normal operation */ > }
Received on Wednesday, 25 February 1998 22:00:16 UTC