From fa78792e3b1ca5948a69d5e34783e636edf118d5 Mon Sep 17 00:00:00 2001 From: dmcoles Date: Tue, 23 Jul 2024 17:57:26 +0100 Subject: [PATCH] ensure undo point and code refresh are run after editing non-window related items (requesters, arexx) add parameterised options for requester title text, gadgets text and body text --- cSourceGen.e | 31 ++++++++++++--- eSourceGen.e | 29 +++++++++++--- rebuild.e | 6 +-- requesterObject.e | 96 +++++++++++++++++++++++++++++++++++++++++++---- windowObject.e | 2 +- 5 files changed, 141 insertions(+), 23 deletions(-) diff --git a/cSourceGen.e b/cSourceGen.e index 07d0ece..3ad818a 100644 --- a/cSourceGen.e +++ b/cSourceGen.e @@ -488,8 +488,21 @@ PROC genHeader(screenObject:PTR TO screenObject,rexxObject:PTR TO rexxObject, re ENDIF FOR i:=0 TO requesterObject.requesterItems.count()-1 - reqItem:=requesterObject.requesterItems.item(i) - StringF(tempStr,'int requester\d(Object *reactionWindow)\n',i) + reqItem:=requesterObject.requesterItems.item(i) + StringF(tempStr,'int requester\d(Object *reactionWindow',reqItem.id) + IF reqItem.titleParam + StrAdd(tempStr,',STRPTR titleText') + ENDIF + + IF reqItem.gadgetsParam + StrAdd(tempStr,',STRPTR gadgetsText') + ENDIF + + IF reqItem.bodyParam + StrAdd(tempStr,',STRPTR bodyText') + ENDIF + StrAdd(tempStr,')') + self.writeLine(tempStr) self.writeLine('{') self.writeLine(' Object *reqobj;') @@ -499,12 +512,18 @@ PROC genHeader(screenObject:PTR TO screenObject,rexxObject:PTR TO rexxObject, re self.writeLine(' GetAttr(WINDOW_Window, reactionWindow, &win);') bodyText:=reqItem.bodyText.makeTextString('\\n') - StringF(tempStr,' reqobj = NewObject(REQUESTER_GetClass(), NULL, REQ_Type, \s, REQ_Image, \s, REQ_TitleText, \q\s\q, REQ_BodyText,\q\s\q, REQ_GadgetText, \q\s\q, TAG_DONE);', + StringF(tempStr,' reqobj = NewObject(REQUESTER_GetClass(), NULL, REQ_Type, \s, REQ_Image, \s, REQ_TitleText, \s\s\s, REQ_BodyText,\s\s\s, REQ_GadgetText, \s\s\s, TAG_DONE);', ListItem(['REQTYPE_INFO','REQTYPE_INTEGER','REQTYPE_STRING'],reqItem.reqType), ListItem(['REQIMAGE_DEFAULT', 'REQIMAGE_INFO', 'REQIMAGE_WARNING', 'REQIMAGE_ERROR', 'REQIMAGE_QUESTION', 'REQIMAGE_INSERTDISK'],reqItem.image), - reqItem.titleText, - bodyText, - reqItem.gadgetsText) + IF reqItem.titleParam THEN '' ELSE '\q', + IF reqItem.titleParam THEN 'titleText' ELSE reqItem.titleText, + IF reqItem.titleParam THEN '' ELSE '\q', + IF reqItem.bodyParam THEN '' ELSE '\q', + IF reqItem.bodyParam THEN 'bodyText' ELSE bodyText, + IF reqItem.bodyParam THEN '' ELSE '\q', + IF reqItem.gadgetsParam THEN '' ELSE '\q', + IF reqItem.gadgetsParam THEN 'gadgetsText' ELSE reqItem.gadgetsText, + IF reqItem.gadgetsParam THEN '' ELSE '\q') DisposeLink(bodyText) self.writeLine(tempStr) self.writeLine(' if (reqobj)') diff --git a/eSourceGen.e b/eSourceGen.e index 84cd719..d54a115 100644 --- a/eSourceGen.e +++ b/eSourceGen.e @@ -619,7 +619,20 @@ PROC genHeader(screenObject:PTR TO screenObject,rexxObject:PTR TO rexxObject, re self.writeLine('') FOR i:=0 TO requesterObject.requesterItems.count()-1 reqItem:=requesterObject.requesterItems.item(i) - StringF(tempStr,'PROC requester\d(reactionWindow)\n',i) + StringF(tempStr,'PROC requester\d(reactionWindow',reqItem.id) + IF reqItem.titleParam + StrAdd(tempStr,',titleText') + ENDIF + + IF reqItem.gadgetsParam + StrAdd(tempStr,',gadgetsText') + ENDIF + + IF reqItem.bodyParam + StrAdd(tempStr,',bodyText') + ENDIF + StrAdd(tempStr,')') + self.writeLine(tempStr) self.writeLine(' DEF reqmsg:PTR TO orrequest') self.writeLine(' DEF reqobj,win,res=0') @@ -630,12 +643,18 @@ PROC genHeader(screenObject:PTR TO screenObject,rexxObject:PTR TO rexxObject, re self.writeLine(' reqmsg.methodid:=RM_OPENREQ') self.writeLine(' reqmsg.window:=win') bodyText:=reqItem.bodyText.makeTextString('\\n') - StringF(tempStr,' reqmsg.attrs:=[REQ_TYPE, \s, REQ_IMAGE, \s, REQ_TITLETEXT,\a\s\a,REQ_BODYTEXT,\a\s\a,REQ_GADGETTEXT,\a\s\a,TAG_END]', + StringF(tempStr,' reqmsg.attrs:=[REQ_TYPE, \s, REQ_IMAGE, \s, REQ_TITLETEXT,\s\s\s,REQ_BODYTEXT,\s\s\s,REQ_GADGETTEXT,\s\s\s,TAG_END]', ListItem(['REQTYPE_INFO','REQTYPE_INTEGER','REQTYPE_STRING'],reqItem.reqType), ListItem(['REQIMAGE_DEFAULT', 'REQIMAGE_INFO', 'REQIMAGE_WARNING', 'REQIMAGE_ERROR', 'REQIMAGE_QUESTION', 'REQIMAGE_INSERTDISK'],reqItem.image), - reqItem.titleText, - bodyText, - reqItem.gadgetsText) + IF reqItem.titleParam THEN '' ELSE '\a', + IF reqItem.titleParam THEN 'titleText' ELSE reqItem.titleText, + IF reqItem.titleParam THEN '' ELSE '\a', + IF reqItem.bodyParam THEN '' ELSE '\a', + IF reqItem.bodyParam THEN 'bodyText' ELSE bodyText, + IF reqItem.bodyParam THEN '' ELSE '\a', + IF reqItem.gadgetsParam THEN '' ELSE '\a', + IF reqItem.gadgetsParam THEN 'gadgetsText' ELSE reqItem.gadgetsText, + IF reqItem.gadgetsParam THEN '' ELSE '\a') DisposeLink(bodyText) self.writeLine(tempStr) self.writeLine(' reqobj:=NewObjectA(Requester_GetClass(),0,[TAG_END])') diff --git a/rebuild.e b/rebuild.e index afc8fce..33dacb3 100644 --- a/rebuild.e +++ b/rebuild.e @@ -2419,9 +2419,9 @@ PROC doEdit() selectedComp.createPreviewObject(win.wscreen) ENDIF rethinkPreviews() - addUndo() - genCodePreview() ENDIF + addUndo() + genCodePreview() ENDIF clearBusy() @@ -3105,7 +3105,7 @@ PROC restorePreviews() WHILE (i