home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lb091.zip / FF12.TKN < prev    next >
Text File  |  1995-10-20  |  65KB  |  1 lines

  1. type$(xOrg(corner$(yOrg(names$(segment(menuItem$(height(winType$(width(menu$(arrayName$(branchLabel$(bmpName$(menuItemLocal$(label$(menuItemCount(handle$(renderComboBox]codeForCheckBox]0displayOrderingReset]3renderTextEdit]addBmpButton]doneMultiBranchLabel]3cancelRemoveMenu]3noMenuItemsToSave]2acceptMenuItemProps]8cancelInspect]clearMenuData]0enuCode]2deleteControl]9addTextEdit]inspectControl]renderTextBox]noHotKey]addGroupBox]changeHandle]noMenusToSave]3acceptWinType]changeTitle]oveToBack]addRadioButton]nextMultiBranchLabel]2deselectOnly]codeForBmpButton]6editMenus]6loadIniFile]2setUpWindowAndOpenIt]determineControl]doneProducingCode]9dontDeselect]saveIniFile]5codeForGroupBox]2drawMenus]addWindowFrame]cancelNewMenu]8acceptGridDialog]9acceptResizing]settingsDialog]9noMenuCode]2produceCode]5creationInspectSet]7selectControl]produceOutline]6snapXY]renderCheckBox]codeForTextEdit]2closeMenuEdit]3setForSelection]addNewMenuItem]1deselect]acceptRemoveMenu]7oveToFront]1setUpMovementEvent]snapOff]7additionalResizes]selectDeselect]codeForListBox]4cancelMenuItemProps]2settingsCancel]0redrawNext]outlineForMenus]8renderGroupBox]openFile]5nextOutlineObject]7settings.inputLoop]5deleteMenuItem]2addField]oveMenuItemUp]9addButton]saveFormSubroutine]3acceptNewMenu]8acceptMovement]renderListBox]codeForComboBox]6noResizingFrame]addStaticText]codeForTextBox]8cancelGridDialog]4codeForStaticText]0editMenuItem]1produceNextMenu]1renderBmpButton]selectMenuItemToEdit]8writeNextMenuItem]7creationInspectClear]9codeForRadioButton]8addAMenu]7codeForButton]4snapWH]noMenuItemsToRead]5reloadLocalMenuItems]4addCheckBox]oveMenuToTop]6addListBox]skipControl]formIsModified]0writeNextMenu]8saveFile]9resizeControl]acceptInspect]handleMultiBranchLabels]1produceCodeAndOutline]4renderButton]renderRadioButton]settingsAccept]5renderWindow]noMenusToRead]6drawSizingHandle]dontDrawMenus]changeWindowType]beginObjectMove]snapOn]5inputLoop]renderStaticText]closeEditMenuItem]4cancelWinType]addComboBox]selectWinType]selectMenuToEdit]4additionalObjectMoves]displayOrderingSet]1gridDialog]0redrawAll]removeMenu]0quit]3createOrderMarker]eraseObjectFrame]newFile]4drawTheWindow]checkForEmptyMenuBar]4oveMenuItemDown]9editMenuItemProperties]9snapMouse]falsed:\VSO301\FF12.tkn2DIMtype$()DIMlabel$()DIMnames$()DIMxOrg()DIMyOrg()DIMwidth()DIMheight()DIMcorner$()DIMbranchLabel$()DIMsegment()DIMhandle$()DIMbmpName$()DIMarrayName$()DIMmenu$()DIMmenuItem$(,)DIMmenuItemLocal$()DIMmenuItemCount()DIMwinType$()index=resizeable$=" combobox textbox listbox groupbox windowframe textedit button "newControlNumber=qu$=CHR$()controlsThatBranch$=" button listbox combobox bmpbutton checkbox radiobutton "snapOn=xInterval=yInterval=createInspect=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"winType$()="dialog_modal"winType$()="dialog_nf_modal"winType$()="graphics"winType$()="graphics_nsb"winType$()="graphics_nf_nsb"GOSUBloadIniFile]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],"&Settings",settingsDialog]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,,BMPBUTTON#form,"tedtbttn.bmp",addTextEdit],UL,,OPEN"FreeForm v1.2 for Liberty BASIC"FORgraphics_fs_nsbAS#formIFPlatform$="OS/2"THENPRINT#form,"font systemmonospaced 8 12"IFPlatform$="Windows"THENPRINT#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)=label$(idx)=text$width(idx)=*(LEN(label$(idx)))+height(idx)=+type$(idx)="button"names$(idx)="button"+STR$(newControlNumber)corner$(idx)="UL"branchLabel$(idx)="["+names$(idx)+"Click]"GOSUBrenderButton]IFcreateInspectTHENGOSUBdeselectOnly]:index=idx:GOSUBselectDeselect]:GOTOinspectControl]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]IFcreateInspectTHENGOSUBdeselectOnly]:index=idx:GOSUBselectDeselect]:GOTOinspectControl]GOTOinputLoop]newControlNumber=newControlNumber+objectCount=objectCount+idx=objectCountxOrg(idx)=yOrg(idx)=width(idx)=height(idx)=type$(idx)="textbox"names$(idx)="textbox"+STR$(newControlNumber)GOSUBrenderTextBox]IFcreateInspectTHENGOSUBdeselectOnly]:index=idx:GOSUBselectDeselect]:GOTOinspectControl]GOTOinputLoop]newControlNumber=newControlNumber+objectCount=objectCount+idx=objectCountxOrg(idx)=yOrg(idx)=width(idx)=height(idx)=type$(idx)="textedit"names$(idx)="textedit"+STR$(newControlNumber)GOSUBrenderTextEdit]IFcreateInspectTHENGOSUBdeselectOnly]:index=idx:GOSUBselectDeselect]:GOTOinspectControl]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]IFcreateInspectTHENGOSUBdeselectOnly]:index=idx:GOSUBselectDeselect]:GOTOinspectControl]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]IFcreateInspectTHENGOSUBdeselectOnly]:index=idx:GOSUBselectDeselect]:GOTOinspectControl]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)=label$(idx)=text$width(idx)=*LEN(label$(idx))height(idx)=type$(idx)="statictext"names$(idx)="statictext"+STR$(newControlNumber)corner$(idx)=""GOSUBrenderStaticText]IFcreateInspectTHENGOSUBdeselectOnly]:index=idx:GOSUBselectDeselect]:GOTOinspectControl]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]IFcreateInspectTHENGOSUBdeselectOnly]:index=idx:GOSUBselectDeselect]:GOTOinspectControl]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]IFcreateInspectTHENGOSUBdeselectOnly]:index=idx:GOSUBselectDeselect]:GOTOinspectControl]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)+"Set] ["+names$(idx)+"Reset]"GOSUBrenderCheckBox]IFcreateInspectTHENGOSUBdeselectOnly]:index=idx:GOSUBselectDeselect]:GOTOinspectControl]GOTOinputLoop]INPUTr$GOTOinputLoop]xOrg=windowXOriginyOrg=windowYOriginxExt=windowXExtentyExt=windowYExtentPRINT#form,"cls"PRINT#form,"backcolor white ; color black ; down ; size 1"PRINT#form,"place "xOrg+" "yOrg+IFPlatform$="OS/2"THENPRINT#form,"backcolor lightgray"PRINT#form,"boxfilled "xOrg+xExt-" "yOrg+yExt-IFINSTR(windowType$,"_nf")>THENnoResizingFrame]PRINT#form,"color lightgray ; size 3"IFPlatform$="OS/2"THENPRINT#form,"color yellow"IFwindowType$="dialog"THENPRINT#form,"color darkgray"IFwindowType$="dialog"ANDPlatform$="OS/2"THENPRINT#form,"color darkcyan"PRINT#form,"place "xOrg+" "yOrg+PRINT#form,"box "xOrg+xExt-" "yOrg+yExt-PRINT#form,"color black ; backcolor white ; 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"IFPlatform$="OS/2"THENPRINT#form,"color darkgray ; backcolor darkcyan"PRINT#form,"place "+xOrg" "+yOrgPRINT#form,"boxfilled "xOrg+xExt-" "+yOrg+PRINT#form,"place "INT(xExt/)+xOrg-LEN(windowLabel$)*" "+yOrgIFPlatform$="OS/2"THENPRINT#form,"place "+xOrg" "+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"IFwindowType$="dialog"ANDPlatform$="OS/2"THENPRINT#form,"color darkgray"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"IFPlatform$="Windows"THENPRINT#form,"place "+xOrg" "+yOrgIFPlatform$="OS/2"THENPRINT#form,"color darkgray ; 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"IFPlatform$="OS/2"THENPRINT#form,"backcolor palegray"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"RETURNnewWindowLabel$=windowLabel$PROMPT"Specify the window's title"newWindowLabel$IFnewWindowLabel$<>""THENwindowLabel$=newWindowLabel$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"FORdialog_modalAS#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"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+INT((width(idx)-LEN(label$(idx))*)/)" "yOrgIdx+INT((height(idx)-)/)+PRINT#form,"\"label$(idx)GOSUBcreateOrderMarker]PRINT#form,orderMarker1$PRINT#form,orderMarker2$PRINT#form,"up ; flush"PRINT#form,"segment":INPUT#form,idsegment(idx)=idRETURNtype$(idx)="statictext"PRINT#form,"place "xOrg(idx)" "yOrg(idx)+-" ; place "xOrg(idx)" "yOrg(idx)+-PRINT#form,"down ; color black ; backcolor white"IFPlatform$="OS/2"THENPRINT#form,"backcolor palegray"PRINT#form,"\"label$(idx)GOSUBcreateOrderMarker]PRINT#form,orderMarker1$PRINT#form,orderMarker2$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"IFPlatform$="OS/2"THENPRINT#form,"backcolor palegray"PRINT#form,"place "xOrg(idx)+" "yOrg(idx)+-PRINT#form,"\"label$(idx)GOSUBcreateOrderMarker]PRINT#form,orderMarker1$PRINT#form,orderMarker2$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"IFPlatform$="OS/2"THENPRINT#form,"backcolor palegray"PRINT#form,"place "xOrg(idx)+" "yOrg(idx)+-PRINT#form,"\"label$(idx)GOSUBcreateOrderMarker]PRINT#form,orderMarker1$PRINT#form,orderMarker2$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)GOSUBcreateOrderMarker]PRINT#form,"down ; "orderMarker1$PRINT#form,orderMarker2$PRINT#form,"up ; 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)GOSUBcreateOrderMarker]PRINT#form,orderMarker1$PRINT#form,orderMarker2$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)GOSUBcreateOrderMarker]PRINT#form,orderMarker1$PRINT#form,orderMarker2$PRINT#form,"up ; flush"PRINT#form,"segment":INPUT#form,idsegment(idx)=idRETURNtype$(idx)="textedit"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,"place "xOrg(idx)" "yOrg(idx)+height(idx)-PRINT#form,"boxfilled "xOrg(idx)+width(idx)" "yOrg(idx)+height(idx)PRINT#form,"drawbmp scrollLeft "xOrg(idx)" "yOrg(idx)+height(idx)-PRINT#form,"drawbmp scrollRight "xOrg(idx)+width(idx)-" "yOrg(idx)+height(idx)-GOSUBcreateOrderMarker]PRINT#form,orderMarker1$PRINT#form,orderMarker2$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)-GOSUBcreateOrderMarker]PRINT#form,orderMarker1$PRINT#form,orderMarker2$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"IFPlatform$="OS/2"THENPRINT#form,"backcolor palegray"PRINT#form,"down ; boxfilled "xOrg(idx)+width(idx)-" "yOrg(idx)+height(idx)-PRINT#form,"place "xOrg(idx)+" "yOrg(idx)+PRINT#form,"\"label$(idx)GOSUBcreateOrderMarker]PRINT#form,orderMarker1$PRINT#form,orderMarker2$PRINT#form,"up ; flush"PRINT#form,"segment":INPUT#form,idsegment(idx)=idRETURNorderMarker1$=""orderMarker2$=""IFdisplayOrdering=THENRETURNorderMarker1$="color white ; backcolor black ; place "+STR$(xOrg(idx)-)+" "+STR$(yOrg(idx)+)orderMarker2$="\"+STR$(idx-)RETURNIFindex<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 = not",,,,STATICTEXT#inspect.statictext16,"applicable",,,,OPEN"Modify Control"FORdialog_modalAS#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,selectIdRETURNIFindex=THENRETURNPRINT#form,"delsegment "selectId-GOSUBselectDeselect]index=PRINT#form,"delsegment "selectId-RETURNIFABS(MouseX-x)<ANDABS(MouseY-y)<THENinputLoop]PRINT#form,"delsegment "selectId-PRINT#form,"when leftButtonMove [additionalObjectMoves]"PRINT#form,"when leftButtonUp [acceptMovement]"GOSUBsnapMouse]IFMouseX=lastMouseXANDMouseY=lastMouseYTHENinputLoop]GOSUBeraseObjectFrame]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]:GOTOredrawNext]IFtypeIdx$="textedit"THENGOSUBrenderTextEdit]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)0corner$(idx+)=corner$(idx)1branchLabel$(idx+)=branchLabel$(idx)2segment(idx+)=segment(idx)3handle$(idx+)=handle$(idx)4bmpName$(idx+)=bmpName$(idx)5NEXTidx6type$()=tmpType$7label$()=tmpLabel$8names$()=tmpNames$9xOrg()=tmpXOrigin0yOrg()=tmpYOrigin1width()=tmpWidth2height()=tmpHeight3corner$()=tmpCorner$4branchLabel$()=tmpBranchLabel$5segment()=tmpSegment6handle$()=tmpHandle$7bmpName$()=tmpBmpName$8GOSUBredrawAll]9index=0GOTOinputLoop]1IFindex<ORobjectCount<THENinputLoop]4IFindex=objectCountTHENGOSUBredrawAll]:GOTOinputLoop]8tmpType$=type$(index)9tmpLabel$=label$(index)0tmpNames$=names$(index)1tmpXOrigin=xOrg(index)2tmpYOrigin=yOrg(index)3tmpWidth=width(index)4tmpHeight=height(index)5tmpCorner$=corner$(index)6tmpBranchLabel$=branchLabel$(index)7tmpSegment=segment(index)8tmpHandle$=handle$(index)9tmpBmpName$=bmpName$(index)0FORidx=indexTOobjectCount-1type$(idx)=type$(idx+)2label$(idx)=label$(idx+)3names$(idx)=names$(idx+)4xOrg(idx)=xOrg(idx+)5yOrg(idx)=yOrg(idx+)6width(idx)=width(idx+)7height(idx)=height(idx+)8corner$(idx)=corner$(idx+)9branchLabel$(idx)=branchLabel$(idx+)0segment(idx)=segment(idx+)1handle$(idx)=handle$(idx+)2bmpName$(idx)=bmpName$(idx+)3NEXTidx4type$(objectCount)=tmpType$5label$(idx)=tmpLabel$6names$(objectCount)=tmpNames$7xOrg(objectCount)=tmpXOrigin8yOrg(objectCount)=tmpYOrigin9width(objectCount)=tmpWidth0height(objectCount)=tmpHeight1corner$(objectCount)=tmpCorner$2branchLabel$(objectCount)=tmpBranchLabel$3segment(objectCount)=tmpSegment4handle$(objectCount)=tmpHandle$5bmpName$(objectCount)=tmpBmpName$6GOSUBredrawAll]7GOSUBselectDeselect]8GOTOinputLoop]9IFindex<THENinputLoop]2PRINT#form,"delsegment "selectId-3GOSUBselectDeselect]4PRINT#form,"delsegment "selectId-5FORidx=indexTOobjectCount6type$(idx)=type$(idx+)7label$(idx)=label$(idx+)8names$(idx)=names$(idx+)9xOrg(idx)=xOrg(idx+)0yOrg(idx)=yOrg(idx+)1width(idx)=width(idx+)2height(idx)=height(idx+)3corner$(idx)=corner$(idx+)4branchLabel$(idx)=branchLabel$(idx+)5segment(idx)=segment(idx+)6handle$(idx)=handle$(idx+)7bmpName$(idx)=bmpName$(idx+)8arrayName$(idx)=arrayName$(idx+)9NEXTidx0objectCount=objectCount-1GOSUBredrawAll]2index=3GOTOinputLoop]4produceOutline=5IFcodeIsOpen=THENCLOSE#code:codeIsOpen=9OPEN"Free Form output window"FORtextAS#code0codeIsOpen=1PRINT#code,""2PRINT#code,""3PRINT#code,"    WindowWidth = "windowXExtent4PRINT#code,"    WindowHeight = "windowYExtent5PRINT#code,""6IFobjectCount<THENenuCode]9FORx=TOobjectCount0IFtype$(x)="button"THENGOSUBcodeForButton]3IFtype$(x)="combobox"THENGOSUBcodeForComboBox]6IFtype$(x)="textbox"THENGOSUBcodeForTextBox]9IFtype$(x)="listbox"THENGOSUBcodeForListBox]2IFtype$(x)="bmpbutton"THENGOSUBcodeForBmpButton]5IFtype$(x)="statictext"THENGOSUBcodeForStaticText]8IFtype$(x)="radiobutton"THENGOSUBcodeForRadioButton]1IFtype$(x)="checkbox"THENGOSUBcodeForCheckBox]4IFtype$(x)="groupbox"THENGOSUBcodeForGroupBox]7IFtype$(x)="textedit"THENGOSUBcodeForTextEdit]0PRINT#code,code$1NEXTx2IFmenuCount=THENnoMenuCode]5IFLEFT$(windowType$,)="dialog"THENPRINT#code,"    '*** menus are not supported in windows of type "windowType$" ***"8FORx=TOmenuCount-9PRINT#code,"    menu "winHandle$", "qu$menu$(x)qu$0IFmenuItemCount(x)=THENPRINT#code,", "CHR$()"&FixMe"CHR$()", [fixMe]  ' <-- this menu has no items!":GOTOproduceNextMenu]4FORy=TOmenuItemCount(x)-5PRINT#code,", "6mi$=menuItem$(x,y)7PRINT#code,qu$LEFT$(mi$,INSTR(mi$,CHR$())-)qu$8PRINT#code,", "MID$(mi$,INSTR(mi$,CHR$())+)9NEXTy0PRINT#code,""1NEXTx2PRINT#code,"    open "qu$windowLabel$qu$" for "windowType$" as "winHandle$3IFproduceOutline=THENdoneProducingCode]6inputLoopLabel$="["+MID$(winHandle$,)+".inputLoop]"7PRINT#code,""8PRINT#code,""9PRINT#code,inputLoopLabel$"   'wait here for input event"0PRINT#code,"    input aVar$"1PRINT#code,"    goto "inputLoopLabel$2PRINT#code,""3produceOutline=4branchLabels$=""5IFobjectCount<THENoutlineForMenus]8FORx=TOobjectCount9IFLEFT$(TRIM$(branchLabel$(x)),)<>"["THENnextOutlineObject]2IFINSTR(TRIM$(branchLabel$(x))," ")>THENGOSUBhandleMultiBranchLabels]:GOTOnextOutlineObject]6IFINSTR(branchLabels$,branchLabel$(x))>THENnextOutlineObject]9branchLabels$=branchLabels$+" "+branchLabel$(x)0PRINT#code,""1PRINT#code,""2PRINT#code,branchLabel$(x)"   'Perform action for the "type$(x)" named '"names$(x)"'"3PRINT#code,""4PRINT#code,"    'Insert your own code here"5PRINT#code,""6PRINT#code,"    goto "inputLoopLabel$7NEXTx8IFmenuCount=THENdoneProducingCode]1FORx=TOmenuCount-2IFmenuItemCount(x)=THENwriteNextMenu]5FORy=TOmenuItemCount(x)-6mi$=menuItem$(x,y)7bl$=MID$(mi$,INSTR(mi$,CHR$())+)8IFINSTR(branchLabels$,bl$)>THENwriteNextMenuItem]1branchLabels$=branchLabels$+" "+bl$2PRINT#code,""3PRINT#code,""4PRINT#code,bl$"   'Perform action for menu "menu$(x)", item "LEFT$(mi$,INSTR(mi$,CHR$())-)5PRINT#code,""6PRINT#code,"    'Insert your own code here"7NEXTy8NEXTx9NOTICE"Done.  Copy this code into your program."0GOTOinputLoop]1IFINSTR(branchLabels$,WORD$(branchLabel$(x),))>THENnextMultiBranchLabel]4PRINT#code,""5PRINT#code,""6PRINT#code,WORD$(branchLabel$(x),)"   'Perform action for the "type$(x)" named '"names$(x)"'"7PRINT#code,""8PRINT#code,"    'Insert your own code here"9PRINT#code,""0PRINT#code,"    goto "inputLoopLabel$1branchLabels$=branchLabels$+" "+WORD$(branchLabel$(x),)2IFINSTR(branchLabels$,WORD$(branchLabel$(x),))>THENdoneMultiBranchLabel]5PRINT#code,""6PRINT#code,""7PRINT#code,WORD$(branchLabel$(x),)"   'Perform action for the "type$(x)" named '"names$(x)"'"8PRINT#code,""9PRINT#code,"    'Insert your own code here"0PRINT#code,""1PRINT#code,"    goto "inputLoopLabel$2branchLabels$=branchLabels$+" "+WORD$(branchLabel$(x),)3RETURN4code$="    button "+winHandle$+", "+qu$+label$(x)+qu$+", "+branchLabel$(x)+", "+corner$(x)+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)+", "+STR$(width(x))+", "+STR$(height(x))5RETURN6code$="    bmpbutton "+winHandle$+", "+qu$+bmpName$(x)+qu$+", "+branchLabel$(x)+", "+corner$(x)+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)7RETURN8code$="    textbox "+winHandle$+"."+names$(x)+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)+", "+STR$(width(x))+", "+STR$(height(x))9RETURN0code$="    statictext "+winHandle$+"."+names$(x)+", "+qu$+label$(x)+qu$+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)+", "+STR$(width(x))+", "+STR$(height(x))1RETURN2code$="    groupbox "+winHandle$+", "+qu$+label$(x)+qu$+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)+", "+STR$(width(x))+", "+STR$(height(x))3RETURN4code$="    listbox "+winHandle$+"."+names$(x)+", "+arrayName$(x)+", "+branchLabel$(x)+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)+", "+STR$(width(x))+", "+STR$(height(x))5RETURN6code$="    combobox "+winHandle$+"."+names$(x)+", "+arrayName$(x)+", "+branchLabel$(x)+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)+", "+STR$(width(x))+", "+STR$(height(x))7RETURN8code$="    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))9RETURN0code$="    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))1RETURN2code$="    texteditor "+winHandle$+"."+names$(x)+", "+STR$(xOrg(x)-xOrg-)+", "+STR$(yOrg(x)-yOrg--)+", "+STR$(width(x))+", "+STR$(height(x))3RETURN4IFisModified=THENGOSUBformIsModified]7newControlNumber=8windowLabel$="untitled"9windowType$="window"0objectCount=1winHandle$="#main"2windowXExtent=3windowYExtent=4GOSUBclearMenuData]5GOSUBaddWindowFrame]6GOSUBredrawAll]7isModified=8GOTOinputLoop]9IFobjectCount<THENNOTICE"No controls.  Save aborted":GOTOinputLoop]3IFformName$=""THENformName$="untitled.fre"6FILEDIALOG"Save form","*.fre",formName$7IFformName$=""THENinputLoop]0GOSUBsaveFormSubroutine]1NOTICE"Done.  File saved as "+formName$2GOTOinputLoop]3OPENformName$FOROUTPUTAS#formOut4PRINT#formOut,newControlNumber5PRINT#formOut,windowLabel$6PRINT#formOut,windowType$7PRINT#formOut,objectCount8PRINT#formOut,winHandle$9PRINT#formOut,snapOn0PRINT#formOut,xInterval1PRINT#formOut,yInterval2PRINT#formOut,menuCount3PRINT#formOut,windowXExtent4PRINT#formOut,windowYExtent5FORi=TOobjectCount6PRINT#formOut,type$(i)7PRINT#formOut,label$(i)8PRINT#formOut,names$(i)9PRINT#formOut,xOrg(i)0PRINT#formOut,yOrg(i)1PRINT#formOut,width(i)2PRINT#formOut,height(i)3PRINT#formOut,corner$(i)4PRINT#formOut,branchLabel$(i)5PRINT#formOut,segment(i)6PRINT#formOut,handle$(i)7PRINT#formOut,bmpName$(i)8PRINT#formOut,arrayName$(i)9NEXTi0IFmenuCount=THENnoMenusToSave]3FORi=TOmenuCount-4PRINT#formOut,menu$(i)5PRINT#formOut,menuItemCount(i)6IFmenuItemCount(i)=THENnoMenuItemsToSave]9FORj=TOmenuItemCount(i)-0PRINT#formOut,menuItem$(i,j)1NEXTj2NEXTi3CLOSE#formOut4RETURN5IFisModified=THENGOSUBformIsModified]8FILEDIALOG"Load form","*.fre",formName$9IFformName$=""THENinputLoop]2GOSUBclearMenuData]3objectCount=4GOSUBaddWindowFrame]5OPENformName$FORINPUTAS#formIn6INPUT#formIn,newControlNumber7INPUT#formIn,windowLabel$8INPUT#formIn,windowType$9INPUT#formIn,objectCount0INPUT#formIn,winHandle$1INPUT#formIn,snapOn2INPUT#formIn,xInterval3INPUT#formIn,yInterval4INPUT#formIn,menuCount5INPUT#formIn,windowXExtent6INPUT#formIn,windowYExtent7width()=windowXExtent8height()=windowYExtent9FORi=TOobjectCount0INPUT#formIn,tmp$:type$(i)=tmp$2INPUT#formIn,tmp$:label$(i)=tmp$4INPUT#formIn,tmp$:names$(i)=tmp$6INPUT#formIn,tmp:xOrg(i)=tmp8INPUT#formIn,tmp:yOrg(i)=tmp0INPUT#formIn,tmp:width(i)=tmp2INPUT#formIn,tmp:height(i)=tmp4INPUT#formIn,tmp$:corner$(i)=tmp$6INPUT#formIn,tmp$:branchLabel$(i)=tmp$8INPUT#formIn,tmp:segment(i)=tmp0INPUT#formIn,tmp$:handle$(i)=tmp$2INPUT#formIn,tmp$:bmpName$(i)=tmp$4IFTRIM$(tmp$)>""THENLOADBMPtmp$,tmp$7INPUT#formIn,tmp$:arrayName$(i)=tmp$9NEXTi0IFmenuCount=THENnoMenusToRead]3FORi=TOmenuCount-4INPUT#formIn,tmp$:menu$(i)=tmp$6INPUT#formIn,tmp:menuItemCount(i)=tmp8IFmenuItemCount(i)=THENnoMenuItemsToRead]1FORj=TOmenuItemCount(i)-2INPUT#formIn,tmp$:menuItem$(i,j)=tmp$4NEXTj5NEXTi6CLOSE#formIn7GOSUBredrawAll]8isModified=9GOTOinputLoop]0WindowWidth=1WindowHeight=2IFgridDialogIsOpen=THENCLOSE#gridDialog5STATICTEXT#gridDialog.statictext2,"Select here whether control positions will",,,,6STATICTEXT#gridDialog.statictext5,"automatically snap to gridded positions,",,,,7STATICTEXT#gridDialog.statictext6,"and what the interval will be.",,,,8CHECKBOX#gridDialog.snapOnOff,"Snap to Grid",snapOn],snapOff],,,,9STATICTEXT#gridDialog.statictext7,"X interval:",,,,0TEXTBOX#gridDialog.xIntrvl,,,,1STATICTEXT#gridDialog.statictext9,"Y interval:",,,,2TEXTBOX#gridDialog.yIntrvl,,,,3BUTTON#gridDialog,"OK",acceptGridDialog],UL,,4BUTTON#gridDialog,"Cancel",cancelGridDialog],UL,,5OPEN"Snap to Grid"FORdialog_modalAS#gridDialog6PRINT#gridDialog,"trapclose [cancelGridDialog]"7gridDialogIsOpen=8IFsnapOn=THENsnapOnSelected=:PRINT#gridDialog.snapOnOff,"set"2PRINT#gridDialog.xIntrvl,xInterval3PRINT#gridDialog.yIntrvl,yInterval4GOTOinputLoop]5snapOnSelected=6GOTOinputLoop]7snapOnSelected=8GOTOinputLoop]9snapOn=snapOnSelected0PRINT#gridDialog.xIntrvl,"!contents?"1INPUT#gridDialog.xIntrvl,xInterval2PRINT#gridDialog.yIntrvl,"!contents?"3INPUT#gridDialog.yIntrvl,yInterval4gridDialogIsOpen=5CLOSE#gridDialog6GOTOinputLoop]7WindowWidth=8WindowHeight=9LISTBOX#newMenu.menuNames,menu$(,inputLoop],,,,0STATICTEXT#newMenu.statictext2,"Defined Menus",,,,1STATICTEXT#newMenu.statictext3,"Enter new menu name here:",,,,2TEXTBOX#newMenu.newMenuName,,,,3BUTTON#newMenu,"Accept",acceptNewMenu],UL,,4BUTTON#newMenu,"Cancel",cancelNewMenu],UL,,5OPEN"Add a Menu"FORdialog_modalAS#newMenu6PRINT#newMenu,"trapclose [cancelNewMenu]"7GOTOinputLoop]8CLOSE#newMenu9GOTOinputLoop]0FORx=TO1menu$(x)=""2FORy=TO3menuItem$(x,y)=""4NEXTy5NEXTx6menuCount=7RETURN8PRINT#newMenu.newMenuName,"!contents?"9INPUT#newMenu.newMenuName,result$0IFresult$=""THENNOTICE"Please type a name for a new menu.":GOTOinputLoop]4CLOSE#newMenu5menu$(menuCount)=result$6menuCount=menuCount+7IFmenuCount>THENGOSUBredrawAll]:GOTOinputLoop]1IFobjectCount<THENGOSUBredrawAll]:GOTOinputLoop]5FORx=TOobjectCount6yOrg(x)=yOrg(x)+7NEXTx8GOSUBredrawAll]9GOTOinputLoop]0IFmenuCount=THENNOTICE"No menus to remove.":GOTOinputLoop]4IFremoveMenuIsOpen=THENCLOSE#removeMenu7WindowWidth=8WindowHeight=9STATICTEXT#removeMenu.statictext1,"Select a menu to remove:",,,,0LISTBOX#removeMenu.menusToRemove,menu$(,acceptRemoveMenu],,,,1BUTTON#removeMenu,"Accept",acceptRemoveMenu],UL,,2BUTTON#removeMenu,"Cancel",cancelRemoveMenu],UL,,3OPEN"Remove a Menu"FORdialog_modalAS#removeMenu4PRINT#removeMenu,"trapclose [cancelRemoveMenu]"5removeMenuIsOpen=6GOTOinputLoop]7PRINT#removeMenu.menusToRemove,"selectionIndex?"8INPUT#removeMenu.menusToRemove,result9CLOSE#removeMenu0removeMenuIsOpen=1IFresult=THENNOTICE"No item selected.  Menu not removed.":GOTOinputLoop]5menuCount=menuCount-6result=result-7IFresult=menuCountTHENmenu$(result)="":GOTOcheckForEmptyMenuBar]1FORx=resultTOmenuCount2menu$(x)=menu$(x+)3NEXTx4IFmenuCount>THENGOSUBredrawAll]:GOTOinputLoop]8FORx=TOobjectCount9yOrg(x)=yOrg(x)-0NEXTx1GOSUBredrawAll]2GOTOinputLoop]3CLOSE#removeMenu4removeMenuIsOpen=5GOTOinputLoop]6IFmenuCount=THENNOTICE"No menus to edit.":GOTOinputLoop]0IFeditMenuIsOpen=THENCLOSE#editMenu3WindowWidth=4WindowHeight=5LISTBOX#editMenu.menuList,menu$(,selectMenuToEdit],,,,6LISTBOX#editMenu.menuItems,menuItemLocal$(,selectMenuItemToEdit],,,,7STATICTEXT#editMenu.statictext6,"Menus:",,,,8STATICTEXT#editMenu.statictext14,"Menu line items -> Branch labels:",,,,9BUTTON#editMenu,"&Close",closeMenuEdit],UL,,0BUTTON#editMenu,"&New Item",addNewMenuItem],UL,,1BUTTON#editMenu,"&Edit",editMenuItem],UL,,2BUTTON#editMenu,"Move &Up",oveMenuItemUp],UL,,3BUTTON#editMenu,"&Move Dn",oveMenuItemDown],UL,,4BUTTON#editMenu,"&Delete",deleteMenuItem],UL,,5BUTTON#editMenu,"&To Top",oveMenuToTop],UL,,6OPEN"Edit Menus"FORdialog_modalAS#editMenu7PRINT#editMenu,"trapclose [closeMenuEdit]"8PRINT#editMenu.menuList,"singleclickselect"9PRINT#editMenu.menuItems,"singleclickselect"0editMenuIsOpen=1menuItemIndex=2result=3GOTOinputLoop]4PRINT#editMenu.menuList,"selectionIndex?"5INPUT#editMenu.menuList,result6FORx=TO7mil$=menuItem$(result-,x)8IFmil$<>""THENmil$=LEFT$(mil$,INSTR(mil$,CHR$())-)+" -> "+MID$(mil$,INSTR(mil$,CHR$())+)1menuItemLocal$(x)=mil$2NEXTx3PRINT#editMenu.menuItems,"reload"4menuItemIndex=5GOTOinputLoop]6IFresult=ORresult=THENinputLoop]9menu$()=menu$(result-)0FORx=TO1menuItem$(,x)=menuItem$(result-,x)2NEXTx3FORx=result-TOSTEP-14menu$(x)=menu$(x-)5FORy=TO6menuItem$(x,y)=menuItem$(x-,y)7NEXTy8NEXTx9menu$()=menu$()0menu$()=""1FORx=TO2menuItem$(,x)=menuItem$(,x)3menuItem$(,x)=""4NEXTx5PRINT#editMenu.menuList,"reload"6PRINT#editMenu.menuList,"selectIndex 1"7result=8PRINT#editMenu.menuItems,"selectionIndex?"9INPUT#editMenu.menuItems,menuItemIndex0GOTOinputLoop]1IFresult=THENinputLoop]4IFeditMenuItemIsOpen=THENGOSUBcloseEditMenuItem]7menuItemCount(result-)=menuItemCount(result-)+8menuItemIndex=menuItemCount(result-)9editMenuItemAction$="ADD"0GOTOeditMenuItemProperties]1IFmenuItemIndex=THENinputLoop]4IFeditMenuItemIsOpen=THENGOSUBcloseEditMenuItem]7editMenuItemAction$="EDIT"8GOTOeditMenuItemProperties]9IFmenuItemIndex=ORmenuItemIndex=THENinputLoop]2tmpMi$=menuItem$(result-,menuItemIndex-)3menuItem$(result-,menuItemIndex-)=menuItem$(result-,menuItemIndex-)4menuItem$(result-,menuItemIndex-)=tmpMi$5GOSUBreloadLocalMenuItems]6menuItemIndex=menuItemIndex-7PRINT#editMenu.menuItems,"selectIndex "menuItemIndex8GOTOinputLoop]9IFresult=THENinputLoop]2IFmenuItemIndex=menuItemCount(result-)ORmenuItemIndex=THENinputLoop]5tmpMi$=menuItem$(result-,menuItemIndex-)6menuItem$(result-,menuItemIndex-)=menuItem$(result-,menuItemIndex)7menuItem$(result-,menuItemIndex)=tmpMi$8GOSUBreloadLocalMenuItems]9menuItemIndex=menuItemIndex+0PRINT#editMenu.menuItems,"selectIndex "menuItemIndex1GOTOinputLoop]2IFresult=THENinputLoop]5IFmenuItemCount(result-)=ORmenuItemIndex=THENinputLoop]8FORx=menuItemIndexTO9menuItem$(result-,x-)=menuItem$(result-,x)0NEXTx1GOSUBreloadLocalMenuItems]2menuItemIndex=3RETURN4FORx=TO5mil$=menuItem$(result-,x)6IFmil$<>""THENmil$=LEFT$(mil$,INSTR(mil$,CHR$())-)+" -> "+MID$(mil$,INSTR(mil$,CHR$())+)9menuItemLocal$(x)=mil$0NEXTx1PRINT#editMenu.menuItems,"reload"2RETURN3FORx=TO:menuItemLocal$(x)="":NEXTx6CLOSE#editMenu7editMenuIsOpen=8GOTOinputLoop]9WindowWidth=0WindowHeight=1TEXTBOX#menuItems.name,,,,2TEXTBOX#menuItems.branchLabel,,,,3STATICTEXT#menuItems.statictext6,"Name:",,,,4STATICTEXT#menuItems.statictext7,"Branch Label:",,,,5BUTTON#menuItems,"Accept",acceptMenuItemProps],UL,,6BUTTON#menuItems,"Cancel",cancelMenuItemProps],UL,,7OPEN"Menu Item Properties"FORdialog_modalAS#menuItems8editMenuItemIsOpen=9PRINT#menuItems.name,"???"0PRINT#menuItems.branchLabel,"[???]"1IFmenuItem$(result-,menuItemIndex-)=""THENinputLoop]4mi$=menuItem$(result-,menuItemIndex-)5PRINT#menuItems.name,LEFT$(mi$,INSTR(mi$,CHR$())-)6PRINT#menuItems.branchLabel,MID$(mi$,INSTR(mi$,CHR$())+)7GOTOinputLoop]8PRINT#menuItems.name,"!contents?"9INPUT#menuItems.name,nResult$0PRINT#menuItems.branchLabel,"!contents?"1INPUT#menuItems.branchLabel,blResult$2IFnResult$=""ORblResult$=""THENNOTICE"Bad menu item properties.":GOTOinputLoop]6blr$=blResult$7IFLEFT$(blResult$,)<>"["THENblResult$="["+blResult$0IFRIGHT$(blResult$,)<>"]"THENblResult$=blResult$+"]"3IFblr$<>blResult$THENNOTICE"Branch Label was "+blr$+", defaulting to "+blResult$6menuItem$(result-,menuItemIndex-)=nResult$+CHR$()+blResult$7menuItemLocal$(menuItemIndex-)=nResult$+" -> "+blResult$8CLOSE#menuItems9editMenuItemIsOpen=0PRINT#editMenu.menuItems,"reload"1GOTOinputLoop]2GOSUBcloseEditMenuItem]3GOTOinputLoop]4CLOSE#menuItems5IFeditMenuItemAction$="ADD"THENmenuItemCount(result-)=menuItemCount(result-)-8editMenuItemIsOpen=9RETURN0isModified=1IFobjectCount<THENRETURN4CONFIRM"Save changes to "+formName$+"?"answer$5IFanswer$="yes"THENGOSUBsaveFormSubroutine]8RETURN9WindowWidth=0WindowHeight=1CHECKBOX#settings.creationInspect,"Inspect each control when created",creationInspectSet],creationInspectClear],,,,2CHECKBOX#settings.displayOrdering,"Display control ordering",displayOrderingSet],displayOrderingReset],,,,3BUTTON#settings,"Accept",settingsAccept],UL,,4BUTTON#settings,"Cancel",settingsCancel],UL,,5OPEN"Settings"FORdialog_modalAS#settings6PRINT#settings,"trapclose [settingsCancel]"7createInspectValue=createInspect8IFcreateInspect>THENPRINT#settings.creationInspect,"set"1displayOrderingValue=displayOrdering2IFdisplayOrdering>THENPRINT#settings.displayOrdering,"set"5INPUTaVar$6GOTOsettings.inputLoop]7createInspectValue=8GOTOsettings.inputLoop]9createInspectValue=0GOTOsettings.inputLoop]1displayOrderingValue=2GOTOsettings.inputLoop]3displayOrderingValue=4GOTOsettings.inputLoop]5createInspect=createInspectValue6displayOrdering=displayOrderingValue7CLOSE#settings8GOSUBredrawAll]9GOTOinputLoop]0CLOSE#settings1GOTOsettings.inputLoop]2OPEN"fflite.ini"FORINPUTAS#ini3IFEOF(#ini)THENCLOSE#ini:GOSUBsaveIniFile]:RETURN8INPUT#ini,xInterval9INPUT#ini,yInterval0INPUT#ini,snapOn1INPUT#ini,createInspect2INPUT#ini,displayOrdering3CLOSE#ini4RETURN5OPEN"fflite.ini"FOROUTPUTAS#ini6PRINT#ini,xInterval7PRINT#ini,yInterval8PRINT#ini,snapOn9PRINT#ini,createInspect0PRINT#ini,displayOrdering1CLOSE#ini2RETURN3IFisModified=THENGOSUBformIsModified]6GOSUBsaveIniFile]7CLOSE#form8IFcodeIsOpenTHENCLOSE#code1END