home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 22 / CD_ASCQ_22_0695.iso / win / prg / lb11wi / ffexp.tkn < prev    next >
Text File  |  1995-02-02  |  56KB  |  1 lines

  1. menuItem$(type$(label$(arrayName$(xOrg(yOrg(names$(menuItemLocal$(width(winType$(branchLabel$(menu$(handle$(segment(corner$(menuItemCount(bmpName$(height(formIsModified]5renderGroupBox]selectMenuToEdit]9changeHandle]addWindowFrame]quit]4noMenuItemsToSave]1selectMenuItemToEdit]3addBmpButton]noMenusToSave]2removeMenu]5codeForStaticText]1cancelGridDialog]3acceptGridDialog]8eraseObjectFrame]renderStaticText]additionalObjectMoves]drawMenus]reloadLocalMenuItems]9codeForCheckBox]1addRadioButton]renderButton]doneProducingCode]4produceCode]saveFile]8snapOff]6addField]resizeControl]doneMultiBranchLabel]4writeNextMenuItem]2produceNextMenu]selectWinType]addNewMenuItem]6renderCheckBox]snapOn]4acceptInspect]cancelInspect]addComboBox]changeWindowType]acceptMovement]dontDeselect]codeForBmpButton]7codeForGroupBox]3addStaticText]oveMenuToTop]1saveFormSubroutine]2codeForListBox]5noResizingFrame]deselect]addButton]acceptResizing]closeMenuEdit]8oveToFront]selectControl]acceptWinType]renderRadioButton]addListBox]produceOutline]closeEditMenuItem]9redrawNext]noMenuCode]handleMultiBranchLabels]6codeForComboBox]7gridDialog]9beginObjectMove]newFile]3drawSizingHandle]acceptNewMenu]2additionalResizes]renderTextBox]cancelWinType]deleteMenuItem]7cancelMenuItemProps]7acceptMenuItemProps]3changeTitle]renderComboBox]deleteControl]clearMenuData]4renderListBox]skipControl]drawTheWindow]snapMouse]openFile]4addGroupBox]acceptRemoveMenu]2codeForButton]5selectDeselect]snapWH]editMenus]1inputLoop]snapXY]addCheckBox]setUpWindowAndOpenIt]cancelNewMenu]1nextMultiBranchLabel]5oveToBack]renderBmpButton]inspectControl]editMenuItemProperties]4checkForEmptyMenuBar]9cancelRemoveMenu]8editMenuItem]6addAMenu]6produceCodeAndOutline]noMenuItemsToRead]4noMenusToRead]5setForSelection]oveMenuItemDown]4determineControl]codeForRadioButton]9codeForTextBox]9oveMenuItemUp]4dontDrawMenus]nextOutlineObject]setUpMovementEvent]redrawAll]noHotKey]renderWindow]falseffexp.tkn1DIMtype$()DIMlabel$()DIMnames$()DIMxOrg()DIMyOrg()DIMwidth()DIMheight()DIMcorner$()DIMbranchLabel$()DIMsegment()DIMhandle$()DIMbmpName$()DIMarrayName$()DIMmenu$()DIMmenuItem$(,)DIMmenuItemLocal$()DIMmenuItemCount()DIMwinType$()index=resizeable$=" combobox textbox listbox groupbox windowframe "newControlNumber=qu$=CHR$()controlsThatBranch$=" button listbox combobox bmpbutton checkbox radiobutton "snapOn=xInterval=yInterval=one=formName$="untitled.fre"windowXOrigin=windowYOrigin=windowXExtent=windowYExtent=windowLabel$="untitled"windowType$="dialog"winHandle$="#main"menuCount=LOADBMP"systemBox","systembx.bmp"LOADBMP"minBox","minbx.bmp"LOADBMP"maxBox","maxbx.bmp"LOADBMP"comboButton","cmbobttn.bmp"LOADBMP"radioButton","radibttn.bmp"LOADBMP"checkBox","checkbox.bmp"LOADBMP"scrollUp","scrlup.bmp"LOADBMP"scrollDown","scrldown.bmp"LOADBMP"scrollRight","scrlrght.bmp"LOADBMP"scrollLeft","scrlleft.bmp"winType$()="window"winType$()="window_nf"winType$()="dialog"winType$()="dialog_nf"NOMAINWINMENU#form,"&Files","&New",newFile],"&Open",openFile],"&Save",saveFile]MENU#form,"&Control","&Inspect",inspectControl],"&Delete",deleteControl],|,"Move to &front",oveToFront],"Move to &back",oveToBack]MENU#form,"&Output","&Produce Code",produceCode],"Produce Code + Outline",produceCodeAndOutline]MENU#form,"&Window","&Title",changeTitle],"T&ype",changeWindowType],"&Handle",changeHandle]MENU#form,"O&ptions","&Auto Snap to Grid",gridDialog]MENU#form,"&Menu","&Add a Menu",addAMenu],"&Remove a Menu",removeMenu],"&Edit Menus",editMenus]BMPBUTTON#form,"textbttn.bmp",addStaticText],UL,,BMPBUTTON#form,"efldbttn.bmp",addField],UL,,BMPBUTTON#form,"bttnbttn.bmp",addButton],UL,,BMPBUTTON#form,"usrdbttn.bmp",addBmpButton],UL,,BMPBUTTON#form,"lboxbttn.bmp",addListBox],UL,,BMPBUTTON#form,"cboxbttn.bmp",addComboBox],UL,,BMPBUTTON#form,"rdiobttn.bmp",addRadioButton],UL,,BMPBUTTON#form,"chbxbttn.bmp",addCheckBox],UL,,BMPBUTTON#form,"gboxbttn.bmp",addGroupBox],UL,,OPEN"FreeForm v1.0 for Liberty BASIC"FORgraphics_fs_nsbAS#formPRINT#form,"font fixedsys 8 15"PRINT#form,"trapclose [quit]"GOSUBrenderWindow]GOSUBaddWindowFrame]GOTOsetForSelection]objectCount=objectCount+idx=objectCountxOrg(idx)=yOrg(idx)=width(idx)=height(idx)=type$(idx)="windowframe"RETURNtext$=""PROMPT"Please enter text for this button"text$IFLEFT$(text$,)=qu$THENtext$=MID$(text$,)IFRIGHT$(text$,)=qu$THENtext$=LEFT$(text$,LEN(text$)-)IFtext$=""THENinputLoop]newControlNumber=newControlNumber+objectCount=objectCount+idx=objectCountxOrg(idx)=yOrg(idx)=type$(idx)="button"names$(idx)="button"+STR$(newControlNumber)corner$(idx)="UL"label$(idx)=text$branchLabel$(idx)="["+names$(idx)+"Click]"GOSUBrenderButton]GOTOinputLoop]bmp$=""FILEDIALOG"Select a bitmap for this button","*.bmp",bmp$IFbmp$=""THENinputLoop]newControlNumber=newControlNumber+objectCount=objectCount+idx=objectCountxOrg(idx)=yOrg(idx)=type$(idx)="bmpbutton"names$(idx)="bmpbutton"+STR$(newControlNumber)corner$(idx)="UL"bmpName$(idx)=bmp$LOADBMPbmp$,bmp$branchLabel$(idx)="["+names$(idx)+"Click]"GOSUBrenderBmpButton]GOTOinputLoop]newControlNumber=newControlNumber+objectCount=objectCount+idx=objectCountxOrg(idx)=yOrg(idx)=width(idx)=height(idx)=type$(idx)="textbox"names$(idx)="textbox"+STR$(newControlNumber)GOSUBrenderTextBox]GOTOinputLoop]newControlNumber=newControlNumber+objectCount=objectCount+idx=objectCountxOrg(idx)=yOrg(idx)=width(idx)=height(idx)=type$(idx)="combobox"names$(idx)="combobox"+STR$(newControlNumber)branchLabel$(idx)="["+names$(idx)+"DoubleClick]"arrayName$(idx)="array$("GOSUBrenderComboBox]GOTOinputLoop]newControlNumber=newControlNumber+objectCount=objectCount+idx=objectCountxOrg(idx)=yOrg(idx)=width(idx)=height(idx)=type$(idx)="listbox"names$(idx)="listbox"+STR$(newControlNumber)branchLabel$(idx)="["+names$(idx)+"DoubleClick]"arrayName$(idx)="array$("GOSUBrenderListBox]GOTOinputLoop]text$=""PROMPT"Please enter the text you would like to add:"text$IFLEFT$(text$,)=qu$THENtext$=MID$(text$,)IFRIGHT$(text$,)=qu$THENtext$=LEFT$(text$,LEN(text$)-)IFtext$=""THENinputLoop]newControlNumber=newControlNumber+objectCount=objectCount+idx=objectCountxOrg(idx)=yOrg(idx)=type$(idx)="statictext"names$(idx)="statictext"+STR$(newControlNumber)corner$(idx)=""label$(idx)=text$GOSUBrenderStaticText]GOTOinputLoop]text$="No Text"PROMPT"Please enter the text this GroupBox :"text$IFLEFT$(text$,)=qu$THENtext$=MID$(text$,)IFRIGHT$(text$,)=qu$THENtext$=LEFT$(text$,LEN(text$)-)IFtext$=""THENinputLoop]IFtext$="No Text"THENtext$=""newControlNumber=newControlNumber+objectCount=objectCount+idx=objectCountxOrg(idx)=yOrg(idx)=width(idx)=height(idx)=type$(idx)="groupbox"names$(idx)="groupbox"+STR$(newControlNumber)corner$(idx)=""label$(idx)=text$GOSUBrenderGroupBox]GOTOinputLoop]text$=""PROMPT"Please enter a label for the radiobutton:"text$IFLEFT$(text$,)=qu$THENtext$=MID$(text$,)IFRIGHT$(text$,)=qu$THENtext$=LEFT$(text$,LEN(text$)-)IFtext$=""THENinputLoop]newControlNumber=newControlNumber+objectCount=objectCount+idx=objectCountxOrg(idx)=yOrg(idx)=type$(idx)="radiobutton"names$(idx)="radiobutton"+STR$(newControlNumber)corner$(idx)="UL"label$(idx)=text$branchLabel$(idx)="["+names$(idx)+"Set] ["+names$(idx)+"Reset]"GOSUBrenderRadioButton]GOTOinputLoop]text$=""PROMPT"Please enter a label for the checkbox"text$IFLEFT$(text$,)=qu$THENtext$=MID$(text$,)IFRIGHT$(text$,)=qu$THENtext$=LEFT$(text$,LEN(text$)-)IFtext$=""THENinputLoop]newControlNumber=newControlNumber+objectCount=objectCount+idx=objectCountxOrg(idx)=yOrg(idx)=type$(idx)="checkbox"names$(idx)="checkbox"+STR$(newControlNumber)corner$(idx)="UL"label$(idx)=text$branchLabel$(idx)="["+names$(idx)+"CheckboxSet] ["+names$(idx)+"CheckboxReset]"GOSUBrenderCheckBox]GOTOinputLoop]INPUTr$GOTOinputLoop]xOrg=windowXOriginyOrg=windowYOriginxExt=windowXExtentyExt=windowYExtentPRINT#form,"cls"PRINT#form,"backcolor white ; color black ; down ; size 1"PRINT#form,"place "xOrg+" "yOrg+PRINT#form,"boxfilled "xOrg+xExt-" "yOrg+yExt-IFINSTR(windowType$,"_nf")>THENnoResizingFrame]PRINT#form,"color lightgray ; size 3"IFwindowType$="dialog"THENPRINT#form,"color darkgray"PRINT#form,"place "xOrg+" "yOrg+PRINT#form,"box "xOrg+xExt-" "yOrg+yExt-PRINT#form,"color black ; size 1"PRINT#form,"place "xOrg" "yOrgPRINT#form,"box "xOrg+xExt" "yOrg+yExtPRINT#form,"color black ; backcolor darkblue"IFLEFT$(windowType$,)="dialog"THENPRINT#form,"backcolor darkgray"PRINT#form,"place "+xOrg" "+yOrgPRINT#form,"boxfilled "xOrg+xExt-" "+yOrg+PRINT#form,"place "INT(xExt/)+xOrg-LEN(windowLabel$)*" "+yOrgPRINT#form,"color white"PRINT#form,"\"windowLabel$PRINT#form,"drawbmp systemBox "xOrg+" "+yOrgPRINT#form,"backcolor white ; color black ; down ; size 1"IFwindowType$="dialog"THENPRINT#form,"color white"PRINT#form,"place "xOrg+" "yOrg+PRINT#form,"box "xOrg+xExt-" "yOrg+yExt-IFLEFT$(windowType$,)="dialog"THENdrawMenus]IFINSTR(windowType$,"_nf")THENPRINT#form,"drawbmp minBox "xOrg+xExt-" "+yOrg:GOTOdrawMenus]PRINT#form,"drawbmp minBox "xOrg+xExt-" "+yOrgPRINT#form,"drawbmp maxBox "xOrg+xExt-" "+yOrgIFmenuCount=THENdontDrawMenus]PRINT#form,"color black ; backcolor white"PRINT#form,"place "+xOrg" "+yOrgPRINT#form,"box "xOrg+xExt-" "+yOrg+string$=""underline$=""FORx=TOmenuCount-item$=menu$(x)hkIndex=INSTR(menu$(x),"&")IFhkIndex=THENnoHotKey]item$=LEFT$(item$,hkIndex-)+MID$(item$,hkIndex+)underline$=underline$+CHR$(LEN(string$)+hkIndex)string$=string$+item$+"  "NEXTxPRINT#form,"color black ; backcolor white"PRINT#form,"place "xOrg+" "+yOrgPRINT#form,"\"string$IFLEN(underline$)=THENdontDrawMenus]FORx=TOLEN(underline$)PRINT#form,"place "xOrg++(ASC(MID$(underline$,x,))-)*" "yOrg+PRINT#form,"north ; turn 90 ; go 8"NEXTxPRINT#form,"flush"RETURNPROMPT"Specify the window's title"windowLabel$GOSUBredrawAll]GOTOinputLoop]WindowWidth=WindowHeight=STATICTEXT#type.statictext1,"Select the type of window desired:",,,,COMBOBOX#type.types,winType$(,selectWinType],,,,BUTTON#type,"Accept",acceptWinType],UL,,BUTTON#type,"Cancel",cancelWinType],UL,,OPEN"Select Window Type"FORdialogAS#typePRINT#type.types,"select "windowType$PRINT#type,"trapclose [cancelWinType]"defaultType$=windowType$GOTOinputLoop]PRINT#type.types,"selection?"INPUT#type.types,defaultType$GOTOinputLoop]windowType$=defaultType$CLOSE#typeGOSUBredrawAll]GOTOinputLoop]CLOSE#typeGOTOinputLoop]PROMPT"Specify the window's handle (starts with a #)"result$IFresult$=""THENinputLoop]winHandle$=result$IFLEFT$(winHandle$,)<>"#"THENwinHandle$="#"+winHandle$:NOTICE"Window handle defaults to: "+winHandle$GOTOinputLoop]type$(idx)="button"width(idx)=*(LEN(label$(idx)))+height(idx)=+xOrgIdx=xOrg(idx)yOrgIdx=yOrg(idx)PRINT#form,"place "xOrgIdx" "yOrgIdxPRINT#form,"place "xOrgIdx" "yOrgIdxPRINT#form,"color black ; backcolor lightgray ; size 1"PRINT#form,"down ; boxfilled "xOrgIdx+width(idx)" "yOrgIdx+height(idx)PRINT#form,"size 2 ; color darkgray ; place "xOrgIdx+" "yOrgIdx+PRINT#form,"box "xOrgIdx+width(idx)-" "yOrgIdx+height(idx)-PRINT#form,"color white"PRINT#form,"place  "xOrgIdx+" "yOrgIdx+height(idx)-PRINT#form,"goto "xOrgIdx+" "yOrgIdx+PRINT#form,"goto "xOrgIdx+width(idx)-" "yOrgIdx+PRINT#form,"color black ; backcolor lightgray ; size 1"PRINT#form,"place "xOrgIdx+" "yOrgIdx+PRINT#form,"\"label$(idx)PRINT#form,"up ; flush"PRINT#form,"segment":INPUT#form,idsegment(idx)=idRETURNtype$(idx)="statictext"width(idx)=*LEN(label$(idx))height(idx)=PRINT#form,"place "xOrg(idx)" "yOrg(idx)+-" ; place "xOrg(idx)" "yOrg(idx)+-PRINT#form,"down ; color black ; backcolor white"PRINT#form,"\"label$(idx)PRINT#form,"up ; flush"PRINT#form,"segment":INPUT#form,idsegment(idx)=idRETURNtype$(idx)="radiobutton"width(idx)=*LEN(label$(idx))+height(idx)=PRINT#form,"down"PRINT#form,"place "xOrg(idx)" "yOrg(idx)PRINT#form,"drawbmp radioButton "xOrg(idx)" "yOrg(idx)PRINT#form,"color black ; backcolor white"PRINT#form,"place "xOrg(idx)+" "yOrg(idx)+-PRINT#form,"\"label$(idx)PRINT#form,"up ; flush"PRINT#form,"segment":INPUT#form,idsegment(idx)=idRETURNtype$(idx)="checkbox"width(idx)=*LEN(label$(idx))+height(idx)=PRINT#form,"place "xOrg(idx)" "yOrg(idx)PRINT#form,"down"PRINT#form,"drawbmp checkBox "xOrg(idx)" "yOrg(idx)PRINT#form,"color black ; backcolor white"PRINT#form,"place "xOrg(idx)+" "yOrg(idx)+-PRINT#form,"\"label$(idx)PRINT#form,"up ; flush"PRINT#form,"segment":INPUT#form,idsegment(idx)=idRETURNtype$(idx)="bmpbutton"width(idx)=height(idx)=PRINT#form,"place "xOrg(idx)" "yOrg(idx)PRINT#form,"drawbmp "bmpName$(idx)" "xOrg(idx)" "yOrg(idx)PRINT#form,"flush"PRINT#form,"segment":INPUT#form,idsegment(idx)=idRETURNtype$(idx)="combobox"PRINT#form,"place "xOrg(idx)" "yOrg(idx)PRINT#form,"place "xOrg(idx)" "yOrg(idx)PRINT#form,"color black ; backcolor white ; size 1"PRINT#form,"down ; boxfilled "xOrg(idx)+width(idx)-" "yOrg(idx)+PRINT#form,"drawbmp comboButton "xOrg(idx)+width(idx)-" "yOrg(idx)PRINT#form,"up ; flush"PRINT#form,"segment":INPUT#form,idsegment(idx)=idRETURNtype$(idx)="textbox"PRINT#form,"place "xOrg(idx)" "yOrg(idx)" ; place "xOrg(idx)" "yOrg(idx)PRINT#form,"color black ; backcolor white ; size 1"PRINT#form,"down ; boxfilled "xOrg(idx)+width(idx)" "yOrg(idx)+height(idx)PRINT#form,"up ; flush"PRINT#form,"segment":INPUT#form,idsegment(idx)=idRETURNtype$(idx)="listbox"PRINT#form,"place "xOrg(idx)" "yOrg(idx)PRINT#form,"place "xOrg(idx)" "yOrg(idx)PRINT#form,"color black ; backcolor white ; size 1"PRINT#form,"down ; boxfilled "xOrg(idx)+width(idx)" "yOrg(idx)+height(idx)PRINT#form,"color black ; backcolor lightgray"PRINT#form,"place "xOrg(idx)+width(idx)-" "yOrg(idx)PRINT#form,"boxfilled "xOrg(idx)+width(idx)" "yOrg(idx)+height(idx)PRINT#form,"drawbmp scrollUp "xOrg(idx)+width(idx)-" "yOrg(idx)PRINT#form,"drawbmp scrollDown "xOrg(idx)+width(idx)-" "yOrg(idx)+height(idx)-PRINT#form,"up ; flush"PRINT#form,"segment":INPUT#form,idsegment(idx)=idRETURNtype$(idx)="groupbox"PRINT#form,"place "xOrg(idx)" "yOrg(idx)PRINT#form,"place "xOrg(idx)+" "yOrg(idx)+PRINT#form,"color black ; backcolor white ; size 1"PRINT#form,"down ; boxfilled "xOrg(idx)+width(idx)-" "yOrg(idx)+height(idx)-PRINT#form,"place "xOrg(idx)+" "yOrg(idx)+PRINT#form,"\"label$(idx)PRINT#form,"up ; flush"PRINT#form,"segment":INPUT#form,idsegment(idx)=idRETURNIFindex<THENinputLoop]IFinspectIsOpen=THENCLOSE#inspectWindowHeight=WindowWidth=TEXTBOX#inspect.labelField,,,,TEXTBOX#inspect.nameField,,,,TEXTBOX#inspect.branchLabelField,,,,TEXTBOX#inspect.arrayNameField,,,,STATICTEXT#inspect.type,"Label:",,,,STATICTEXT#inspect.type,"Name:",,,,STATICTEXT#inspect.statictext2,"Branch Label(s):",,,,STATICTEXT#inspect.statictext4,"Array:",,,,BUTTON#inspect,"Accept",acceptInspect],UL,,BUTTON#inspect,"Cancel",cancelInspect],UL,,STATICTEXT#inspect.statictext15,"n/a =",,,,STATICTEXT#inspect.statictext16,"not applicable",,,,OPEN"Modify Control"FORdialogAS#inspectPRINT#inspect,"trapclose [cancelInspect]"inspectIsOpen=PRINT#inspect.labelField,label$(index)PRINT#inspect.type,type$(index)+" name:"PRINT#inspect.nameField,names$(index)PRINT#inspect.branchLabelField,branchLabel$(index)IFINSTR(" button statictext checkbox radiobutton groupbox ",type$(index))=THENPRINT#inspect.labelField,"n/a"IFINSTR(controlsThatBranch$,type$(index))=THENPRINT#inspect.branchLabelField,"n/a"IFINSTR(" listbox combobox ",type$(index))>THENPRINT#inspect.arrayNameField,arrayName$(index)ELSEPRINT#inspect.arrayNameField,"n/a"GOTOinputLoop]isModified=hasLabel=INSTR(" button statictext checkbox radiobutton groupbox ",type$(index))IFhasLabel>THENPRINT#inspect.labelField,"!contents?":INPUT#inspect.labelField,label$:label$(index)=label$PRINT#inspect.nameField,"!contents?":INPUT#inspect.nameField,names$:names$(index)=names$branches=INSTR(controlsThatBranch$,type$(index))IFbranches>THENPRINT#inspect.branchLabelField,"!contents?":INPUT#inspect.branchLabelField,bLabel$:branchLabel$(index)=bLabel$usesArray=INSTR(" listbox combobox ",type$(index))IFusesArray>THENPRINT#inspect.arrayNameField,"!contents?":INPUT#inspect.arrayNameField,aName$:arrayName$(index)=aName$CLOSE#inspectinspectIsOpen=IFhasLabel>THENGOSUBredrawAll]GOTOinputLoop]CLOSE#inspectinspectIsOpen=GOTOinputLoop]PRINT#form,"when leftButtonDown [selectControl]"PRINT#form,"when leftButtonDouble [inspectControl]"PRINT#form,"when leftButtonMove"PRINT#form,"when leftButtonUp"GOTOinputLoop]PRINT#form,"when leftButtonUp [setForSelection]"PRINT#form,"when leftButtonDown"x=MouseX:y=MouseYIFindex=THENdontDeselect]IFINSTR(resizeable$,type$(index))=THENdeselect]IFx<xOrg(index)+width(index)-ORx>xOrg(index)+width(index)+THENdeselect]IFy<yOrg(index)+height(index)-ORy>yOrg(index)+height(index)+THENdeselect]GOTOresizeControl]PRINT#form,"delsegment "selectId-GOSUBselectDeselect]index=PRINT#form,"delsegment "selectId-GOSUBdetermineControl]IFnewIndex=THENsetUpMovementEvent]index=newIndexGOSUBselectDeselect]lastMouseX=MouseXlastMouseY=MouseYIFtype$(newIndex)="windowframe"THENinputLoop]PRINT#form,"when leftButtonMove [beginObjectMove]"GOTOinputLoop]IFobjectCount=THENRETURNnewIndex=FORi=objectCountTOSTEP-1IFnewIndex>THENskipControl]IFtype$(i)=""THENskipControl]IFx<xOrg(i)ORx>xOrg(i)+width(i)THENskipControl]IFy<yOrg(i)ORy>yOrg(i)+height(i)THENskipControl]newIndex=ii=NEXTiRETURNxOrgIdx=xOrg(index)yOrgIdx=yOrg(index)xow=xOrgIdx+width(index)yoh=yOrgIdx+height(index)PRINT#form,"rule xor ; down"IFtype$(index)="windowframe"THENdrawSizingHandle]PRINT#form,"color darkgray ; backcolor white"PRINT#form,"place "xOrgIdx-" "yOrgIdx-PRINT#form,"boxfilled "xOrgIdx+" "yOrgIdx+PRINT#form,"place "xow-" "yOrgIdx-PRINT#form,"boxfilled "xow+" "yOrgIdx+PRINT#form,"place "xOrgIdx-" "yoh-PRINT#form,"boxfilled "xOrgIdx+" "yoh+IFINSTR(resizeable$,type$(index))>THENPRINT#form,"backcolor black"PRINT#form,"place "xow-" "yoh-PRINT#form,"boxfilled "xow+" "yoh+PRINT#form,"rule over ; flush"PRINT#form,"segment"INPUT#form,selectIdRETURNIFABS(MouseX-x)<ANDABS(MouseY-y)<THENinputLoop]PRINT#form,"delsegment "selectId-PRINT#form,"when leftButtonMove [additionalObjectMoves]"PRINT#form,"when leftButtonUp [acceptMovement]"GOSUBeraseObjectFrame]GOSUBsnapMouse]xOrg(index)=xOrg(index)+(MouseX-lastMouseX)yOrg(index)=yOrg(index)+(MouseY-lastMouseY)GOSUBsnapXY]lastMouseX=MouseXlastMouseY=MouseYPRINT#form,"color black ; backcolor white ; size 1"PRINT#form,"place "xOrg(index)" "yOrg(index)PRINT#form,"down ; rule xor ; box "xOrg(index)+width(index)" "yOrg(index)+height(index)PRINT#form,"rule over ; up ; flush"PRINT#form,"segment":INPUT#form,idPRINT#form,"delsegment "id-GOTOinputLoop]PRINT#form,"color black ; backcolor white ; size 1"PRINT#form,"place "xOrg(index)" "yOrg(index)PRINT#form,"down ; rule xor ; box "xOrg(index)+width(index)" "yOrg(index)+height(index)PRINT#form,"rule over ; up ; flush"PRINT#form,"segment":INPUT#form,idPRINT#form,"delsegment "id-RETURNIFwidth(index)<THENwidth(index)=IFheight(index)<THENheight(index)=IFtype$(index)<>"windowframe"THENacceptMovement]IFwidth(index)<THENwidth(index)=IFheight(index)<THENheight(index)=windowXExtent=width(index)windowYExtent=height(index)PRINT#form,"delsegment "segment(index)-GOSUBredrawAll]GOSUBselectDeselect]firstObjectMove=falseGOTOsetForSelection]firstObjectMove=truePRINT#form,"delsegment "selectId-PRINT#form,"when leftButtonMove [additionalResizes]"PRINT#form,"when leftButtonUp [acceptResizing]"GOSUBsnapMouse]lastMouseX=MouseXlastMouseY=MouseYIFfirstObjectMove=falseTHENGOSUBeraseObjectFrame]GOSUBsnapMouse]width(index)=width(index)+(MouseX-lastMouseX)height(index)=height(index)+(MouseY-lastMouseY)GOSUBsnapWH]lastMouseX=MouseXlastMouseY=MouseYPRINT#form,"color black ; backcolor white ; size 1"PRINT#form,"place "xOrg(index)" "yOrg(index)PRINT#form,"down ; rule xor ; box "xOrg(index)+width(index)" "yOrg(index)+height(index)PRINT#form,"rule over ; up ; flush"PRINT#form,"segment":INPUT#form,idPRINT#form,"delsegment "id-GOTOinputLoop]IFsnapOn=THENRETURNMouseX=INT((MouseX+INT(xInterval/))/xInterval)*xIntervalMouseY=INT((MouseY+INT(yInterval/))/yInterval)*yIntervalRETURNIFsnapOn=THENRETURNwidth(index)=INT((width(index)+INT(xInterval/))/xInterval)*xIntervalheight(index)=INT((height(index)+INT(yInterval/))/yInterval)*yIntervalRETURNIFsnapOn=THENRETURNxOrg(index)=INT((xOrg(index)+INT(xInterval/))/xInterval)*xIntervalyOrg(index)=INT((yOrg(index)+INT(yInterval/))/yInterval)*yIntervalRETURNisModified=PRINT#form,"cls"index=GOSUBrenderWindow]IFobjectCount=THENRETURNFORidx=TOobjectCounttypeIdx$=type$(idx)IFtypeIdx$="textbox"THENGOSUBrenderTextBox]:GOTOredrawNext]IFtypeIdx$="statictext"THENGOSUBrenderStaticText]:GOTOredrawNext]IFtypeIdx$="button"THENGOSUBrenderButton]:GOTOredrawNext]IFtypeIdx$="combobox"THENGOSUBrenderComboBox]:GOTOredrawNext]IFtypeIdx$="listbox"THENGOSUBrenderListBox]:GOTOredrawNext]IFtypeIdx$="bmpbutton"THENGOSUBrenderBmpButton]:GOTOredrawNext]IFtypeIdx$="radiobutton"THENGOSUBrenderRadioButton]:GOTOredrawNext]IFtypeIdx$="checkbox"THENGOSUBrenderCheckBox]:GOTOredrawNext]IFtypeIdx$="groupbox"THENGOSUBrenderGroupBox]NEXTidxRETURNIFindex<ORobjectCount<THENinputLoop]IFindex=THENGOSUBredrawAll]:GOTOinputLoop]tmpType$=type$(index)tmpLabel$=label$(index)tmpNames$=names$(index)tmpXOrigin=xOrg(index)tmpYOrigin=yOrg(index)tmpWidth=width(index)tmpHeight=height(index)tmpCorner$=corner$(index)tmpBranchLabel$=branchLabel$(index)tmpSegment=segment(index)tmpHandle$=handle$(index)tmpBmpName$=bmpName$(index)FORidx=index-TOSTEP-1type$(idx+)=type$(idx)label$(idx+)=label$(idx)names$(idx+)=names$(idx)xOrg(idx+)=xOrg(idx)yOrg(idx+)=yOrg(idx)width(idx+)=width(idx)height(idx+)=height(idx)corner$(idx+)=corner$(idx)branchLabel$(idx+)=branchLabel$(idx)segment(idx+)=segment(idx)handle$(idx+)=handle$(idx)bmpName$(idx+)=bmpName$(idx)NEXTidxtype$()=tmpType$label$()=tmpLabel$names$()=tmpNames$xOrg()=tmpXOriginyOrg()=tmpYOriginwidth()=tmpWidthheight()=tmpHeightcorner$()=tmpCorner$branchLabel$()=tmpBranchLabel$segment()=tmpSegmenthandle$()=tmpHandle$bmpName$()=tmpBmpName$GOSUBredrawAll]index=GOTOinputLoop]IFindex<ORobjectCount<THENinputLoop]IFindex=objectCountTHENGOSUBredrawAll]:GOTOinputLoop]tmpType$=type$(index)tmpLabel$=label$(index)tmpNames$=names$(index)tmpXOrigin=xOrg(index)tmpYOrigin=yOrg(index)tmpWidth=width(index)tmpHeight=height(index)tmpCorner$=corner$(index)tmpBranchLabel$=branchLabel$(index)tmpSegment=segment(index)tmpHandle$=handle$(index)tmpBmpName$=bmpName$(index)FORidx=indexTOobjectCount-type$(idx)=type$(idx+)label$(idx)=label$(idx+)names$(idx)=names$(idx+)xOrg(idx)=xOrg(idx+)yOrg(idx)=yOrg(idx+)width(idx)=width(idx+)height(idx)=height(idx+)corner$(idx)=corner$(idx+)branchLabel$(idx)=branchLabel$(idx+)segment(idx)=segment(idx+)handle$(idx)=handle$(idx+)bmpName$(idx)=bmpName$(idx+)NEXTidxtype$(objectCount)=tmpType$label$(idx)=tmpLabel$names$(objectCount)=tmpNames$xOrg(objectCount)=tmpXOriginyOrg(objectCount)=tmpYOriginwidth(objectCount)=tmpWidthheight(objectCount)=tmpHeightcorner$(objectCount)=tmpCorner$branchLabel$(objectCount)=tmpBranchLabel$segment(objectCount)=tmpSegmenthandle$(objectCount)=tmpHandle$bmpName$(objectCount)=tmpBmpName$GOSUBredrawAll]GOSUBselectDeselect]GOTOinputLoop]IFindex<THENinputLoop]PRINT#form,"delsegment "selectId-GOSUBselectDeselect]PRINT#form,"delsegment "selectId-FORidx=indexTOobjectCounttype$(idx)=type$(idx+)label$(idx)=label$(idx+)names$(idx)=names$(idx+)xOrg(idx)=xOrg(idx+)yOrg(idx)=yOrg(idx+)width(idx)=width(idx+)height(idx)=height(idx+)corner$(idx)=corner$(idx+)branchLabel$(idx)=branchLabel$(idx+)segment(idx)=segment(idx+)handle$(idx)=handle$(idx+)bmpName$(idx)=bmpName$(idx+)arrayName$(idx)=arrayName$(idx+)NEXTidxobjectCount=objectCount-GOSUBredrawAll]index=GOTOinputLoop]produceOutline=IFobjectCount<THENNOTICE"No objects.  Code not produced":GOTOinputLoop]IFcodeIsOpen=THENCLOSE#codeOPEN"Free Form output window"FORtextAS#codecodeIsOpen=PRINT#code,""PRINT#code,""PRINT#code,"    WindowWidth = "windowXExtentPRINT#code,"    WindowHeight = "windowYExtentPRINT#code,""FORx=TOobjectCountIFtype$(x)="button"THENGOSUBcodeForButton]IFtype$(x)="combobox"THENGOSUBcodeForComboBox]IFtype$(x)="textbox"THENGOSUBcodeForTextBox]IFtype$(x)="listbox"THENGOSUBcodeForListBox]IFtype$(x)="bmpbutton"THENGOSUBcodeForBmpButton]IFtype$(x)="statictext"THENGOSUBcodeForStaticText]IFtype$(x)="radiobutton"THENGOSUBcodeForRadioButton]IFtype$(x)="checkbox"THENGOSUBcodeForCheckBox]IFtype$(x)="groupbox"THENGOSUBcodeForGroupBox]PRINT#code,code$NEXTxIFmenuCount=THENnoMenuCode]IFLEFT$(windowType$,)="dialog"THENPRINT#code,"    '*** menus are not supported in windows of type "windowType$" ***"FORx=TOmenuCount-PRINT#code,"    menu "winHandle$", "qu$menu$(x)qu$IFmenuItemCount(x)=THENPRINT#code,", "CHR$()"&FixMe"CHR$()", [fixMe]  ' <-- this menu has no items!":GOTOproduceNextMenu]FORy=TOmenuItemCount(x)-PRINT#code,", "mi$=menuItem$(x,y)PRINT#code,qu$LEFT$(mi$,INSTR(mi$,CHR$())-)qu$PRINT#code,", "MID$(mi$,INSTR(mi$,CHR$())+)NEXTyPRINT#code,""NEXTxPRINT#code,"    open "qu$windowLabel$qu$" for "windowType$" as "winHandle$IFproduceOutline=THENdoneProducingCode]produceOutline=branchLabels$=""FORx=TOobjectCountIFLEFT$(TRIM$(branchLabel$(x)),)<>"["THENnextOutlineObject]IFINSTR(TRIM$(branchLabel$(x))," ")>THENGOSUBhandleMultiBranchLabels]:GOTOnextOutlineObject]IFINSTR(branchLabels$,branchLabel$(x))>THENnextOutlineObject]branchLabels$=branchLabels$+" "+branchLabel$(x)PRINT#code,""PRINT#code,""PRINT#code,branchLabel$(x)"   'Perform action for the "type$(x)" named '"names$(x)"'"PRINT#code,""PRINT#code,"    'Insert your own code here"NEXTxIFmenuCount=THENdoneProducingCode]FORx=TOmenuCount-FORy=TOmenuItemCount(x)-mi$=menuItem$(x,y)bl$=MID$(mi$,INSTR(mi$,CHR$())+)IFINSTR(branchLabels$,bl$)>THENwriteNextMenuItem]branchLabels$=branchLabels$+" "+bl$PRINT#code,""PRINT#code,""PRINT#code,bl$"   'Perform action for menu "menu$(x)", item "LEFT$(mi$,INSTR(mi$,CHR$())-)0PRINT#code,""1PRINT#code,"    'Insert your own code here"2NEXTy3NEXTx4NOTICE"Done.  Copy this code into your program."5GOTOinputLoop]6IFINSTR(branchLabels$,WORD$(branchLabel$(x),))>THENnextMultiBranchLabel]9PRINT#code,""0PRINT#code,""1PRINT#code,WORD$(branchLabel$(x),)"   'Perform action for the "type$(x)" named '"names$(x)"'"2PRINT#code,""3PRINT#code,"    'Insert your own code here"4branchLabels$=branchLabels$+" "+WORD$(branchLabel$(x),)5IFINSTR(branchLabels$,WORD$(branchLabel$(x),))>THENdoneMultiBranchLabel]8PRINT#code,""9PRINT#code,""0PRINT#code,WORD$(branchLabel$(x),)"   'Perform action for the "type$(x)" named '"names$(x)"'"1PRINT#code,""2PRINT#code,"    'Insert your own code here"3branchLabels$=branchLabels$+" "+WORD$(branchLabel$(x),)4RETURN5code$="    button "+winHandle$+", "+qu$+label$(x)+qu$+", "+branchLabel$(x)+", "+corner$(x)+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)6RETURN7code$="    bmpbutton "+winHandle$+", "+qu$+bmpName$(x)+qu$+", "+branchLabel$(x)+", "+corner$(x)+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)8RETURN9code$="    textbox "+winHandle$+"."+names$(x)+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)+", "+STR$(width(x))+", "+STR$(height(x))0RETURN1code$="    statictext "+winHandle$+"."+names$(x)+", "+qu$+label$(x)+qu$+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)+", "+STR$(width(x))+", "+STR$(height(x))2RETURN3code$="    groupbox "+winHandle$+", "+qu$+label$(x)+qu$+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)+", "+STR$(width(x))+", "+STR$(height(x))4RETURN5code$="    listbox "+winHandle$+"."+names$(x)+", "+arrayName$(x)+", "+branchLabel$(x)+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)+", "+STR$(width(x))+", "+STR$(height(x))6RETURN7code$="    combobox "+winHandle$+"."+names$(x)+", "+arrayName$(x)+", "+branchLabel$(x)+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)+", "+STR$(width(x))+", "+STR$(height(x))8RETURN9code$="    radiobutton "+winHandle$+"."+names$(x)+", "+qu$+label$(x)+qu$+", "+WORD$(branchLabel$(x),)+", "+WORD$(branchLabel$(x),)+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)+", "+STR$(width(x))+", "+STR$(height(x))0RETURN1code$="    checkbox "+winHandle$+"."+names$(x)+", "+qu$+label$(x)+qu$+", "+WORD$(branchLabel$(x),)+", "+WORD$(branchLabel$(x),)+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)+", "+STR$(width(x))+", "+STR$(height(x))2RETURN3IFisModified=THENGOSUBformIsModified]6newControlNumber=7windowLabel$="untitled"8windowType$="window"9objectCount=0winHandle$="#main"1windowXExtent=2windowYExtent=3GOSUBclearMenuData]4GOSUBaddWindowFrame]5GOSUBredrawAll]6isModified=7GOTOinputLoop]8IFobjectCount<THENNOTICE"No controls.  Save aborted":GOTOinputLoop]2IFformName$=""THENformName$="untitled.fre"5FILEDIALOG"Save form","*.fre",formName$6IFformName$=""THENinputLoop]9GOSUBsaveFormSubroutine]0NOTICE"Done.  File saved as "+formName$1GOTOinputLoop]2OPENformName$FOROUTPUTAS#formOut3PRINT#formOut,newControlNumber4PRINT#formOut,windowLabel$5PRINT#formOut,windowType$6PRINT#formOut,objectCount7PRINT#formOut,winHandle$8PRINT#formOut,snapOn9PRINT#formOut,xInterval0PRINT#formOut,yInterval1PRINT#formOut,menuCount2PRINT#formOut,windowXExtent3PRINT#formOut,windowYExtent4FORi=TOobjectCount5PRINT#formOut,type$(i)6PRINT#formOut,label$(i)7PRINT#formOut,names$(i)8PRINT#formOut,xOrg(i)9PRINT#formOut,yOrg(i)0PRINT#formOut,width(i)1PRINT#formOut,height(i)2PRINT#formOut,corner$(i)3PRINT#formOut,branchLabel$(i)4PRINT#formOut,segment(i)5PRINT#formOut,handle$(i)6PRINT#formOut,bmpName$(i)7PRINT#formOut,arrayName$(i)8NEXTi9IFmenuCount=THENnoMenusToSave]2FORi=TOmenuCount-3PRINT#formOut,menu$(i)4PRINT#formOut,menuItemCount(i)5IFmenuItemCount(i)=THENnoMenuItemsToSave]8FORj=TOmenuItemCount(i)-9PRINT#formOut,menuItem$(i,j)0NEXTj1NEXTi2CLOSE#formOut3RETURN4IFisModified=THENGOSUBformIsModified]7FILEDIALOG"Load form","*.fre",formName$8IFformName$=""THENinputLoop]1GOSUBclearMenuData]2objectCount=3GOSUBaddWindowFrame]4OPENformName$FORINPUTAS#formIn5INPUT#formIn,newControlNumber6INPUT#formIn,windowLabel$7INPUT#formIn,windowType$8INPUT#formIn,objectCount9INPUT#formIn,winHandle$0INPUT#formIn,snapOn1INPUT#formIn,xInterval2INPUT#formIn,yInterval3INPUT#formIn,menuCount4INPUT#formIn,windowXExtent5INPUT#formIn,windowYExtent6width()=windowXExtent7height()=windowYExtent8FORi=TOobjectCount9INPUT#formIn,tmp$:type$(i)=tmp$1INPUT#formIn,tmp$:label$(i)=tmp$3INPUT#formIn,tmp$:names$(i)=tmp$5INPUT#formIn,tmp:xOrg(i)=tmp7INPUT#formIn,tmp:yOrg(i)=tmp9INPUT#formIn,tmp:width(i)=tmp1INPUT#formIn,tmp:height(i)=tmp3INPUT#formIn,tmp$:corner$(i)=tmp$5INPUT#formIn,tmp$:branchLabel$(i)=tmp$7INPUT#formIn,tmp:segment(i)=tmp9INPUT#formIn,tmp$:handle$(i)=tmp$1INPUT#formIn,tmp$:bmpName$(i)=tmp$3IFTRIM$(tmp$)>""THENLOADBMPtmp$,tmp$6INPUT#formIn,tmp$:arrayName$(i)=tmp$8NEXTi9IFmenuCount=THENnoMenusToRead]2FORi=TOmenuCount-3INPUT#formIn,tmp$:menu$(i)=tmp$5INPUT#formIn,tmp:menuItemCount(i)=tmp7IFmenuItemCount(i)=THENnoMenuItemsToRead]0FORj=TOmenuItemCount(i)-1INPUT#formIn,tmp$:menuItem$(i,j)=tmp$3NEXTj4NEXTi5CLOSE#formIn6GOSUBredrawAll]7isModified=8GOTOinputLoop]9WindowWidth=0WindowHeight=1IFgridDialogIsOpen=THENCLOSE#gridDialog4STATICTEXT#gridDialog.statictext2,"Select here whether control positions will",,,,5STATICTEXT#gridDialog.statictext5,"automatically snap to gridded positions,",,,,6STATICTEXT#gridDialog.statictext6,"and what the interval will be.",,,,7CHECKBOX#gridDialog.snapOnOff,"Snap to Grid",snapOn],snapOff],,,,8STATICTEXT#gridDialog.statictext7,"X interval:",,,,9TEXTBOX#gridDialog.xIntrvl,,,,0STATICTEXT#gridDialog.statictext9,"Y interval:",,,,1TEXTBOX#gridDialog.yIntrvl,,,,2BUTTON#gridDialog,"OK",acceptGridDialog],UL,,3BUTTON#gridDialog,"Cancel",cancelGridDialog],UL,,4OPEN"Snap to Grid"FORdialogAS#gridDialog5PRINT#gridDialog,"trapclose [cancelGridDialog]"6gridDialogIsOpen=7IFsnapOn=THENsnapOnSelected=:PRINT#gridDialog.snapOnOff,"set"1PRINT#gridDialog.xIntrvl,xInterval2PRINT#gridDialog.yIntrvl,yInterval3GOTOinputLoop]4snapOnSelected=5GOTOinputLoop]6snapOnSelected=7GOTOinputLoop]8snapOn=snapOnSelected9PRINT#gridDialog.xIntrvl,"!contents?"0INPUT#gridDialog.xIntrvl,xInterval1PRINT#gridDialog.yIntrvl,"!contents?"2INPUT#gridDialog.yIntrvl,yInterval3gridDialogIsOpen=4CLOSE#gridDialog5GOTOinputLoop]6IFaddMenuIsOpen=THENCLOSE#newMenu9WindowWidth=0WindowHeight=1LISTBOX#newMenu.menuNames,menu$(,inputLoop],,,,2STATICTEXT#newMenu.statictext2,"Defined Menus",,,,3STATICTEXT#newMenu.statictext3,"Enter new menu name here:",,,,4TEXTBOX#newMenu.newMenuName,,,,5BUTTON#newMenu,"Accept",acceptNewMenu],UL,,6BUTTON#newMenu,"Cancel",cancelNewMenu],UL,,7OPEN"Add a Menu"FORdialogAS#newMenu8PRINT#newMenu,"trapclose [cancelNewMenu]"9addMenuIsOpen=0GOTOinputLoop]1CLOSE#newMenu2addMenuIsOpen=3GOTOinputLoop]4FORx=TO5menu$(x)=""6FORy=TO7menuItem$(x,y)=""8NEXTy9NEXTx0menuCount=1RETURN2PRINT#newMenu.newMenuName,"!contents?"3INPUT#newMenu.newMenuName,result$4IFresult$=""THENNOTICE"Please type a name for a new menu.":GOTOinputLoop]8CLOSE#newMenu9menu$(menuCount)=result$0menuCount=menuCount+1IFmenuCount>THENGOSUBredrawAll]:GOTOinputLoop]5IFobjectCount<THENGOSUBredrawAll]:GOTOinputLoop]9FORx=TOobjectCount0yOrg(x)=yOrg(x)+1NEXTx2GOSUBredrawAll]3addMenuIsOpen=4GOTOinputLoop]5IFmenuCount=THENNOTICE"No menus to remove.":GOTOinputLoop]9IFremoveMenuIsOpen=THENCLOSE#removeMenu2WindowWidth=3WindowHeight=4STATICTEXT#removeMenu.statictext1,"Select a menu to remove:",,,,5LISTBOX#removeMenu.menusToRemove,menu$(,acceptRemoveMenu],,,,6BUTTON#removeMenu,"Accept",acceptRemoveMenu],UL,,7BUTTON#removeMenu,"Cancel",cancelRemoveMenu],UL,,8OPEN"Remove a Menu"FORdialogAS#removeMenu9PRINT#removeMenu,"trapclose [cancelRemoveMenu]"0removeMenuIsOpen=1GOTOinputLoop]2PRINT#removeMenu.menusToRemove,"selectionIndex?"3INPUT#removeMenu.menusToRemove,result4CLOSE#removeMenu5removeMenuIsOpen=6IFresult=THENNOTICE"No item selected.  Menu not removed.":GOTOinputLoop]0menuCount=menuCount-1result=result-2IFresult=menuCountTHENmenu$(result)="":GOTOcheckForEmptyMenuBar]6FORx=resultTOmenuCount7menu$(x)=menu$(x+)8NEXTx9IFmenuCount>THENGOSUBredrawAll]:GOTOinputLoop]3FORx=TOobjectCount4yOrg(x)=yOrg(x)-5NEXTx6GOSUBredrawAll]7GOTOinputLoop]8CLOSE#removeMenu9removeMenuIsOpen=0GOTOinputLoop]1IFmenuCount=THENNOTICE"No menus to edit.":GOTOinputLoop]5IFeditMenuIsOpen=THENCLOSE#editMenu8WindowWidth=9WindowHeight=0LISTBOX#editMenu.menuList,menu$(,selectMenuToEdit],,,,1LISTBOX#editMenu.menuItems,menuItemLocal$(,selectMenuItemToEdit],,,,2STATICTEXT#editMenu.statictext6,"Menus:",,,,3STATICTEXT#editMenu.statictext14,"Menu line items -> Branch labels:",,,,4BUTTON#editMenu,"&Close",closeMenuEdit],UL,,5BUTTON#editMenu,"&New Item",addNewMenuItem],UL,,6BUTTON#editMenu,"&Edit",editMenuItem],UL,,7BUTTON#editMenu,"Move &Up",oveMenuItemUp],UL,,8BUTTON#editMenu,"&Move Dn",oveMenuItemDown],UL,,9BUTTON#editMenu,"&Delete",deleteMenuItem],UL,,0BUTTON#editMenu,"&To Top",oveMenuToTop],UL,,1OPEN"Edit Menus"FORdialogAS#editMenu2PRINT#editMenu,"trapclose [closeMenuEdit]"3PRINT#editMenu.menuList,"singleclickselect"4PRINT#editMenu.menuItems,"singleclickselect"5editMenuIsOpen=6menuItemIndex=7result=8GOTOinputLoop]9PRINT#editMenu.menuList,"selectionIndex?"0INPUT#editMenu.menuList,result1FORx=TO2mil$=menuItem$(result-one,x)3IFmil$<>""THENmil$=LEFT$(mil$,INSTR(mil$,CHR$())-)+" -> "+MID$(mil$,INSTR(mil$,CHR$())+)6menuItemLocal$(x)=mil$7NEXTx8PRINT#editMenu.menuItems,"reload"9menuItemIndex=0GOTOinputLoop]1IFresult=ORresult=THENinputLoop]4menu$()=menu$(result-one)5FORx=TO6menuItem$(,x)=menuItem$(result-one,x)7NEXTx8FORx=result-TOSTEP-19menu$(x)=menu$(x-one)0FORy=TO1menuItem$(x,y)=menuItem$(x-one,y)2NEXTy3NEXTx4menu$()=menu$()5menu$()=""6FORx=TO7menuItem$(,x)=menuItem$(,x)8menuItem$(,x)=""9NEXTx0PRINT#editMenu.menuList,"reload"1PRINT#editMenu.menuList,"selectIndex 1"2result=3PRINT#editMenu.menuItems,"selectionIndex?"4INPUT#editMenu.menuItems,menuItemIndex5GOTOinputLoop]6IFresult=THENinputLoop]9IFeditMenuItemIsOpen=THENGOSUBcloseEditMenuItem]2menuItemCount(result-one)=menuItemCount(result-one)+3menuItemIndex=menuItemCount(result-one)4editMenuItemAction$="ADD"5GOTOeditMenuItemProperties]6IFmenuItemIndex=THENinputLoop]9IFeditMenuItemIsOpen=THENGOSUBcloseEditMenuItem]2editMenuItemAction$="EDIT"3GOTOeditMenuItemProperties]4IFmenuItemIndex=ORmenuItemIndex=THENinputLoop]7tmpMi$=menuItem$(result-one,menuItemIndex-one)8menuItem$(result-one,menuItemIndex-one)=menuItem$(result-one,menuItemIndex-(*one))9menuItem$(result-one,menuItemIndex-(*one))=tmpMi$0GOSUBreloadLocalMenuItems]1menuItemIndex=menuItemIndex-2PRINT#editMenu.menuItems,"selectIndex "menuItemIndex3GOTOinputLoop]4IFresult=THENinputLoop]7IFmenuItemIndex=menuItemCount(result-one)ORmenuItemIndex=THENinputLoop]0tmpMi$=menuItem$(result-one,menuItemIndex-one)1menuItem$(result-one,menuItemIndex-one)=menuItem$(result-one,menuItemIndex)2menuItem$(result-one,menuItemIndex)=tmpMi$3GOSUBreloadLocalMenuItems]4menuItemIndex=menuItemIndex+5PRINT#editMenu.menuItems,"selectIndex "menuItemIndex6GOTOinputLoop]7IFresult=THENinputLoop]0IFmenuItemCount(result-one)=ORmenuItemIndex=THENinputLoop]3FORx=menuItemIndexTO4menuItem$(result-one,x-one)=menuItem$(result-one,x)5NEXTx6GOSUBreloadLocalMenuItems]7menuItemIndex=8RETURN9FORx=TO0mil$=menuItem$(result-one,x)1IFmil$<>""THENmil$=LEFT$(mil$,INSTR(mil$,CHR$())-)+" -> "+MID$(mil$,INSTR(mil$,CHR$())+)4menuItemLocal$(x)=mil$5NEXTx6PRINT#editMenu.menuItems,"reload"7RETURN8FORx=TO:menuItemLocal$(x)="":NEXTx1CLOSE#editMenu2editMenuIsOpen=3GOTOinputLoop]4WindowWidth=5WindowHeight=6TEXTBOX#menuItems.name,,,,7TEXTBOX#menuItems.branchLabel,,,,8STATICTEXT#menuItems.statictext6,"Name:",,,,9STATICTEXT#menuItems.statictext7,"Branch Label:",,,,0BUTTON#menuItems,"Accept",acceptMenuItemProps],UL,,1BUTTON#menuItems,"Cancel",cancelMenuItemProps],UL,,2OPEN"Menu Item Properties"FORdialogAS#menuItems3editMenuItemIsOpen=4PRINT#menuItems.name,"???"5PRINT#menuItems.branchLabel,"[???]"6IFmenuItem$(result-one,menuItemIndex-one)=""THENinputLoop]9mi$=menuItem$(result-one,menuItemIndex-one)0PRINT#menuItems.name,LEFT$(mi$,INSTR(mi$,CHR$())-one)1PRINT#menuItems.branchLabel,MID$(mi$,INSTR(mi$,CHR$())+)2GOTOinputLoop]3PRINT#menuItems.name,"!contents?"4INPUT#menuItems.name,nResult$5PRINT#menuItems.branchLabel,"!contents?"6INPUT#menuItems.branchLabel,blResult$7IFnResult$=""ORblResult$=""THENNOTICE"Bad menu item properties.":GOTOinputLoop]1blr$=blResult$2IFLEFT$(blResult$,)<>"["THENblResult$="["+blResult$5IFRIGHT$(blResult$,)<>"]"THENblResult$=blResult$+"]"8IFblr$<>blResult$THENNOTICE"Branch Label was "+blr$+", defaulting to "+blResult$1menuItem$(result-one,menuItemIndex-one)=nResult$+CHR$()+blResult$2menuItemLocal$(menuItemIndex-one)=nResult$+" -> "+blResult$3CLOSE#menuItems4editMenuItemIsOpen=5PRINT#editMenu.menuItems,"reload"6GOTOinputLoop]7GOSUBcloseEditMenuItem]8GOTOinputLoop]9CLOSE#menuItems0IFeditMenuItemAction$="ADD"THENmenuItemCount(result-one)=menuItemCount(result-one)-3editMenuItemIsOpen=4RETURN5isModified=6IFobjectCount<THENRETURN9CONFIRM"Save changes to "+formName$+"?"answer$0IFanswer$="yes"THENGOSUBsaveFormSubroutine]3RETURN4IFisModified=THENGOSUBformIsModified]7CLOSE#form8IFcodeIsOpenTHENCLOSE#code1END