diff --git a/Rebuild_manual.txt b/Rebuild_manual.txt index 5a9f347..5c8309d 100644 --- a/Rebuild_manual.txt +++ b/Rebuild_manual.txt @@ -279,7 +279,12 @@ struct Library *WindowBase = NULL, *IconBase = NULL; struct IntuitionBase *IntuitionBase = NULL; -//Window_3 +//window ids +//this enumeration will contain all of the window ids contained in the +//rebuild project. +enum win { window_3_id = 3 }; + +//Window_3 gadgets //this enumeration should be used to access the main_gadgets array. the names //of the enumerations have the reaction gadget id's on the end so these names //will never change even if the design is update (eg another gadget added). @@ -487,8 +492,9 @@ void window_3( void ) main_gadgets[6] = 0; //call the code to display the window - //the window id is 3 and it has no menu structure. - runWindow( window_object, 3, 0, main_gadgets ); + //the window id is window_3_id from the window ids enumeration and + //it has no menu structure. + runWindow( window_object, window_3_id, 0, main_gadgets ); if ( window_object ) DisposeObject( window_object ); } @@ -502,6 +508,193 @@ int main( int argc, char **argv ) cleanup(); } +Here is the same example GUI design in E + +OPT OSVERSION=37 + + MODULE 'reaction/reaction_macros', + 'reaction/reaction_lib', + 'window','classes/window', + 'gadgets/layout','layout', + 'libraries/gadtools','gadtools', + 'icon', + 'button','gadgets/button', + 'string','gadgets/string', + 'label','images/label', + 'images/bevel', + 'amigalib/boopsi', + 'exec', + 'intuition/intuition', + 'intuition/imageclass', + 'intuition/screens', + 'intuition/gadgetclass' + + +->window ids +ENUM WINLOGON_ID = 3 + +->winLogon gadgets +ENUM LAYOUT_5, STRING_6, STRING_7, LAYOUT_8, BUTTON_9, BUTTON_10 +ENUM LAYOUT_5_ID = 5, STRING_6_ID = 6, STRING_7_ID = 7, LAYOUT_8_ID = 8, + BUTTON_9_ID = 9, BUTTON_10_ID = 10 + +DEF gScreen=0,gVisInfo=0,gDrawInfo=0,gAppPort=0 + +PROC setup() + IF (windowbase:=OpenLibrary('window.class',0))=NIL THEN Throw("LIB","win") + IF (layoutbase:=OpenLibrary('gadgets/layout.gadget',0))=NIL THEN Throw("LIB","layo") + IF (gadtoolsbase:=OpenLibrary('gadtools.library',0))=NIL THEN Throw("LIB","gadt") + IF (iconbase:=OpenLibrary('icon.library',0))=NIL THEN Throw("LIB","icon") + IF (buttonbase:=OpenLibrary('gadgets/button.gadget',0))=NIL THEN Throw("LIB","btn") + IF (stringbase:=OpenLibrary('gadgets/string.gadget',0))=NIL THEN Throw("LIB","strn") + IF (labelbase:=OpenLibrary('images/label.image',0))=NIL THEN Throw("LIB","labl") + IF (gScreen:=LockPubScreen(NIL))=NIL THEN Raise("pub") + IF (gVisInfo:=GetVisualInfoA(gScreen, [TAG_END]))=NIL THEN Raise("visi") + IF (gDrawInfo:=GetScreenDrawInfo(gScreen))=NIL THEN Raise("dinf") + IF (gAppPort:=CreateMsgPort())=NIL THEN Raise("port") +ENDPROC + +PROC cleanup() + IF gVisInfo THEN FreeVisualInfo(gVisInfo) + IF gDrawInfo THEN FreeScreenDrawInfo(gScreen,gDrawInfo) + IF gAppPort THEN DeleteMsgPort(gAppPort) + IF gScreen THEN UnlockPubScreen(NIL,gScreen) + + IF gadtoolsbase THEN CloseLibrary(gadtoolsbase) + IF iconbase THEN CloseLibrary(iconbase) + IF windowbase THEN CloseLibrary(windowbase) + IF layoutbase THEN CloseLibrary(layoutbase) + IF buttonbase THEN CloseLibrary(buttonbase) + IF stringbase THEN CloseLibrary(stringbase) + IF labelbase THEN CloseLibrary(labelbase) +ENDPROC + +PROC runWindow(windowObject,windowId, menuStrip, winGadgets:PTR TO LONG) HANDLE + DEF running=TRUE + DEF win:PTR TO window,wsig,code,msg,sig,result + + IF (win:=RA_OpenWindow(windowObject)) + GetAttr( WINDOW_SIGMASK, windowObject, {wsig} ) + IF menuStrip THEN SetMenuStrip( win, menuStrip ) + + WHILE running + sig:=Wait(wsig) + IF (sig AND (wsig)) + WHILE ((result:=RA_HandleInput(windowObject,{code}+2)) <> WMHI_LASTMSG) + msg:=(result AND WMHI_CLASSMASK) + SELECT msg + CASE WMHI_CLOSEWINDOW + running:=FALSE + CASE WMHI_GADGETUP + WriteF('gadget press\n') + CASE WMHI_MENUPICK + WriteF('menu pick\n') + CASE WMHI_ICONIFY + RA_Iconify(windowObject) + CASE WMHI_UNICONIFY + win:=RA_OpenWindow(windowObject) + IF menuStrip THEN SetMenuStrip( win, menuStrip ) + ENDSELECT + ENDWHILE + ENDIF + ENDWHILE + ENDIF +EXCEPT DO + RA_CloseWindow(windowObject) +ENDPROC + +PROC winlogon() HANDLE + DEF windowObject + DEF mainGadgets[7]:ARRAY OF LONG + + + windowObject:=WindowObject, + WA_TITLE, 'Please log in...', + WA_LEFT, 5, + WA_TOP, 20, + WA_WIDTH, 250, + WA_HEIGHT, 80, + WA_MINWIDTH, 150, + WA_MINHEIGHT, 80, + WA_MAXWIDTH, 8192, + WA_MAXHEIGHT, 8192, + WINDOW_APPPORT, gAppPort, + WA_CLOSEGADGET, TRUE, + WA_DEPTHGADGET, TRUE, + WA_SIZEGADGET, TRUE, + WA_DRAGBAR, TRUE, + WINDOW_POSITION, WPOS_CENTERSCREEN, + WINDOW_ICONTITLE, 'MyApp', + WA_NOCAREREFRESH, TRUE, + WA_IDCMP, IDCMP_GADGETDOWN OR IDCMP_GADGETUP OR IDCMP_CLOSEWINDOW, + WINDOW_PARENTGROUP, VLayoutObject, + LAYOUT_SPACEOUTER, TRUE, + LAYOUT_DEFERLAYOUT, TRUE, + LAYOUT_ADDCHILD, mainGadgets[LAYOUT_5]:=LayoutObject, + GA_ID, LAYOUT_5_ID, + LAYOUT_ORIENTATION, LAYOUT_ORIENT_VERT, + LAYOUT_ADDCHILD, mainGadgets[STRING_6]:=StringObject, + GA_ID, STRING_6_ID, + GA_RELVERIFY, TRUE, + GA_TABCYCLE, TRUE, + STRINGA_MAXCHARS, 80, + StringEnd, + CHILD_LABEL, LabelObject, + LABEL_TEXT, 'User name', + LabelEnd, + LAYOUT_ADDCHILD, mainGadgets[STRING_7]:=StringObject, + GA_ID, STRING_7_ID, + GA_RELVERIFY, TRUE, + GA_TABCYCLE, TRUE, + STRINGA_MAXCHARS, 80, + StringEnd, + CHILD_LABEL, LabelObject, + LABEL_TEXT, 'Password', + LabelEnd, + LAYOUT_ADDCHILD, mainGadgets[LAYOUT_8]:=LayoutObject, + GA_ID, LAYOUT_8_ID, + LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ, + LAYOUT_ADDCHILD, mainGadgets[BUTTON_9]:=ButtonObject, + GA_ID, BUTTON_9_ID, + GA_TEXT, 'OK', + GA_RELVERIFY, TRUE, + GA_TABCYCLE, TRUE, + BUTTON_TEXTPEN, 1, + BUTTON_BACKGROUNDPEN, 0, + BUTTON_FILLTEXTPEN, 1, + BUTTON_FILLPEN, 3, + ButtonEnd, + LAYOUT_ADDCHILD, mainGadgets[BUTTON_10]:=ButtonObject, + GA_ID, BUTTON_10_ID, + GA_TEXT, 'Cancel', + GA_RELVERIFY, TRUE, + GA_TABCYCLE, TRUE, + BUTTON_TEXTPEN, 1, + BUTTON_BACKGROUNDPEN, 0, + BUTTON_FILLTEXTPEN, 1, + BUTTON_FILLPEN, 3, + ButtonEnd, + LayoutEnd, + LayoutEnd, + LayoutEnd, + WindowEnd + mainGadgets[6]:=0 + + runWindow(windowObject,WINLOGON_ID,NIL,mainGadgets) + +EXCEPT DO + IF windowObject THEN DisposeObject(windowObject); +ENDPROC + +PROC main() HANDLE + setup() + + winlogon() + +EXCEPT DO + cleanup() +ENDPROC + 8. Tooltype settings diff --git a/cSourceGen.e b/cSourceGen.e index e38ee67..a7664ac 100644 --- a/cSourceGen.e +++ b/cSourceGen.e @@ -8,6 +8,8 @@ OPT MODULE,LARGE EXPORT OBJECT cSrcGen OF srcGen ENDOBJECT +ENUM ENUM_IDS, ENUM_IDENTS, ENUM_IDXS + PROC create(fser:PTR TO fileStreamer, libsused:PTR TO CHAR,definitionOnly,useIds) OF cSrcGen SUPER self.create(fser,libsused,definitionOnly,useIds) self.type:=CSOURCE_GEN @@ -20,17 +22,21 @@ PROC create(fser:PTR TO fileStreamer, libsused:PTR TO CHAR,definitionOnly,useIds self.indent:=0 ENDPROC -PROC createEnum(windowName:PTR TO CHAR, listObjects:PTR TO stdlist, ids) OF cSrcGen +PROC createEnum(enumName:PTR TO CHAR, listObjects:PTR TO stdlist, enumType) OF cSrcGen DEF n=0, j DEF listObject:PTR TO reactionObject DEF tempStr[255]:STRING self.write('enum ') - IF ids - StringF(tempStr,'\s_id { ',windowName) - ELSE - StringF(tempStr,'\s_idx { ',windowName) - ENDIF + SELECT enumType + CASE ENUM_IDS + StringF(tempStr,'\s_id { ',enumName) + CASE ENUM_IDXS + StringF(tempStr,'\s_idx { ',enumName) + CASE ENUM_IDENTS + StringF(tempStr,'\s { ',enumName) + ENDSELECT + LowerStr(tempStr) self.write(tempStr) n:=0 @@ -47,12 +53,13 @@ PROC createEnum(windowName:PTR TO CHAR, listObjects:PTR TO stdlist, ids) OF cSrc ENDIF listObject:=listObjects.item(j) listObject.gadindex:=j + StrCopy(tempStr,listObject.ident) LowerStr(tempStr) self.write(tempStr) n:=n+StrLen(tempStr) - IF ids + IF (enumType=ENUM_IDS) OR (enumType=ENUM_IDENTS) StringF(tempStr,'_id = \d',listObject.id) self.write(tempStr) n:=n+StrLen(tempStr) @@ -62,13 +69,14 @@ PROC createEnum(windowName:PTR TO CHAR, listObjects:PTR TO stdlist, ids) OF cSrc self.writeLine(' };') ENDPROC -PROC genHeader(screenObject:PTR TO screenObject,rexxObject:PTR TO rexxObject, windowNames:PTR TO stringlist, windowLayouts:PTR TO stdlist, sharedPort) OF cSrcGen +PROC genHeader(screenObject:PTR TO screenObject,rexxObject:PTR TO rexxObject, windowItems:PTR TO stdlist, windowLayouts:PTR TO stdlist, sharedPort) OF cSrcGen DEF tempStr[200]:STRING DEF menuItem:PTR TO menuItem DEF itemName[200]:STRING DEF commKey[10]:STRING DEF itemType DEF hasarexx,i,j,n + DEF windowObject:PTR TO reactionObject DEF layoutObject:PTR TO reactionObject DEF listObjects:PTR TO stdlist DEF listObject:PTR TO reactionObject @@ -181,8 +189,9 @@ PROC genHeader(screenObject:PTR TO screenObject,rexxObject:PTR TO rexxObject, wi self.writeLine('') ENDIF - FOR i:=0 TO windowNames.count()-1 - StrCopy(tempStr,windowNames.item(i)) + FOR i:=0 TO windowItems.count()-1 + windowObject:=windowItems.item(i) + StrCopy(tempStr,windowObject.ident) LowerStr(tempStr) self.write('void ') self.write(tempStr) @@ -533,14 +542,24 @@ PROC genHeader(screenObject:PTR TO screenObject,rexxObject:PTR TO rexxObject, wi NEW listObjects.stdlist(20) self.writeLine('') - FOR i:=0 TO windowNames.count()-1 + FOR i:=0 TO windowItems.count()-1 + windowObject:=windowItems.item(i) + listObjects.add(windowObject) + ENDFOR + self.writeLine('//window ids') + self.createEnum('win',listObjects,ENUM_IDENTS) + self.writeLine('') + + listObjects.clear() + FOR i:=0 TO windowItems.count()-1 layoutObject:=windowLayouts.item(i) + windowObject:=windowItems.item(i) listObjects.clear() layoutObject.findObjectsByType(listObjects,-1) - StringF(tempStr,'//\s',windowNames.item(i)) + StringF(tempStr,'//\s gadgets',windowObject.ident) self.writeLine(tempStr) - self.createEnum(windowNames.item(i),listObjects,FALSE) - IF self.useIds THEN self.createEnum(windowNames.item(i),listObjects,TRUE) + self.createEnum(windowObject.ident,listObjects,ENUM_IDXS) + IF self.useIds THEN self.createEnum(windowObject.ident,listObjects,ENUM_IDS) ENDFOR END listObjects self.writeLine('') @@ -877,7 +896,7 @@ PROC genWindowHeader(count, windowObject:PTR TO windowObject, menuObject:PTR TO DEF listStr DEF drawlist:PTR TO drawlist - StrCopy(tempStr,windowObject.name) + StrCopy(tempStr,windowObject.ident) LowerStr(tempStr) self.write('void ') self.write(tempStr) @@ -1075,10 +1094,14 @@ PROC genWindowFooter(count, windowObject:PTR TO windowObject, menuObject:PTR TO DEF reactionObject:PTR TO reactionObject DEF listStr DEF tempStr[200]:STRING + DEF windowName[200]:STRING DEF i StringF(tempStr,' main_gadgets[\d] = 0;',count) self.writeLine(tempStr) + + StrCopy(windowName,windowObject.ident) + LowerStr(windowName) IF self.definitionOnly self.writeLine('}') @@ -1088,10 +1111,10 @@ PROC genWindowFooter(count, windowObject:PTR TO windowObject, menuObject:PTR TO self.writeLine('') IF menuObject.menuItems.count()>0 - StringF(tempStr,' runWindow( window_object, \d, menu_strip, main_gadgets );',windowObject.id) + StringF(tempStr,' runWindow( window_object, \s_id, menu_strip, main_gadgets );',windowName) self.writeLine(tempStr) ELSE - StringF(tempStr,' runWindow( window_object, \d, 0, main_gadgets );',windowObject.id) + StringF(tempStr,' runWindow( window_object, \s_id, 0, main_gadgets );',windowName) self.writeLine(tempStr) ENDIF self.writeLine('') @@ -1192,7 +1215,7 @@ PROC genFooter(windowObject:PTR TO windowObject, rexxObject:PTR TO rexxObject) O ENDIF - StringF(tempStr,' \s',windowObject.name) + StringF(tempStr,' \s',windowObject.ident) LowerStr(tempStr) StrAdd(tempStr,'();') self.writeLine(tempStr) diff --git a/eSourceGen.e b/eSourceGen.e index d87b308..f956077 100644 --- a/eSourceGen.e +++ b/eSourceGen.e @@ -9,6 +9,8 @@ OPT MODULE,LARGE EXPORT OBJECT eSrcGen OF srcGen ENDOBJECT +ENUM ENUM_IDS, ENUM_IDENTS, ENUM_IDXS + PROC create(fser:PTR TO fileStreamer,libsused,definitionOnly,useIds) OF eSrcGen SUPER self.create(fser,libsused,definitionOnly,useIds) self.type:=ESOURCE_GEN @@ -21,7 +23,7 @@ PROC create(fser:PTR TO fileStreamer,libsused,definitionOnly,useIds) OF eSrcGen self.terminator:=0 ENDPROC -PROC createEnum(windowName:PTR TO CHAR, listObjects:PTR TO stdlist, ids) OF eSrcGen +PROC createEnum(enumName:PTR TO CHAR, listObjects:PTR TO stdlist, enumType) OF eSrcGen DEF n=0, j DEF listObject:PTR TO reactionObject DEF tempStr[255]:STRING @@ -40,11 +42,12 @@ PROC createEnum(windowName:PTR TO CHAR, listObjects:PTR TO stdlist, ids) OF eSrc ENDIF listObject:=listObjects.item(j) listObject.gadindex:=j + StrCopy(tempStr,listObject.ident) UpperStr(tempStr) self.write(tempStr) n:=n+StrLen(tempStr) - IF ids + IF (enumType=ENUM_IDS) OR (enumType=ENUM_IDENTS) StringF(tempStr,'_ID = \d',listObject.id) n:=n+StrLen(tempStr) self.write(tempStr) @@ -53,9 +56,10 @@ PROC createEnum(windowName:PTR TO CHAR, listObjects:PTR TO stdlist, ids) OF eSrc self.writeLine('') ENDPROC -PROC genHeader(screenObject:PTR TO screenObject,rexxObject:PTR TO rexxObject, windowNames:PTR TO stringlist, windowLayouts:PTR TO stdlist, sharedPort) OF eSrcGen +PROC genHeader(screenObject:PTR TO screenObject,rexxObject:PTR TO rexxObject, windowItems:PTR TO stdlist, windowLayouts:PTR TO stdlist, sharedPort) OF eSrcGen DEF tempStr[200]:STRING DEF hasarexx,i + DEF windowObject:PTR TO reactionObject DEF layoutObject:PTR TO reactionObject DEF listObjects:PTR TO stdlist @@ -133,14 +137,24 @@ PROC genHeader(screenObject:PTR TO screenObject,rexxObject:PTR TO rexxObject, wi NEW listObjects.stdlist(20) self.writeLine('') - FOR i:=0 TO windowNames.count()-1 + FOR i:=0 TO windowItems.count()-1 + windowObject:=windowItems.item(i) + listObjects.add(windowObject) + ENDFOR + self.writeLine('->window ids') + self.createEnum('win',listObjects,ENUM_IDENTS) + self.writeLine('') + + listObjects.clear() + FOR i:=0 TO windowItems.count()-1 layoutObject:=windowLayouts.item(i) + windowObject:=windowItems.item(i) listObjects.clear() layoutObject.findObjectsByType(listObjects,-1) - StringF(tempStr,'->\s',windowNames.item(i)) + StringF(tempStr,'->\s gadgets',windowObject.ident) self.writeLine(tempStr) - self.createEnum(windowNames.item(i),listObjects,FALSE) - IF self.useIds THEN self.createEnum(windowNames.item(i),listObjects,TRUE) + self.createEnum(windowObject.ident,listObjects,ENUM_IDXS) + IF self.useIds THEN self.createEnum(windowObject.ident,listObjects,ENUM_IDS) ENDFOR END listObjects self.writeLine('') @@ -592,7 +606,7 @@ PROC genWindowHeader(count, windowObject:PTR TO windowObject, menuObject:PTR TO DEF colWidth DEF colTitle - StrCopy(tempStr,windowObject.name) + StrCopy(tempStr,windowObject.ident) LowerStr(tempStr) self.write('PROC ') self.write(tempStr) @@ -822,6 +836,7 @@ ENDPROC PROC genWindowFooter(count, windowObject:PTR TO windowObject, menuObject:PTR TO menuObject, layoutObject:PTR TO reactionObject, reactionLists:PTR TO stdlist) OF eSrcGen DEF tempStr[200]:STRING + DEF windowName[200]:STRING DEF listObjects:PTR TO stdlist DEF reactionObject:PTR TO reactionObject DEF i @@ -829,6 +844,9 @@ PROC genWindowFooter(count, windowObject:PTR TO windowObject, menuObject:PTR TO StringF(tempStr,' mainGadgets[\d]:=0',count) self.writeLine(tempStr) + StrCopy(windowName,windowObject.ident) + UpperStr(windowName) + IF self.definitionOnly self.writeLine('ENDPROC') self.writeLine('') @@ -837,10 +855,10 @@ PROC genWindowFooter(count, windowObject:PTR TO windowObject, menuObject:PTR TO self.writeLine('') IF menuObject.menuItems.count()>0 - StringF(tempStr,' runWindow(windowObject,\d,menuStrip,mainGadgets)',windowObject.id) + StringF(tempStr,' runWindow(windowObject,\s_ID,menuStrip,mainGadgets)',windowName) self.writeLine(tempStr) ELSE - StringF(tempStr,' runWindow(windowObject,\d,NIL,mainGadgets)',windowObject.id) + StringF(tempStr,' runWindow(windowObject,\s_ID,NIL,mainGadgets)',windowName) self.writeLine(tempStr) ENDIF self.writeLine('') @@ -901,7 +919,7 @@ PROC genFooter(windowObject:PTR TO windowObject, rexxObject:PTR TO rexxObject) O ENDIF self.writeLine('') - StringF(tempStr,' \s',windowObject.name) + StringF(tempStr,' \s',windowObject.ident) LowerStr(tempStr) StrAdd(tempStr,'()') diff --git a/makefile b/makefile index af160c0..366186a 100644 --- a/makefile +++ b/makefile @@ -30,7 +30,7 @@ paletteObject.m: paletteObject.e reactionObject.m reactionForm.m sourceGen.m screenObject.m: screenObject.e reactionObject.m reactionForm.m sourceGen.m $(compiler) screenObject $(options) -windowObject.m: windowObject.e reactionObject.m reactionForm.m sourceGen.m stringlist.m +windowObject.m: windowObject.e reactionObject.m reactionForm.m sourceGen.m stringlist.m dialogs.m $(compiler) windowObject $(options) glyphObject.m: glyphObject.e reactionObject.m reactionForm.m sourceGen.m diff --git a/reactionForm.e b/reactionForm.e index d7d9a7e..83e75ac 100644 --- a/reactionForm.e +++ b/reactionForm.e @@ -19,7 +19,7 @@ EXPORT PROC gadgetPress(id,code) OF reactionForm DEF action,gadget IF (action:=self.gadgetActions[id]) IF (action=MR_OK) OR (action=MR_CANCEL) - self.modalResult:=action + IF self.canClose(action) THEN self.modalResult:=action ELSE gadget:=self.gadgetList[id] action(self,gadget,id,code) @@ -35,7 +35,7 @@ EXPORT PROC clearBusy() OF reactionForm IF self.windowObj THEN Sets(self.windowObj,WA_BUSYPOINTER,FALSE) ENDPROC -EXPORT PROC canClose() OF reactionForm IS TRUE +EXPORT PROC canClose(modalRes) OF reactionForm IS TRUE EXPORT PROC ticker() OF reactionForm IS 0 EXPORT PROC menuPick(menu,menuitem,subItem) OF reactionForm IS 0 @@ -56,7 +56,7 @@ EXPORT PROC showModal() OF reactionForm HANDLE CASE WMHI_GADGETUP self.gadgetPress(result AND $FFFF,code AND $FFFF) CASE WMHI_CLOSEWINDOW - IF self.canClose() THEN running:=FALSE + IF self.canClose(MR_CANCEL) THEN running:=FALSE CASE WMHI_INTUITICK self.ticker() CASE WMHI_MENUPICK diff --git a/reactionObject.e b/reactionObject.e index 67647ec..127135b 100644 --- a/reactionObject.e +++ b/reactionObject.e @@ -615,6 +615,14 @@ PROC deserialise(fser:PTR TO fileStreamer) OF reactionObject done:=TRUE ENDIF UNTIL done + IF (StrLen(self.ident)=0) + IF (StrLen(self.name)) + AstrCopy(self.ident,self.name,80) + ELSE + StringF(tempStr,'\s_\d',self.getTypeName(),self.id) + AstrCopy(self.ident,tempStr,80) + ENDIF + ENDIF list:=self.serialiseData() count:=ListLen(list) diff --git a/rebuild.e b/rebuild.e index 6135d33..601171a 100644 --- a/rebuild.e +++ b/rebuild.e @@ -53,8 +53,8 @@ OPT OSVERSION=37,LARGE '*getColorObject','*gradSliderObject','*tapeDeckObject','*textEditorObject','*ledObject','*listViewObject', '*virtualObject','*sketchboardObject','*tabsObject' -#define vernum '0.9.0-beta' -#date verstring '$VER:Rebuild 0.9.0-%Y%m%d%h%n%s-beta' +#define vernum '0.10.0-beta' +#date verstring '$VER:Rebuild 0.10.0-%Y%m%d%h%n%s-beta' #ifndef EVO_3_7_0 FATAL 'Rebuild should only be compiled with E-VO Amiga E Compiler v3.7.0 or higher' @@ -1217,17 +1217,18 @@ PROC genCode() DEF objectCreate[50]:STRING DEF objectEnd[50]:STRING DEF codeGenForm:PTR TO codeGenForm - DEF i,res + DEF i,j,res DEF menuComp:PTR TO reactionObject DEF windowComp:PTR TO reactionObject DEF layoutComp:PTR TO reactionObject DEF screenComp:PTR TO screenObject DEF rexxComp:PTR TO rexxObject DEF libsused[TYPE_MAX]:ARRAY OF CHAR - DEF windowNames:PTR TO stringlist + DEF windowItems:PTR TO stdlist DEF windowLayouts:PTR TO stdlist DEF windowObj:PTR TO windowObject DEF sharedport=0 + DEF dupeName=0 setBusy() NEW codeGenForm.create() @@ -1264,16 +1265,30 @@ PROC genCode() FOR i:=0 TO TYPE_MAX-1 DO libsused[i]:=0 i:=ROOT_LAYOUT_ITEM - NEW windowNames.stringlist(10) + NEW windowItems.stdlist(10) NEW windowLayouts.stdlist(10) WHILE ij + IF StriCmp(windowItems.item(i)::reactionObject.ident,windowItems.item(j)::reactionObject.ident) + dupeName:=TRUE + ENDIF + ENDIF + ENDFOR + ENDFOR + + IF dupeName + IF warnRequest(mainWindow,'Warning','You have duplicate window identifiers,\ndo you want to continue?',TRUE)=0 THEN RETURN + ENDIF IF FileLength(fname)>=0 IF warnRequest(mainWindow,'Warning','This file already exists,\ndo you want to overwrite?',TRUE)=0 THEN RETURN @@ -1301,8 +1316,8 @@ PROC genCode() windowComp:=objectList.item(ROOT_WINDOW_ITEM) screenComp:=objectList.item(ROOT_SCREEN_ITEM) rexxComp:=objectList.item(ROOT_REXX_ITEM) - srcGen.genHeader(screenComp,rexxComp, windowNames,windowLayouts, sharedport) - END windowNames + srcGen.genHeader(screenComp,rexxComp, windowItems,windowLayouts, sharedport) + END windowItems END windowLayouts WHILE (i+ROOT_WINDOW_ITEM)