|
Post by xxgeek on Jul 14, 2023 19:24:44 GMT -5
Perseverance pays off. Finally got all controls and event handlers in preview. No more [radio],[radio] and [check],[check].
My last test produced this output.
'Project Untitled 'Created with Freeform NOT SO Lite vxx1.17 Jul 14, 2023 20:19:11
'Create arrays needed for controls listbox,combobox dim lb44$(10) for n = 1 to 10 lb44$(n)= str$(n) next dim lb45$(10) for n = 1 to 10 lb45$(n)= str$(n) next dim lb46$(10) for n = 1 to 10 lb46$(n)= str$(n) next dim lb47$(10) for n = 1 to 10 lb47$(n)= str$(n) next dim lb48$(10) for n = 1 to 10 lb48$(n)= str$(n) next dim cb49$(10) for n = 1 to 10 cb49$(n)= str$(n) next dim cb50$(10) for n = 1 to 10 cb50$(n)= str$(n) next dim cb51$(10) for n = 1 to 10 cb51$(n)= str$(n) next dim cb52$(10) for n = 1 to 10 cb52$(n)= str$(n) next dim cb53$(10) for n = 1 to 10 cb53$(n)= str$(n) next dim cb54$(10) for n = 1 to 10 cb54$(n)= str$(n) next dim cb55$(10) for n = 1 to 10 cb55$(n)= str$(n) next dim cb56$(10) for n = 1 to 10 cb56$(n)= str$(n) next dim cb57$(10) for n = 1 to 10 cb57$(n)= str$(n) next dim cb58$(10) for n = 1 to 10 cb58$(n)= str$(n) next dim lb59$(10) for n = 1 to 10 lb59$(n)= str$(n) next dim lb60$(10) for n = 1 to 10 lb60$(n)= str$(n) next dim lb61$(10) for n = 1 to 10 lb61$(n)= str$(n) next
'Create controls and open window nomainwin WindowWidth = 1500 WindowHeight = 700 UpperLeftX = int((DisplayWidth-WindowWidth)/2) UpperLeftY = int((DisplayHeight-WindowHeight)/2) menu #1, "&File", "&Save", [dummy], "&Load", [dummy] menu #1, "&Color", "&Red", [dummy], "&Green", [dummy] menu #1, "Size", "Small", [dummy], "Large", [dummy] button #1.bt3,"Button?",[bt3Clicked], UL, 10,10,100,25 button #1.bt4,"Button?",[bt4Clicked], UL, 10,40,100,25 button #1.bt5,"Button?",[bt5Clicked], UL, 10,70,100,25 button #1.bt6,"Button?",[bt6Clicked], UL, 10,100,100,25 button #1.bt7,"Button?",[bt7Clicked], UL, 10,130,100,25 button #1.bt8,"Button?",[bt8Clicked], UL, 10,160,100,25 button #1.bt9,"Button?",[bt9Clicked], UL, 10,190,100,25 button #1.bt10,"Button?",[bt10Clicked], UL, 10,220,100,25 button #1.bt11,"Button?",[bt11Clicked], UL, 10,250,100,25 button #1.bt12,"Button?",[bt12Clicked], UL, 10,280,100,25 button #1.bt13,"Button?",[bt13Clicked], UL, 10,310,100,25 button #1.bt14,"Button?",[bt14Clicked], UL, 10,340,100,25 button #1.bt15,"Button?",[bt15Clicked], UL, 10,370,100,25 button #1.bt16,"Button?",[bt16Clicked], UL, 10,400,100,25 button #1.bt17,"Button?",[bt17Clicked], UL, 10,430,100,25 button #1.bt18,"Button?",[bt18Clicked], UL, 10,460,100,25 button #1.bt19,"Button?",[bt19Clicked], UL, 10,490,100,25 button #1.bt20,"Button?",[bt20Clicked], UL, 10,520,100,25 button #1.bt21,"Button?",[bt21Clicked], UL, 10,550,100,25 button #1.bt22,"Button?",[bt22Clicked], UL, 10,580,100,25 textbox #1.tb23,120,0,200,25 textbox #1.tb24,120,30,200,25 textbox #1.tb25,120,60,200,25 textbox #1.tb26,120,90,200,25 textbox #1.tb27,120,120,200,25 textbox #1.tb28,120,150,200,25 textbox #1.tb29,120,180,200,25 textbox #1.tb30,120,210,200,25 textbox #1.tb31,120,240,200,25 textbox #1.tb32,120,270,200,25 textbox #1.tb33,120,300,200,25 textbox #1.tb34,120,330,200,25 textbox #1.tb35,120,360,200,25 textbox #1.tb36,120,390,200,25 textbox #1.tb37,120,420,200,25 textbox #1.tb38,120,450,200,25 textbox #1.tb39,120,480,200,25 textbox #1.tb40,120,510,200,25 textbox #1.tb41,120,540,200,25 textbox #1.tb42,120,570,200,25 textbox #1.tb43,120,600,200,25 listbox #1.lb44,lb44$(,[lb44Selected],331,10,198,125 listbox #1.lb45,lb45$(,[lb45Selected],331,140,198,125 listbox #1.lb46,lb46$(,[lb46Selected],331,270,198,125 listbox #1.lb47,lb47$(,[lb47Selected],331,400,198,125 listbox #1.lb48,lb48$(,[lb48Selected],331,530,198,40 combobox #1.cb49,cb49$(,[cb49Selected],541,10,198,25 combobox #1.cb50,cb50$(,[cb50Selected],541,40,198,25 combobox #1.cb51,cb51$(,[cb51Selected],541,70,198,25 combobox #1.cb52,cb52$(,[cb52Selected],541,100,198,25 combobox #1.cb53,cb53$(,[cb53Selected],541,130,198,25 combobox #1.cb54,cb54$(,[cb54Selected],541,160,198,25 combobox #1.cb55,cb55$(,[cb55Selected],541,190,198,25 combobox #1.cb56,cb56$(,[cb56Selected],541,220,198,25 combobox #1.cb57,cb57$(,[cb57Selected],541,250,198,25 combobox #1.cb58,cb58$(,[cb58Selected],541,280,198,25 listbox #1.lb59,lb59$(,[lb59Selected],541,310,198,125 listbox #1.lb60,lb60$(,[lb60Selected],541,440,198,125 listbox #1.lb61,lb61$(,[lb61Selected],541,570,198,25 bmpbutton #1.bb62,"x.bmp",[bb62Clicked], UL, 750,20 bmpbutton #1.bb63,"tick.bmp",[bb63Clicked], UL, 750,50 bmpbutton #1.bb64,"path.bmp",[bb64Clicked], UL, 750,80 bmpbutton #1.bb65,"x.bmp",[bb65Clicked], UL, 750,110 bmpbutton #1.bb66,"tick.bmp",[bb66Clicked], UL, 750,140 bmpbutton #1.bb67,"path.bmp",[bb67Clicked], UL, 750,170 bmpbutton #1.bb68,"x.bmp",[bb68Clicked], UL, 750,200 bmpbutton #1.bb69,"x.bmp",[bb69Clicked], UL, 750,230 bmpbutton #1.bb70,"tick.bmp",[bb70Clicked], UL, 750,260 bmpbutton #1.bb71,"path.bmp",[bb71Clicked], UL, 750,290 bmpbutton #1.bb72,"tick.bmp",[bb72Clicked], UL, 750,320 bmpbutton #1.bb73,"x.bmp",[bb73Clicked], UL, 750,350 bmpbutton #1.bb74,"path.bmp",[bb74Clicked], UL, 750,380 bmpbutton #1.bb75,"tick.bmp",[bb75Clicked], UL, 750,410 bmpbutton #1.bb76,"x.bmp",[bb76Clicked], UL, 750,440 bmpbutton #1.bb77,"path.bmp",[bb77Clicked], UL, 750,470 bmpbutton #1.bb78,"tick.bmp",[bb78Clicked], UL, 750,500 bmpbutton #1.bb79,"path.bmp",[bb79Clicked], UL, 750,530 bmpbutton #1.bb80,"x.bmp",[bb80Clicked], UL, 750,560 graphicbox #1.gb81,790,10,100,100 graphicbox #1.gb82,790,110,100,100 graphicbox #1.gb83,790,210,100,100 graphicbox #1.gb84,790,310,100,100 graphicbox #1.gb85,790,410,100,100 graphicbox #1.gb86,790,510,100,100 graphicbox #1.gb87,900,10,100,100 graphicbox #1.gb88,900,110,100,100 graphicbox #1.gb89,900,210,100,100 graphicbox #1.gb90,900,310,100,100 graphicbox #1.gb91,900,410,100,100 graphicbox #1.gb92,900,510,100,100 radiobutton #1.rb93,"radio?",[rb93Set],[rb93Reset],1010,10,100,25 radiobutton #1.rb94,"radio?",[rb94Set],[rb94Reset],1010,40,100,25 radiobutton #1.rb95,"radio?",[rb95Set],[rb95Reset],1010,70,100,25 radiobutton #1.rb96,"radio?",[rb96Set],[rb96Reset],1010,100,100,25 radiobutton #1.rb97,"radio?",[rb97Set],[rb97Reset],1010,130,100,25 radiobutton #1.rb98,"radio?",[rb98Set],[rb98Reset],1010,160,100,25 radiobutton #1.rb99,"radio?",[rb99Set],[rb99Reset],1010,190,100,25 radiobutton #1.rb100,"radio?",[rb100Set],[rb100Reset],1010,220,100,25 radiobutton #1.rb101,"radio?",[rb101Set],[rb101Reset],1010,250,100,25 radiobutton #1.rb102,"radio?",[rb102Set],[rb102Reset],1010,280,100,25 radiobutton #1.rb103,"radio?",[rb103Set],[rb103Reset],1010,310,100,25 radiobutton #1.rb104,"radio?",[rb104Set],[rb104Reset],1010,340,100,25 radiobutton #1.rb105,"radio?",[rb105Set],[rb105Reset],1010,370,100,25 radiobutton #1.rb106,"radio?",[rb106Set],[rb106Reset],1010,400,100,25 radiobutton #1.rb107,"radio?",[rb107Set],[rb107Reset],1010,430,100,25 radiobutton #1.rb108,"radio?",[rb108Set],[rb108Reset],1010,460,100,25 radiobutton #1.rb109,"radio?",[rb109Set],[rb109Reset],1010,490,100,25 radiobutton #1.rb110,"radio?",[rb110Set],[rb110Reset],1010,520,100,25 radiobutton #1.rb111,"radio?",[rb111Set],[rb111Reset],1010,550,100,25 radiobutton #1.rb112,"radio?",[rb112Set],[rb112Reset],1010,580,100,25 radiobutton #1.rb113,"radio?",[rb113Set],[rb113Reset],1010,610,100,25 radiobutton #1.rb114,"radio?",[rb114Set],[rb114Reset],1010,640,100,25 checkbox #1.ch115,"check?",[ch115Set],[ch115Reset],1120,10,100,25 checkbox #1.ch116,"check?",[ch116Set],[ch116Reset],1120,40,100,25 checkbox #1.ch117,"check?",[ch117Set],[ch117Reset],1120,70,100,25 checkbox #1.ch118,"check?",[ch118Set],[ch118Reset],1120,100,100,25 checkbox #1.ch119,"check?",[ch119Set],[ch119Reset],1120,130,100,25 checkbox #1.ch120,"check?",[ch120Set],[ch120Reset],1120,160,100,25 checkbox #1.ch121,"check?",[ch121Set],[ch121Reset],1120,190,100,25 checkbox #1.ch122,"check?",[ch122Set],[ch122Reset],1120,220,100,25 checkbox #1.ch123,"check?",[ch123Set],[ch123Reset],1120,250,100,25 checkbox #1.ch124,"check?",[ch124Set],[ch124Reset],1120,280,100,25 checkbox #1.ch125,"check?",[ch125Set],[ch125Reset],1120,310,100,25 checkbox #1.ch126,"check?",[ch126Set],[ch126Reset],1120,340,100,25 checkbox #1.ch127,"check?",[ch127Set],[ch127Reset],1120,370,100,25 checkbox #1.ch128,"check?",[ch128Set],[ch128Reset],1120,400,100,25 checkbox #1.ch129,"check?",[ch129Set],[ch129Reset],1120,430,100,25 checkbox #1.ch130,"check?",[ch130Set],[ch130Reset],1120,460,100,25 checkbox #1.ch131,"check?",[ch131Set],[ch131Reset],1120,490,100,25 checkbox #1.ch132,"check?",[ch132Set],[ch132Reset],1120,520,100,25 checkbox #1.ch133,"check?",[ch133Set],[ch133Reset],1120,550,100,25 checkbox #1.ch134,"check?",[ch134Set],[ch134Reset],1120,580,100,25 checkbox #1.ch135,"check?",[ch135Set],[ch135Reset],1120,610,100,25 groupbox #1.gr136,"Group Box?",1230,5,100,100 groupbox #1.gr137,"Group Box?",1230,105,100,100 groupbox #1.gr138,"Group Box?",1230,205,100,100 groupbox #1.gr139,"Group Box?",1230,305,100,100 groupbox #1.gr140,"Group Box?",1230,405,100,100 groupbox #1.gr141,"Group Box?",1230,505,100,100 texteditor #1.te142,1350,10,200,100 texteditor #1.te143,1350,110,200,100 texteditor #1.te144,1350,210,200,100 texteditor #1.te145,1350,310,200,100 texteditor #1.te146,1350,410,200,100 texteditor #1.te147,1350,510,200,100 open "Untitled" for window_nf as #1 #1 "trapclose [quit]"
'Set any listbox or combobox to display the first item on the list #1.lb44 "selectindex 1" #1.lb45 "selectindex 1" #1.lb46 "selectindex 1" #1.lb47 "selectindex 1" #1.lb48 "selectindex 1" #1.cb49 "selectindex 1" #1.cb50 "selectindex 1" #1.cb51 "selectindex 1" #1.cb52 "selectindex 1" #1.cb53 "selectindex 1" #1.cb54 "selectindex 1" #1.cb55 "selectindex 1" #1.cb56 "selectindex 1" #1.cb57 "selectindex 1" #1.cb58 "selectindex 1" #1.lb59 "selectindex 1" #1.lb60 "selectindex 1" #1.lb61 "selectindex 1" 'apply any control specific fonts wait
'Create the required handlers for each control [bt3Clicked] 'Your handler code here wait
[bt4Clicked] 'Your handler code here wait
[bt5Clicked] 'Your handler code here wait
[bt6Clicked] 'Your handler code here wait
[bt7Clicked] 'Your handler code here wait
[bt8Clicked] 'Your handler code here wait
[bt9Clicked] 'Your handler code here wait
[bt10Clicked] 'Your handler code here wait
[bt11Clicked] 'Your handler code here wait
[bt12Clicked] 'Your handler code here wait
[bt13Clicked] 'Your handler code here wait
[bt14Clicked] 'Your handler code here wait
[bt15Clicked] 'Your handler code here wait
[bt16Clicked] 'Your handler code here wait
[bt17Clicked] 'Your handler code here wait
[bt18Clicked] 'Your handler code here wait
[bt19Clicked] 'Your handler code here wait
[bt20Clicked] 'Your handler code here wait
[bt21Clicked] 'Your handler code here wait
[bt22Clicked] 'Your handler code here wait
[lb44Selected] 'Your handler code here, read the control with #1.lb44 "selection? Selected$" wait
[lb45Selected] 'Your handler code here, read the control with #1.lb45 "selection? Selected$" wait
[lb46Selected] 'Your handler code here, read the control with #1.lb46 "selection? Selected$" wait
[lb47Selected] 'Your handler code here, read the control with #1.lb47 "selection? Selected$" wait
[lb48Selected] 'Your handler code here, read the control with #1.lb48 "selection? Selected$" wait
[cb49Selected] 'Your handler code here, read the control with #1.cb49 "selection? Selected$" wait
[cb50Selected] 'Your handler code here, read the control with #1.cb50 "selection? Selected$" wait
[cb51Selected] 'Your handler code here, read the control with #1.cb51 "selection? Selected$" wait
[cb52Selected] 'Your handler code here, read the control with #1.cb52 "selection? Selected$" wait
[cb53Selected] 'Your handler code here, read the control with #1.cb53 "selection? Selected$" wait
[cb54Selected] 'Your handler code here, read the control with #1.cb54 "selection? Selected$" wait
[cb55Selected] 'Your handler code here, read the control with #1.cb55 "selection? Selected$" wait
[cb56Selected] 'Your handler code here, read the control with #1.cb56 "selection? Selected$" wait
[cb57Selected] 'Your handler code here, read the control with #1.cb57 "selection? Selected$" wait
[cb58Selected] 'Your handler code here, read the control with #1.cb58 "selection? Selected$" wait
[lb59Selected] 'Your handler code here, read the control with #1.lb59 "selection? Selected$" wait
[lb60Selected] 'Your handler code here, read the control with #1.lb60 "selection? Selected$" wait
[lb61Selected] 'Your handler code here, read the control with #1.lb61 "selection? Selected$" wait
[bb62Clicked] 'Your handler code here wait
[bb63Clicked] 'Your handler code here wait
[bb64Clicked] 'Your handler code here wait
[bb65Clicked] 'Your handler code here wait
[bb66Clicked] 'Your handler code here wait
[bb67Clicked] 'Your handler code here wait
[bb68Clicked] 'Your handler code here wait
[bb69Clicked] 'Your handler code here wait
[bb70Clicked] 'Your handler code here wait
[bb71Clicked] 'Your handler code here wait
[bb72Clicked] 'Your handler code here wait
[bb73Clicked] 'Your handler code here wait
[bb74Clicked] 'Your handler code here wait
[bb75Clicked] 'Your handler code here wait
[bb76Clicked] 'Your handler code here wait
[bb77Clicked] 'Your handler code here wait
[bb78Clicked] 'Your handler code here wait
[bb79Clicked] 'Your handler code here wait
[bb80Clicked] 'Your handler code here wait
[rb93Set] #1.rb93 "value? result$" wait
[rb93Reset] #1.rb93 "value? result$" wait
[rb94Set] #1.rb94 "value? result$" wait
[rb94Reset] #1.rb94 "value? result$" wait
[rb95Set] #1.rb95 "value? result$" wait
[rb95Reset] #1.rb95 "value? result$" wait
[rb96Set] #1.rb96 "value? result$" wait
[rb96Reset] #1.rb96 "value? result$" wait
[rb97Set] #1.rb97 "value? result$" wait
[rb97Reset] #1.rb97 "value? result$" wait
[rb98Set] #1.rb98 "value? result$" wait
[rb98Reset] #1.rb98 "value? result$" wait
[rb99Set] #1.rb99 "value? result$" wait
[rb99Reset] #1.rb99 "value? result$" wait
[rb100Set] #1.rb100 "value? result$" wait
[rb100Reset] #1.rb100 "value? result$" wait
[rb101Set] #1.rb101 "value? result$" wait
[rb101Reset] #1.rb101 "value? result$" wait
[rb102Set] #1.rb102 "value? result$" wait
[rb102Reset] #1.rb102 "value? result$" wait
[rb103Set] #1.rb103 "value? result$" wait
[rb103Reset] #1.rb103 "value? result$" wait
[rb104Set] #1.rb104 "value? result$" wait
[rb104Reset] #1.rb104 "value? result$" wait
[rb105Set] #1.rb105 "value? result$" wait
[rb105Reset] #1.rb105 "value? result$" wait
[rb106Set] #1.rb106 "value? result$" wait
[rb106Reset] #1.rb106 "value? result$" wait
[rb107Set] #1.rb107 "value? result$" wait
[rb107Reset] #1.rb107 "value? result$" wait
[rb108Set] #1.rb108 "value? result$" wait
[rb108Reset] #1.rb108 "value? result$" wait
[rb109Set] #1.rb109 "value? result$" wait
[rb109Reset] #1.rb109 "value? result$" wait
[rb110Set] #1.rb110 "value? result$" wait
[rb110Reset] #1.rb110 "value? result$" wait
[rb111Set] #1.rb111 "value? result$" wait
[rb111Reset] #1.rb111 "value? result$" wait
[rb112Set] #1.rb112 "value? result$" wait
[rb112Reset] #1.rb112 "value? result$" wait
[rb113Set] #1.rb113 "value? result$" wait
[rb113Reset] #1.rb113 "value? result$" wait
[rb114Set] #1.rb114 "value? result$" wait
[rb114Reset] #1.rb114 "value? result$" wait
[ch115Set] #1.ch115 "value? result$" wait
[ch115Reset] #1.ch115 "value? result$" wait
[ch116Set] #1.ch116 "value? result$" wait
[ch116Reset] #1.ch116 "value? result$" wait
[ch117Set] #1.ch117 "value? result$" wait
[ch117Reset] #1.ch117 "value? result$" wait
[ch118Set] #1.ch118 "value? result$" wait
[ch118Reset] #1.ch118 "value? result$" wait
[ch119Set] #1.ch119 "value? result$" wait
[ch119Reset] #1.ch119 "value? result$" wait
[ch120Set] #1.ch120 "value? result$" wait
[ch120Reset] #1.ch120 "value? result$" wait
[ch121Set] #1.ch121 "value? result$" wait
[ch121Reset] #1.ch121 "value? result$" wait
[ch122Set] #1.ch122 "value? result$" wait
[ch122Reset] #1.ch122 "value? result$" wait
[ch123Set] #1.ch123 "value? result$" wait
[ch123Reset] #1.ch123 "value? result$" wait
[ch124Set] #1.ch124 "value? result$" wait
[ch124Reset] #1.ch124 "value? result$" wait
[ch125Set] #1.ch125 "value? result$" wait
[ch125Reset] #1.ch125 "value? result$" wait
[ch126Set] #1.ch126 "value? result$" wait
[ch126Reset] #1.ch126 "value? result$" wait
[ch127Set] #1.ch127 "value? result$" wait
[ch127Reset] #1.ch127 "value? result$" wait
[ch128Set] #1.ch128 "value? result$" wait
[ch128Reset] #1.ch128 "value? result$" wait
[ch129Set] #1.ch129 "value? result$" wait
[ch129Reset] #1.ch129 "value? result$" wait
[ch130Set] #1.ch130 "value? result$" wait
[ch130Reset] #1.ch130 "value? result$" wait
[ch131Set] #1.ch131 "value? result$" wait
[ch131Reset] #1.ch131 "value? result$" wait
[ch132Set] #1.ch132 "value? result$" wait
[ch132Reset] #1.ch132 "value? result$" wait
[ch133Set] #1.ch133 "value? result$" wait
[ch133Reset] #1.ch133 "value? result$" wait
[ch134Set] #1.ch134 "value? result$" wait
[ch134Reset] #1.ch134 "value? result$" wait
[ch135Set] #1.ch135 "value? result$" wait
[ch135Reset] #1.ch135 "value? result$" wait
[quit] close #1 end
|
|
|
Post by xxgeek on Jul 19, 2023 17:24:32 GMT -5
ver$ = vxx1.17.bas Here is the latest code I've been working on for ffulv1.17. - NOTE - Save to it's own folder before 'RUN'ing
Creating, writing, loading, saving, importing, and previewing all work well. Export has been disabled/removed as an option until it works. The code is still there, just the link in the menu has been commented out to avoid it being used, since it can/will butcher files if used. I'll be focusing on Export next.
Extra features appear when the window is biggie sized. 1. Tracking, resizing, and moving a control has barriers at the top, and the bottom end so the controls don't go offscreen. The 'Barrier + button toggles the x and y +dimension limits barrier on/off (grid dimensions) The 'Barrier' - button toggles the x and y -dimension limits barrier on/off (below 0)
2. If a menu, or a Texteditor are placed on the form the 'working space' adjusts to compensate for the loss/addition of pixels. Text editors, and the menu are checked for on import, and also adjust the 'work space' as needed. If the last Texteditor, or the menu is removed from the form, the 'work space' adjusts to compensate.
Testing with a texteditor in the bottom right corner shows it in preview exactly where placed. This works very well with the default window_nf created by ffnsl (freeformNotSoLite) Future releases should consider coding for all the other possible window types, using the offset as a variable.
3. There is also a feature showing the placement coordinates of the control when moved, or resized to help with placement, and testing. UpperLeft Corner when moving a control, and BottomRight corner when resizing.
4. Added 12 buttons - Adding controls can now be done by clicking the appropriate button. I found this a lot easier while testing, and thought it would be a nice addition. cntrl+c, and cntrl+v still work to copy/paste highlighted controls.
5. There is a textbox now that shows the file that is new, loaded, imported, saved, or written, (appears when window is biggie sized)
6. Under Set Grid there is an option for size 3
7. Under Set Color there are options for Bordercolor, and Crosshair color.
8. Initial grid dimension is changed to 600 x 400
Use ONLY files in the DefaultDir$ ( the folder this file is running from - or you may get a notice about it.
Quite a few other changes as I went over each line of code. Too many to remember or mention.
Please try this version and test the tracking/resizing/placement of controls. Have a look at the code that gets written. All controls including radiobuttons and checkboxes should have event handlers written. When importing a created form, you can edit it with new controls, and placement/sizing fonts etc, then use combobox - File >Write to write the changes to file. Keep in mind that if importing an OLDER .bas file (not created by this app) then the writing of the file will ONLY be writing the form and event handlers, and NOT the entire file. (export still needs some work) So, basically, this works very well for files it creates, but not for those it does not create, .... YET.
ver$="xx1.17" 'Author - Rod - Edits - xxgeek 'freeform ultra lite v1.x to freeform NotSo Lite vxx1.x 'https://libertybasiccom.proboards.com/thread/2308/freeform-ultra-lite-v1 'https://justbasiccom.proboards.com/thread/991/freeform-ultra-v1 nomainwin dim info$(10,10) dim form$(10) form$(1)="Restore" form$(2)="New" form$(3)="Save .ffu" form$(4)="Load .ffu" form$(5)="-----------" form$(6)="Write .bas" form$(7)="Import .bas" 'form$(8)="Export .bas" Temporarily disabled - Has issues form$(9)="File" dim tool$(14) tool$(1)="StatictText" tool$(2)="TextBox" tool$(3)="ListBox" tool$(5)="ComboBox" tool$(6)="Button" tool$(7)="BmpButton" tool$(8)="GraphicBox" tool$(9)="RadioButton" tool$(10)="CheckBox" tool$(11)="GroupBox" tool$(12)="Texteditor" tool$(13)="Menu" tool$(14)="Add New" dim hnd$(30) hnd$(1)="#1" dim grid$(20) grid$(1)="1" grid$(2)="3" g=3 for n= 5 to 30 step 5 grid$(g)=str$(n) g=g+1 next grid$(g)="Invisible" grid$(g+1)="Visible" grid$(g+2)="Set Grid" grid=10 gridvisible=1 gridcolor$="buttonface" bordercolor$ = gridcolor$ 'border of grid dimension limits of x,y crosshair$ = gridcolor$ 'crosshair available in grid = 0 or grid = 1 barrier = 1 'barrier - form dimension limit - when tracking / resizing controls negbar = 1 'negative barrier - less than zero - when tracking / resizing controls projectctrh=25 ctrh=25 dim color$(10) color$(1)="Control Back" color$(2)="Project Back" color$(3)="Project Fore" color$(4)="Grid Color" color$(5)="Border Color" color$(6)="CrossHair" color$(7)="Set Color" projectback$="white" projectfore$="black" dim font$(10) font$(1)="Control Font" font$(2)="ResetControl" font$(3)="Project Font" font$(4)="Set Font"'default is Consolas 9" dim wind$(20)'window type names wind$(1)="window" wind$(2)="window_nf" wind$(3)="window_popup" wind$(4)="dialog" wind$(5)="dialog_modal" wind$(6)="dialog_nf" wind$(7)="dialog_nf_modal" wind$(8)="dialog_fs" wind$(9)="dialog_nf_fs" wind$(10)="dialog_popup" wind$(11)="graphics" wind$(12)="graphics_fs" wind$(13)="graphics_fs_nsb" wind$(14)="graphics_nsb" wind$(15)="graphics_nf_nsb" wind$(16)="text" wind$(17)="text_fs" wind$(18)="text_nsb" wind$(19)="text_nsb_ins"
dim v$(2000) for n= 100 to 2000 step 20 v$(n)=str$(n) next dim obj(200,6) 'x,y,width/height,type,textheight X=1 Y=2 W=3 H=4 T=5 TH=6
dim obj$(200,7) 'name,text,resource,font,backcolor,basline Ctr=1 Tex=2 Res=3 Fon=4 Bak=5 Bas=7
'set default starting position obj=1 projectfile$="Untitled.bas" projectwind$="window_nf" projecttitl$="Untitled" projectform$="#1" projectctrl$="" projecttext$="" projectreso$="" projectfont$="Consolas 9" projectback$="white" projectfore$="black" projecttbcl$="white" projectlbcl$="white" projectcbcl$="white" projecttecl$="white" projectctrh=25 projectgrid=10 projectw=600 projecth=400 insertx=grid inserty=grid*2
'open a small properties window and hide it WindowWidth=230 WindowHeight=260 UpperLeftX=(DisplayWidth)/2 + 420 UpperLeftY=(DisplayHeight-180)/2 statictext #prop.st1 "File",5,10,30,25 textbox #prop.tbfile,45,5,150,25 statictext #prop.st2 "Wind",5,32,30,25 combobox #prop.cbwind,wind$(,[windowtype],47,29,146,25 statictext #prop.st3 "Titl",5,54,30,25 textbox #prop.tbtitl,45,49,150,25 statictext #prop.st4 "Form",5,76,30,25 textbox #prop.tbform,45,71,150,25 statictext #prop.st5 "Ctrl",5,98,30,25 textbox #prop.tbctrl,45,93,150,25 statictext #prop.st6 "Text",5,120,30,25 textbox #prop.tbtext,45,115,150,25 statictext #prop.st7 "Reso",5,142,30,25 textbox #prop.tbreso,45,137,150,25 statictext #prop.st8 "xywh",5,164,30,25 textbox #prop.tbxywh,45,159,150,25 statictext #prop.st9 "Font",5,186,30,25 textbox #prop.tbfont,45,181,150,25 statictext #prop.st10 "Colo",5,208,30,25 textbox #prop.tbcolo,45,203,150,25 open "Properties" for window_nf as #prop #prop "font Consolas 9" #prop "trapclose [show]" #prop.cbwind "select window_nf" #prop.tbfile "!disable" #prop.tbxywh "!disable" #prop.tbfont "!disable" #prop.tbcolo "!disable" gosub [propertyupdate] #prop "hide"
'open the main form window 'this window is resizable, the graphicox will resize but the 'client area, which is a drawn representation of the window 'will only change size if you change the project w/h dimensions WindowWidth=862 WindowHeight=600 'gb is offset by 25 UpperLeftX=(DisplayWidth-WindowWidth)/2 UpperLeftY=(DisplayHeight-WindowHeight)/2 combobox #fful.tool,tool$(,[tool],95,2,85,30 combobox #fful.form,form$(,[form],5,2,85,30 combobox #fful.hand,hnd$(,[hand],185,2,85,30 button #fful.project,"Preview",[preview],UL,275,0,60,25 combobox #fful.w,v$(,[formsize],337,2,55,30 combobox #fful.h,v$(,[formsize],394,2,55,30 combobox #fful.grid,grid$(,[grid],450,2,90,30 statictext #fful.gridsize "10",545,7,15,15 combobox #fful.color,color$(,[color],565,2,90,30 combobox #fful.font,font$(,[font],660,2,90,30 button #fful.barrier,"No Barrier +",[barrier],UL,850,0,100,20 button #fful.help,"Help",[help],UL,755,0,85,25 button #fful.negbarrier,"No Barrier -",[negbarrier],UL,850,22,100,20 statictext #fful.corner, "UpperLeft",960,12,75,15 statictext #fful.cornertext, " Corner >",960,25,85,15 statictext #fful.Xco, "x 0" ,1045,2,65,20 statictext #fful.Yco, "y 0",1045,24,65,20 button #fful.mnu,"Menu",[bttnMNU],UL,5,25,45,20 button #fful.button,"Button",[bttnBTTN],UL,50,25,55,20 button #fful.textbox,"Textbox",[bttnTXBX],UL,105,25,65,20 button #fful.lstbx,"Listbox",[bttnLSTBX],UL,170,25,65,20 button #fful.cmbobx,"Combobox",[bttnCMBOBX],UL,235,25,65,20 button #fful.statictext,"Statictext",[bttnSTTX],UL,300,25,80,20 button #fful.bmpbttn,"BMPbutton",[bttnBMPBTTN],UL,380,25,75,20 button #fful.grphcbx,"Graphicbox",[bttnGRPHCBX],UL,455,25,80,20 button #fful.rdiobttn,"Radiobutton",[bttnRDBTTN],UL,535,25,85,20 button #fful.chckbx,"Checkbox",[bttnCHKBX],UL,620,25,70,20 button #fful.grpbx,"Groupbox",[bttnGRPBX],UL,690,25,70,20 button #fful.txtedtr,"Texteditor",[bttnTXTEDTR],UL,760,25,85,20 graphicbox #fful.gb,5,45,830,510 textbox #fful.path,1115,0,300,25 open ver$;" Controls Forms Grid Dimensions Grid - Size Colors Fonts" for window as #fful #fful "trapclose [quitfful]" #fful "font Consolas 9 " #fful.Xco "!font Consolas 11 " #fful.Yco "!font Consolas 11 " #fful "resizehandler [resize]" #fful.tool "select Add New" #fful.form "select File" #fful.hand "selectindex 1" #fful.grid "select Set Grid" #fful.color "select Set Color" #fful.font "select Set Font" #fful.w "select ";projectw #fful.h "select ";projecth #fful.gb "autoresize" #fful.gb "vertscrollbar on 0 ";projectw #fful.gb "horizscrollbar on 0 ";projecth #fful.gb "font ";projectfont$ #fful.gb "down" #fful.path "File - untitled.ffu" gosub [drawgrid] gosub [drawall] #fful.gb "when rightButtonDown [show]" #fful.gb "when leftButtonDown [select]" #fful.gb "when characterInput [keys]" #fful.gb "setfocus" #prop "show" show=1 wait
[show] if show then #prop "hide" show=0 else #prop "show" show=1 end if wait
'the user clicked on the form design window 'either to chose a control or to deselect a control [select] xs=MouseX ys=MouseY
'hide property window if it is open if show then #prop "hide" show=0 end if
'before we move on update the currently selected control from properties 'get the project data and only the editable contents of controls if selected=0 then 'the form name #xxxx #prop.tbform "!contents? t$" if t$<>projectform$ then projectform$=t$ dim hnd$(10) hnd$(1)=projectform$ #fful.hand "reload" #fful.hand "select ";projectform$ end if 'the form/windo title text #prop.tbtitl "!contents? t$" if t$<>projecttitl$ then projecttitl$=t$ end if #prop.tbctrl "!contents? t$" : obj$(selected,Ctl)=t$ #prop.tbtext "!contents? t$" : obj$(selected,Tex)=t$ #prop.tbreso "!contents? t$" : obj$(selected,Res)=t$ 'find the object selected selected=0 action=1 '1=move 2=expand bmps dont expand for cn=obj to 1 step -1 if xs>obj(cn,X) and xs<(obj(cn,X)+obj(cn,W)) and ys>obj(cn,Y) and ys<(obj(cn,Y)+obj(cn,H)) then if xs>obj(cn,X)+obj(cn,W)/1.4 and ys>obj(cn,Y)+obj(cn,H)/1.4 then action=2 if obj(cn,T)=6 then action=1 selected=cn exit for end if next if selected=0 then gosub [propertyupdate] action=0 end if if selected>0 and action=1 then #fful.gb "when leftButtonMove [track]" #fful.gb "when leftButtonUp [stop]" offsetX=xs-obj(selected,X) offsetY=ys-obj(selected,Y) end if if selected>0 and obj(selected,T)<>6 and action=2 then 'dont resize bmp #fful.gb "when leftButtonMove [tracksize]" #fful.gb "when leftButtonUp [stopsize]" offsetX=xs-(obj(selected,X)+obj(selected,W)) offsetY=ys-(obj(selected,Y)+obj(selected,H)) end if if selected>0 then gosub [drawit] else insertx=int((xs+(grid/2))/grid)*grid inserty=int((ys+(grid/2))/grid)*grid gosub [drawall] end if wait
[track] #fful.corner "UpperLeft" #fful.gb "rule xor" gosub [drawit] xt=int((MouseX-offsetX+(grid/2))/grid)*grid if negbar then if xt<0 then xt=0 end if if xt+obj(selected,W)>projectw and barrier then xt=projectw-obj(selected,W) obj(selected,X)=xt yt=int((MouseY-offsetY+(grid/2))/grid)*grid if menuset = 0 and textEd = 0 then if negbar then if yt<0 then yt=0 end if if yt+obj(selected,H)>projecth-25 and barrier then yt=projecth-obj(selected,H)-25 obj(selected,Y)=yt end if if menuset = 1 or textEd > 0 then if negbar then if yt < 0 then yt = 0 end if if yt+obj(selected,H)>projecth-50 and barrier then yt=projecth-obj(selected,H)-50 obj(selected,Y)=yt end if #fful.Xco "x ";str$(xt) #fful.Yco "y ";str$(yt) gosub [drawit] wait
[stop] #fful.gb "when leftButtonMove" #fful.gb "when leftButtonUp" action=0 #fful.gb "rule over" gosub [drawall] wait
[tracksize] #fful.corner "BottomRight" #fful.gb "rule xor" gosub [drawit] xs=int((MouseX-offsetX+(grid/2))/grid)*grid if xs>projectw and barrier then xs=projectw if xs<obj(selected,X) then xs=obj(selected,X)+grid ys=int((MouseY-offsetY+(grid/2))/grid)*grid if ys>projecth and barrier then ys=projecth if ys<obj(selected,Y)+ctrh and barrier then ys=obj(selected,Y)+ctrh obj(selected,W)=xs-obj(selected,X)'width if menuset = 1 or textEd > 0 then obj(selected,H)=ys-obj(selected,Y)-50'height if menuset = 0 and textEd = 0 then obj(selected,H)=ys-obj(selected,Y)-25'height #fful.Xco "x ";xs : #fful.Yco "y ";ys gosub [drawit] wait
[stopsize] #fful.gb "when leftButtonMove" #fful.gb "when leftButtonUp" action=0 #fful.gb "rule over" gosub [drawall] wait
[keys] k1=asc(right$(Inkey$,1)) k2=asc(left$(Inkey$,1)) if k1=46 then 'delete selected if obj(selected,T)=12 then menuset=0 if obj(selected,T)=11 then textEd = textEd-1 obj(selected,T)=0 selected=0 gosub [drawgrid] gosub [drawall] end if if k1=3 then 'copy cpy(1)=obj(selected,X) 'x cpy(2)=obj(selected,Y) 'y cpy(3)=obj(selected,W) 'w cpy(4)=obj(selected,H) 'h cpy(5)=obj(selected,T) 'type cpy(6)=obj(selected,TH) 'textheight cpy$(1)=obj$(selected,Ctr)'name cpy$(2)=obj$(selected,Tex)'text content cpy$(3)=obj$(selected,Res)'resource array or file path cpy$(4)=obj$(selected,Fon)'ctrl specific font or "" cpy$(5)=obj$(selected,Bak)'ctrl specific backcolor end if if k1=22 then 'paste if cpy(5)<>0 then obj=obj+1 obj(obj,X)=insertx obj(obj,Y)=inserty inserty=inserty+cpy(4)+grid obj(obj,W)=cpy(3) obj(obj,H)=cpy(4) obj(obj,T)=cpy(5) obj(obj,TH)=cpy(6) obj$(obj,Ctr)=left$(cpy$(1),2);obj obj$(obj,Tex)=cpy$(2) obj$(obj,Res)=cpy$(3) if obj(obj,T)=6 then loadbmp obj$(obj,Ctr),obj$(obj,Res) if obj(obj,T)=11 then textEd = textEd + 1 obj$(obj,Fon)=cpy$(4) obj$(obj,Bak)=cpy$(5) selected=obj gosub [drawall] end if end if #fful.gb "setfocus" wait
[tool] #fful.tool "selectionindex? i" [drawTool] cpy(5)=0 select case i case 1 'statictext obj(obj,X)=insertx obj(obj,Y)=inserty obj(obj,W)=150 obj(obj,H)=ctrh obj(obj,T)=1 obj$(obj,Ctr)="st";obj obj$(obj,Tex)="Statictext ";obj if ctrf$<>projectfont$ then obj$(obj,Fon)=ctrf$ obj(obj,TH)=ctrh end if obj$(obj,Bak)=projectback$ inserty=int((inserty+obj(obj,H)+(grid/2))/grid)*grid obj=obj+1 case 2 'textbox obj(obj,X)=insertx obj(obj,Y)=inserty obj(obj,W)=100 obj(obj,H)=ctrh obj(obj,T)=2 obj$(obj,Ctr)="tb";obj obj$(obj,Tex)="Textbox ";obj if ctrf$<>projectfont$ then obj$(obj,Fon)=ctrf$ obj(obj,TH)=ctrh end if obj$(obj,Bak)=projecttbcl$ inserty=int((inserty+obj(obj,H)+(grid/2))/grid)*grid obj=obj+1 case 3 'listbox obj(obj,X)=insertx obj(obj,Y)=inserty obj(obj,W)=80 obj(obj,H)=ctrh*5 obj(obj,T)=3 obj$(obj,Ctr)="lb";obj obj$(obj,Tex)="Listbox ";obj;"\item2\item3\item4\item5" obj$(obj,Res)=obj$(obj,Ctr);"$(" if ctrf$<>projectfont$ then obj$(obj,Fon)=ctrf$ obj(obj,TH)=ctrh end if obj$(obj,Bak)=projectlbcl$ inserty=int((inserty+obj(obj,H)+(grid/2))/grid)*grid obj=obj+1 case 4 'combobox obj(obj,X)=insertx obj(obj,Y)=inserty obj(obj,W)=100 obj(obj,H)=ctrh obj(obj,T)=4 obj$(obj,Ctr)="cb";obj obj$(obj,Tex)="Combobox ";obj;" \item2\item3\item4\item5" obj$(obj,Res)=obj$(obj,Ctr);"$(" if ctrf$<>projectfont$ then obj$(obj,Fon)=ctrf$ obj(obj,TH)=ctrh end if obj$(obj,Bak)=projectcbcl$ inserty=int((inserty+obj(obj,H)+(grid/2))/grid)*grid obj = obj + 1 case 5 'button obj(obj,X)=insertx obj(obj,Y)=inserty obj(obj,W)=100 obj(obj,H)=ctrh obj(obj,T)=5 obj$(obj,Ctr)="bt";obj obj$(obj,Tex)="Button ";obj if ctrf$<>projectfont$ then obj$(obj,Fon)=ctrf$ obj(obj,TH)=ctrh end if obj$(obj,Bak)="white" inserty=int((inserty+obj(obj,H)+(grid/2))/grid)*grid obj=obj+1 case 6 'bmp button obj(obj,X)=insertx obj(obj,Y)=inserty obj(obj,W)=50 obj(obj,H)=50 obj(obj,T)=6 obj$(obj,Ctr)="bb";obj filedialog "Choose an image","*.bmp",file$ if file$<>"" then file$=right$(file$,len(file$)-len(DefaultDir$)-1) open file$ for input as #bmp 'the bmpfileheader bmp$ = Input$(#bmp,lof(#bmp)) if mid$(bmp$,1,2) ="BM" then 'always BM obj(obj,W)=value(mid$(bmp$,19,4))'width obj(obj,H)=value(mid$(bmp$,23,4))'height obj$(obj,Res)=file$ obj$(obj,Tex)="bmp ";obj loadbmp obj$(obj,Ctr),file$ close #bmp inserty=int((inserty+obj(obj,H)+(grid/2))/grid)*grid obj=obj+1 else obj(obj,T)=0 close #bmp end if else obj(obj,T)=0 end if case 7 'graphicbox obj(obj,X)=insertx obj(obj,Y)=inserty obj(obj,W)=100 obj(obj,H)=100 obj(obj,T)=7 obj$(obj,Ctr)="gb";obj obj$(obj,Tex)="Graphicbox ";obj if ctrf$<>projectfont$ then obj$(obj,Fon)=ctrf$ obj(obj,TH)=ctrh end if inserty=int((inserty+obj(obj,H)+(grid/2))/grid)*grid obj=obj+1 case 8 'radiobutton radio = radio + 1 obj(obj,X)=insertx obj(obj,Y)=inserty obj(obj,W)=110 obj(obj,H)=ctrh obj(obj,T)=8 obj$(obj,Ctr)="rb";obj obj$(obj,Tex)=" RadioButton ";obj obj$(obj,Res)="[rb";obj;"Set],[rb";obj;"Reset]" if ctrf$<>projectfont$ then obj$(obj,Fon)=ctrf$ obj(obj,TH)=ctrh end if inserty=int((inserty+obj(obj,H)+(grid/2))/grid)*grid obj=obj+1 case 9 'checkbox obj(obj,X)=insertx obj(obj,Y)=inserty obj(obj,W)=100 obj(obj,H)=ctrh obj(obj,T)=9 obj$(obj,Ctr)="ch";obj obj$(obj,Tex)=" CheckBox ";obj obj$(obj,Res)="[ch";obj;"Set],[ch";obj;"Reset]" if ctrf$<>projectfont$ then obj$(obj,Fon)=ctrf$ obj(obj,TH)=ctrh end if obj$(obj,Bak)=projectback$ inserty=int((inserty+obj(obj,H)+(grid/2))/grid)*grid obj=obj+1 case 10 'groupbox obj(obj,X)=insertx obj(obj,Y)=inserty obj(obj,W)=100 obj(obj,H)=100 obj(obj,T)=10 obj$(obj,Ctr)="gr";obj obj$(obj,Tex)="GroupBox ";obj if ctrf$<>projectfont$ then obj$(obj,Fon)=ctrf$ obj(obj,TH)=ctrh end if obj$(obj,Bak)=projectback$ inserty=int((inserty+obj(obj,H)+(grid/2))/grid)*grid obj=obj+1 case 11 'texteditor textEd = textEd + 1 obj(obj,X)=insertx obj(obj,Y)=inserty obj(obj,W)=150 obj(obj,H)=75 obj(obj,T)=11 obj$(obj,Ctr)="te";obj obj$(obj,Tex)="Texteditor ";obj if ctrf$<>projectfont$ then obj$(obj,Fon)=ctrf$ obj(obj,TH)=ctrh end if obj$(obj,Bak)=projecttecl$ inserty=int((inserty+obj(obj,H)+(grid/2))/grid)*grid obj=obj+1 case 12 'menu if menuset=0 then 'obj=obj+1 obj(obj,X)=0 obj(obj,Y)=0 obj(obj,W)=100 obj(obj,H)=10 obj(obj,T)=12 obj$(obj,Ctr)="Menu " obj$(obj,Tex)=" Menu Added" menuset=1 obj=obj+1 end if end select selected=obj gosub [drawgrid] gosub [drawall] #fful.tool "select Add New" #fful.gb "setfocus" wait
[form] #fful.form "selectionindex? i" select case i case 1 'restore file$="lastsession.ffu" gosub [loadit] case 2 'new gosub [new] case 3 'save as gosub [saveas] case 4 'load gosub [load] case 6 'write gosub [write] case 7 'import gosub [import] 'case 8 'export 'gosub [export] end select #fful.form "select File" gosub [drawgrid] gosub [drawall] #fful.gb "setfocus" wait
[drawall] #fful.gb "discard ; redraw bak" ocn=cn projecttbcl$="white" projectlbcl$="white" projectcbcl$="white" projecttecl$="white" for cn=1 to obj gosub [drawit] next cn=ocn #fful.gb "place ";insertx;" ";inserty;" ; north ; turn 180 ; go ";10 #fful.gb "place ";insertx;" ";inserty;" ; turn -90 ; go ";10 #fful.gb "place ";insertx;" ";inserty;" ; turn 45 ; go ";20 #fful.gb "setfocus" return
[drawit] 'redraws control cn ----- what?
'set the color for the drawn object and action taking place if cn=selected then #fful.gb "color red" 'action 1 or 2 if action=2 then #fful.gb "color green" else #fful.gb "color ";projectfore$ end if
'set the font for the drawn object if obj$(cn,Fon)="" then #fful.gb "font ";projectfont$ ch=projectctrh if obj(cn,H)<ch then obj(cn,H)=ch else #fful.gb "font ";obj$(cn,Fon) ch=obj(cn,TH) if obj(cn,H)<ch then obj(cn,H)=ch end if
'update the properties textboxes for selected control if cn=selected then #prop.tbctrl obj$(cn,Ctr) 'ctrlname #prop.tbtext obj$(cn,Tex) 'text #prop.tbreso obj$(cn,Res) 'resource #prop.tbxywh obj(cn,X);" ";obj(cn,Y);" ";obj(cn,W);" ";obj(cn,H) 'xywh if obj$(cn,Fon)="" then #prop.tbfont projectfont$;":";obj(cn,TH) else #prop.tbfont obj$(cn,Fon);":";obj(cn,TH) 'font and height #prop.tbcolo obj$(cn,Bak) end if #fful.gb "place ";obj(cn,X);" ";obj(cn,Y) ' if obj$(cn,Tex)="" then obj$(cn,Tex)="Missing Text?" if obj$(cn,Tex)="" or obj$(cn,Tex)=chr$(34) then obj$(cn,Tex)="Missing Text?" select case obj(cn,T) case 1 'statictext #fful.gb "backcolor ";projectback$ #fful.gb "boxfilled ";obj(cn,X)+obj(cn,W);" ";obj(cn,Y)+obj(cn,H) #fful.gb "place ";obj(cn,X)+2;" ";obj(cn,Y)+ch/1.33;" ;\";obj$(cn,Tex) case 2 'textbox #fful.gb "backcolor ";projecttbcl$ #fful.gb "boxfilled ";obj(cn,X)+obj(cn,W);" ";obj(cn,Y)+obj(cn,H) if action=0 then #fful.gb "place ";obj(cn,X)+2;" ";obj(cn,Y)+ch/1.33;" ;\";obj$(cn,Tex) case 3 'listbox #fful.gb "backcolor ";projectlbcl$ #fful.gb "boxfilled ";obj(cn,X)+obj(cn,W);" ";obj(cn,Y)+obj(cn,H) if action=0 then #fful.gb "place ";obj(cn,X)+2;" ";obj(cn,Y)+ch/1.33;" ;\";obj$(cn,Tex) case 4 'combobox #fful.gb "backcolor ";projectcbcl$ #fful.gb "boxfilled ";obj(cn,X)+obj(cn,W);" ";obj(cn,Y)+obj(cn,H) if action=0 then #fful.gb "place ";obj(cn,X)+2;" ";obj(cn,Y)+ch/1.33;" ;\";obj$(cn,Tex) case 5 'button #fful.gb "backcolor white" #fful.gb "boxfilled ";obj(cn,X)+obj(cn,W);" ";obj(cn,Y)+obj(cn,H) 'buttons are always black on white #fful.gb "color black" 'centre button text #fful.gb "stringwidth? ";"A";" width" xp=(obj(cn,W)-width*len(obj$(cn,Tex)))/2 if action=0 then #fful.gb "place ";obj(cn,X)+xp;" ";obj(cn,Y)+ch/1.33;" ;\";obj$(cn,Tex) #fful.gb "color ";projectfore$ #fful.gb "backcolor ";projectback$ case 6 'bmpbutton if action=0 then #fful.gb "drawbmp ";obj$(cn,Ctr) #fful.gb "box ";obj(cn,X)+obj(cn,W);" ";obj(cn,Y)+obj(cn,H) case 7 ' graphicbox #fful.gb "backcolor white" #fful.gb "boxfilled ";obj(cn,X)+obj(cn,W);" ";obj(cn,Y)+obj(cn,H) if action=0 then #fful.gb "place ";obj(cn,X)+2;" ";obj(cn,Y)+ch/1.33;" ;\";obj$(cn,Tex) #fful.gb "backcolor ";projectback$ case 8 'radiobutton #fful.gb "backcolor ";projectback$ #fful.gb "boxfilled ";obj(cn,X)+obj(cn,W);" ";obj(cn,Y)+obj(cn,H) 'radiobutton text is always black #fful.gb "color black" if action=0 then #fful.gb "place ";obj(cn,X)+2;" ";obj(cn,Y)+ch/1.33;" ;\";obj$(cn,Tex) #fful.gb "color ";projectfore$ case 9 'checkbox #fful.gb "backcolor ";projectback$ #fful.gb "boxfilled ";obj(cn,X)+obj(cn,W);" ";obj(cn,Y)+obj(cn,H) 'checkbox text is always black #fful.gb "color black" if action=0 then #fful.gb "place ";obj(cn,X)+2;" ";obj(cn,Y)+ch/1.33;" ;\";obj$(cn,Tex) #fful.gb "color ";projectfore$ case 10 'groupbox #fful.gb "backcolor ";projectback$ 'groupbox is an outline #fful.gb "box ";obj(cn,X)+obj(cn,W);" ";obj(cn,Y)+obj(cn,H) 'group box text is always black #fful.gb "color black" 'groupbox text is offset if action=0 then #fful.gb "place ";obj(cn,X)+5;" ";obj(cn,Y)+ch/1.33-ch/2;" ;\";obj$(cn,Tex) #fful.gb "color ";projectfore$ case 11 ' texteditor #fful.gb "backcolor ";projecttecl$ #fful.gb "boxfilled ";obj(cn,X)+obj(cn,W);" ";obj(cn,Y)+obj(cn,H) if action=0 then #fful.gb "place ";obj(cn,X)+2;" ";obj(cn,Y)+ch/1.33;" ;\";obj$(cn,Tex) case 12 'menu 'pin to top left obj(cn,X)=10 : obj(cn,Y)=0 : obj(cn,W)=100 : obj(cn,H)=10 #fful.gb "backcolor ";projectback$ #fful.gb "boxfilled ";obj(cn,X)+obj(cn,W);" ";obj(cn,Y)+obj(cn,H) #fful.gb "place ";obj(cn,X)+2;" ";obj(cn,Y)+ch/1.33;" ;\";obj$(cn,Tex) case 21 'tecolor projecttecl$=obj$(cn,Bak) case 22 'tbcolor projecttbcl$=obj$(cn,Bak) case 23 'lbcolor projectlbcl$=obj$(cn,Bak) case 24 'cbcolor projectcbcl$=obj$(cn,Bak) '41,42,43,44,45 and 50 51 ignored ie back/fore w/h open and font objects end select return
[preview] file$="preview.bas" #fful.path "File - preview.bas" gosub [writeit] wait
[write] projectfile$=left$(projectfile$,len(projectfile$)-3)+"bas" filedialog "Save .bas",projectfile$,file$ if file$ = "" then return
file$=right$(file$,len(file$)-len(DefaultDir$)-1) if fileExists(DefaultDir$, file$) = 0 then notice "IMPORT ERROR"+chr$(13)+"You MUST choose a file from the same"+chr$(13)+"folder this application is Run from"+chr$(13)+chr$(13)+"Copy any files you wish to import to DefaultDir$ "+chr$(13)+DefaultDir$+chr$(13)+"then try importing the file again" return end if [writeit] if file$<>"" then open file$ for output as #op #fful.path "File - ";file$ 'the header #op " 'Project ";projecttitl$ #op " 'Created with Freeform NOT SO Lite v";ver$;" ";date$();" ";time$() #op "" if projectback$<>"white" or projectfore$<>"black" then #op " 'Set BackgroundColor$ and ForegroundColor$ of project" #op " BackgroundColor$=";chr$(34);projectback$;chr$(34) #op " ForegroundColor$=";chr$(34);projectfore$;chr$(34) #op "" end if #op " 'Create arrays needed for controls listbox,combobox" for n= 1 to obj if obj(n,T)=3 or obj(n,T)=4 then #op " dim ";obj$(n,Res);"10)" #op " for n = 1 to 10" #op " ";obj$(n,Res);"n)= str$(n)" #op " next" end if next #op "" #op " 'Create controls and open window" #op " nomainwin" #op " WindowWidth = ";projectw #op " WindowHeight = ";projecth #op " UpperLeftX = int((DisplayWidth-WindowWidth)/2)" #op " UpperLeftY = int((DisplayHeight-WindowHeight)/2)" if menuset then #op " menu ";projectform$;", ";chr$(34);"&File";chr$(34);", ";chr$(34);"&Open";chr$(34);", [dummy], ";chr$(34);"&Save";chr$(34);", [dummy], ";chr$(34);"&Load";chr$(34);", [dummy]" if textEd > 0 then #op " menu ";projectform$;", ";chr$(34);"&Edit";chr$(34) end if #op " menu ";projectform$;", ";chr$(34);"&Tools";chr$(34);", ";chr$(34);"Preferences";chr$(34);", [dummy]"', ";chr$(34);"Large";chr$(34);", [dummy]" #op " menu ";projectform$;", ";chr$(34);"&Options";chr$(34);", ";chr$(34);"Fonts";chr$(34);", [dummy], ";chr$(34);"Colors";chr$(34);", [dummy]" #op " menu ";projectform$;", ";chr$(34);"&About";chr$(34) end if for n=1 to obj select case obj(n,T) case 1 'statictext #op " statictext ";projectform$;".";obj$(n,Ctr);" ";chr$(34);trim$(obj$(n,Tex));chr$(34);",";obj(n,X);",";obj(n,Y)+5;",";obj(n,W);",";obj(n,H) case 2 'textbox #op " textbox ";projectform$;".";obj$(n,Ctr);",";obj(n,X);",";obj(n,Y);",";obj(n,W);",";obj(n,H) case 3 'list box lbl$=nvl$(obj$(n,Lbl),"[";obj$(n,Ctr);"Selected]") if left$(lbl$,1) <> "[" then goto [goRound1] #op " listbox ";projectform$;".";obj$(n,Ctr);",";obj$(n,Res);","; nvl$(obj$(n,Lbl),"[";obj$(n,Ctr);"Selected]");",";obj(n,X)+1;",";obj(n,Y);",";obj(n,W)-2;",";obj(n,H) [goRound1] if left$(lbl$,1) <> "[" then fix1$ = "[";obj$(n,Ctr);"Selected]" #op " listbox ";projectform$;".";obj$(n,Ctr);",";obj$(n,Res);","; fix1$;",";obj(n,X)+1;",";obj(n,Y);",";obj(n,W)-2;",";obj(n,H) end if case 4 'combobox lbl$=nvl$(obj$(n,Lbl),"[";obj$(n,Ctr);"Selected]") if left$(lbl$,1) <> "[" then goto [goRound2] #op " combobox ";projectform$;".";obj$(n,Ctr);",";obj$(n,Res);","; nvl$(obj$(n,Lbl),"[";obj$(n,Ctr);"Selected]");",";obj(n,X)+1;",";obj(n,Y);",";obj(n,W)-2;",";obj(n,H) [goRound2] if left$(lbl$,1) <> "[" then #op " combobox ";projectform$;".";obj$(n,Ctr);",";obj$(n,Res);","; fix1$;",";obj(n,X)+1;",";obj(n,Y);",";obj(n,W)-2;",";obj(n,H) end if case 5 'button lbl$=nvl$(obj$(n,Lbl),"[";obj$(n,Ctr);"Clicked]") if left$(lbl$,1) <> "[" then goto [goRound3] #op " button ";projectform$;".";obj$(n,Ctr);",";chr$(34);obj$(n,Tex);chr$(34);","; nvl$(obj$(n,Lbl),"[";obj$(n,Ctr);"Clicked]");", UL, ";obj(n,X);",";obj(n,Y);",";obj(n,W);",";obj(n,H) [goRound3] if left$(lbl$,1) <> "[" then fix2$ = "[";obj$(n,Ctr);"Clicked], UL" #op " button ";projectform$;".";obj$(n,Ctr);",";chr$(34);obj$(n,Tex);chr$(34);","; fix2$;",";obj(n,X)+1;",";obj(n,Y);",";obj(n,W)-2;",";obj(n,H) end if case 6 'bmpbutton lbl$=nvl$(obj$(n,Lbl),"[";obj$(n,Ctr);"Clicked]") if left$(lbl$,1) <> "[" then goto [goRound4] #op " bmpbutton ";projectform$;".";obj$(n,Ctr);",";chr$(34);obj$(n,Res);chr$(34);","; nvl$(obj$(n,Lbl),"[";obj$(n,Ctr);"Clicked]");", UL, ";obj(n,X);",";obj(n,Y) [goRound4] if left$(lbl$,1) <> "[" then #op " bmpbutton ";projectform$;".";obj$(n,Ctr);",";chr$(34);obj$(n,Res);chr$(34);","; fix2$;",";obj(n,X)+1;",";obj(n,Y) ';",";obj(n,W)-2;",";obj(n,H) end if case 7 'graphicbox #op " graphicbox ";projectform$;".";obj$(n,Ctr);",";obj(n,X);",";obj(n,Y);",";obj(n,W);",";obj(n,H) case 8 'radiobutton lbl$=nvl$(obj$(n,Lbl),"[";obj$(n,Ctr);"Set],[";obj$(n,Ctr);"Reset]") if left$(lbl$,1) <> "[" then lbl$ = "[";lbl$;"Set],[";lbl$;"Reset]" end if #op " radiobutton ";projectform$;".";obj$(n,Ctr);",";chr$(34);obj$(n,Tex);chr$(34);",";lbl$;",";obj(n,X);",";obj(n,Y);",";obj(n,W);",";obj(n,H) case 9 'checkbox lbl$=nvl$(obj$(n,Lbl),"[";obj$(n,Ctr);"Set],[";obj$(n,Ctr);"Reset]") if left$(lbl$,1) <> "[" then lbl$ = "[";lbl$;"Set],[";lbl$;"Reset]" end if #op " checkbox ";projectform$;".";obj$(n,Ctr);",";chr$(34);obj$(n,Tex);chr$(34);",";lbl$;",";obj(n,X);",";obj(n,Y);",";obj(n,W);",";obj(n,H) case 10 'group box #op " groupbox ";projectform$;".";obj$(n,Ctr);",";chr$(34);obj$(n,Tex);chr$(34);",";obj(n,X);",";obj(n,Y)-5;",";obj(n,W);",";obj(n,H) case 11 'texteditor #op " texteditor ";projectform$;".";obj$(n,Ctr);",";obj(n,X);",";obj(n,Y);",";obj(n,W);",";obj(n,H) case 22 'tbcolor #op " TextboxColor$=";chr$(34);obj$(n,Bak);chr$(34) case 23 'lbcolor #op " ListboxColor$=";chr$(34);obj$(n,Bak);chr$(34) case 24 'cbcolor #op " ComboboxColor$=";chr$(34);obj$(n,Bak);chr$(34) case 21 'tecolor #op " TexteditorColor$=";chr$(34);obj$(n,Bak);chr$(34) end select next #op " open ";chr$(34);projecttitl$;chr$(34);" for ";projectwind$;" as ";projectform$ if trapped <> 1 then #op " ";projectform$;" ";chr$(34);"trapclose [quit]";chr$(34) else #op " ";projectform$;" ";chr$(34);"!trapclose [quit]";chr$(34) end if #op " ";projectform$;" ";chr$(34);"font ";projectfont$;chr$(34) #op "" #op " 'Set any listbox or combobox to display the first item on the list" for n= 1 to obj if obj(n,T)=3 or obj(n,T)=4 then #op " ";projectform$;".";obj$(n,Ctr);" ";chr$(34);"selectindex 1";chr$(34) end if next #op " 'apply any control specific fonts" for n= 1 to obj if obj(n,T)<>0 and obj$(n,Fon)<>"" then if obj(n,T)=1 or obj(n,T)=2 or obj(n,T)=5 or obj(n,T)=10 or obj(n,T)=11 then #op " ";projectform$;".";obj$(n,Ctr);" ";chr$(34);"!font ";obj$(n,Fon);chr$(34) end if if obj(n,T)=3 or obj(n,T)=4 or obj(n,T)=7 or obj(n,T)=8 or obj(n,T)=9 then #op " ";projectform$;".";obj$(n,Ctr);" ";chr$(34);"font ";obj$(n,Fon);chr$(34) end if end if next #op " wait" #op "" 'an imaginary line beteen pre-window code and post window code '######################################################################################## 'if file$<>"preview.bas" then #op " 'Create the required handlers for each control" for n=1 to obj select case obj(n,T) case 3,4 'listbox, combobox lbl$=nvl$(obj$(n,Lbl),"[";obj$(n,Ctr);"Selected]") if instr(labelList$, lbl$)=0 then 'label NOT already written if left$(lbl$,1) <> "[" then lbl$ = "[";lbl$;"Selected]" 'write label #op " ";lbl$ #op " 'Your handler code here, read the control with" #op " ";projectform$;".";obj$(n,Ctr);" ";chr$(34);"selection? Selected$";chr$(34) #op " wait" #op "" 'and remember it labelList$= labelList$+" "+ lbl$ end if case 5, 6 'button, bmpbutton lbl$=nvl$(obj$(n,Lbl),"[";obj$(n,Ctr);"Clicked]") if left$(lbl$,1) <> "[" then lbl$ = "[";lbl$;"Clicked]" if instr(labelList$, lbl$)=0 then 'label NOT already written 'write label #op " ";lbl$ #op " 'Your handler code here" #op " wait" #op "" 'and remember it labelList$= labelList$+" "+ lbl$ end if case 8,9 'radiobutton, checkbox for i = 1 to 2 'set,reset labels lbl$=nvl$(obj$(n,Lbl),"[";obj$(n,Ctr);"Set],[";obj$(n,Ctr);"Reset]") lbl$=word$(lbl$,i,",") if instr(labelList$, lbl$)=0 and left$(lbl$,1) = "[" then 'label NOT already written #op " ";lbl$ #op " ";projectform$;".";obj$(n,Ctr);" ";chr$(34);"value? result$";chr$(34) 'write label if left$(lbl$,1) <> "[" and lbl$ <> "" then #op "[";lbl$;"Set]" #op " ";projectform$;".";obj$(n,Ctr);" ";chr$(34);"value? result$";chr$(34) #op " wait" #op "" end if if left$(lbl$,1) <> "[" and lbl$ <> "" then #op "[";lbl$;"Reset]" #op " ";projectform$;".";obj$(n,Ctr);" ";chr$(34);"value? result$";chr$(34) #op " wait" #op "" end if #op " wait" #op "" 'and remember it labelList$= labelList$+" "+ lbl$ end if next end select next if menuset <> 0 then #op " [dummy]" #op " 'Your Handler code here" #op " wait" #op "" end if 'end if #op " [quit]" #op " close ";projectform$ #op " end" close #op lbl$ = "" labelList$ = "" files "c:\program files (x86)\liberty basic pro v4.5.1\","lbpro.exe", info$() if val(info$(0, 0)) > 0 then run chr$(34);"c:\program files (x86)\liberty basic pro v4.5.1\lbpro.exe";chr$(34);" -R -A ";DefaultDir$;"\";file$ goto [done] end if files "c:\program files (x86)\liberty basic pro v4.04\","lbpro.exe", info$() if val(info$(0, 0)) > 0 then run chr$(34);"c:\program files (x86)\liberty basic pro v4.04\lbpro.exe";chr$(34);" -R -A ";DefaultDir$;"\";file$ goto [done] end if files "c:\program files (x86)\liberty basic v4.5.1\","liberty.exe", info$() if val(info$(0, 0)) > 0 then run chr$(34);"c:\program files (x86)\liberty basic v4.5.1\liberty.exe";chr$(34);" -R -A ";DefaultDir$;"\";file$ goto [done] end if files "c:\program files (x86)\just basic v2.0\","jbasic.exe", info$() if val(info$(0, 0)) > 0 then run chr$(34);"c:\program files (x86)\just basic v2.0\jbasic.exe";chr$(34);" -R -A ";DefaultDir$;"\";file$ goto [done] end if files "c:\program files\just basic v2.0\","jbasic.exe", info$() if val(info$(0, 0)) > 0 then run chr$(34);"c:\program files\just basic v2.0\jbasic.exe";chr$(34);" -R -A ";DefaultDir$;"\";file$ goto [done] end if
notice "tsh73 says - FIXME: path to BASIC EXE not set" [done] end if return
[saveas] projectname$=left$(projectfile$,len(projectfile$)-4)+".ffu" filedialog "Save As...",projectname$,file$ if file$<>"" then open file$ for output as #op projectfile$=right$(file$,len(file$)-len(DefaultDir$)-1) #fful.path "File - ";projectfile$ 'the form name #xxxx #prop.tbform "!contents? t$" if t$<>projectform$ then projectform$=t$ dim hnd$(10) hnd$(1)=projectform$ #fful.hand "reload" #fful.hand "select ";projectform$ end if 'the form/windo title text #prop.tbtitl "!contents? t$" if t$<>projecttitl$ then projecttitl$=t$ #op projectfile$ #op projectwind$ #op projectform$ #op projecttitl$ #op projectfont$ #op projectback$ #op projectfore$ #op projectctrh #op projectgrid #op projectw #op projecth for n=1 to obj if obj(n,T)<>0 then #op obj(n,X);","; #op obj(n,Y);","; #op obj(n,W);","; #op obj(n,H);","; #op obj(n,T);","; #op obj(n,TH) #op obj$(n,Ctr) #op obj$(n,Tex) #op obj$(n,Res) #op obj$(n,Fon) #op obj$(n,Bak) end if next close #op gosub [propertyupdate] redim hnd$(30) hnd$(1)=projectform$ #fful.hand "reload" #fful.hand "selectindex 1" end if return
[load] filedialog "Open Project...","*.ffu",file$ if file$ = "" then return [loadit] if file$<>"" then projectfile$=right$(file$,len(file$)-len(DefaultDir$)-1) if instr(file$,DefaultDir$,1) = 0 then notice "IMPORT ISSUE"+chr$(13)+"You MUST choose a file from the same"+chr$(13)+"folder this application is Run from"+chr$(13)+chr$(13)+"Copy any files you wish to import to DefaultDir$ "+chr$(13)+DefaultDir$+chr$(13)+"then try importing the file again" return end if #fful.path "File - ";projectfile$ open file$ for input as #ses input #ses, projectfile$ input #ses, projectwind$ input #ses, projectform$ input #ses, projecttitl$ input #ses, projectfont$ if projectfont$="" then projectfont$="Consolas 9" #fful.gb "font ";projectfont$ input #ses, projectback$ input #ses, projectfore$ input #ses, c$ input #ses, g$ input #ses, w$ input #ses, h$ projectctrh=val(c$) projectgrid=val(g$) grid=projectgrid projectw=val(w$) projecth=val(h$) #prop.cbwind "select ";projectwind$ redim hnd$(30) hnd$(1)=projectform$ #fful.hand "reload" #fful.hand "selectindex 1" #fful.grid "select ";grid #fful.w "select ";projectw #fful.h "select ";projecth gosub [drawgrid] obj=0 while eof(#ses) = 0 obj=obj+1 line input #ses, l$ obj(obj,X)=val(word$(l$,1,",")) obj(obj,Y)=val(word$(l$,2,",")) obj(obj,W)=val(word$(l$,3,",")) obj(obj,H)=val(word$(l$,4,",")) obj(obj,T)=val(word$(l$,5,",")) obj(obj,TH)=val(word$(l$,6,",")) line input #ses, obj$(obj,Ctr) line input #ses, obj$(obj,Tex) line input #ses, obj$(obj,Res) line input #ses, obj$(obj,Fon) line input #ses, obj$(obj,Bak) if obj(obj,T)=6 then loadbmp obj$(obj,Ctr),obj$(obj,Res) if obj(obj,T)=11 then textEd = textEd + 1 : gosub [drawgrid] if obj(obj,T)=12 then menuset=1 wend close #ses gosub [propertyupdate] #prop "hide" #prop "show" end if return
[import] textEd = 0 filedialog "Open .bas...","*.bas",file$ if file$ = "" then return if instr(file$,DefaultDir$,1) = 0 then notice "IMPORT ERROR"+chr$(13)+"You MUST choose a file from the same"+chr$(13)+"folder this application is Run from"+chr$(13)+chr$(13)+"Copy any files you wish to import to DefaultDir$ "+chr$(13)+DefaultDir$+chr$(13)+"then try importing the file again" return end if [importit] if file$<>"" then 'check size open file$ for input as #bas cursor hourglass WindowWidth = 200 WindowHeight=100 UpperLeftX=(DisplayWidth)/2 - 100 UpperLeftY=(DisplayHeight)/2 - 100 statictext #please.wait, "Please Wait", 30,35,140,40 open "Please Wait" for window_popup as #please please = 1 #please "trapclose [quitplease]" #please.wait "!font arial 18 bold" maxln=0 while eof(#bas)=0 line input #bas, wln$ maxln=maxln+1 wend close #bas 'add margin for split lines dim bas$(maxln+1000,4)'an array of code lines and line numbers gosub [new] projectfile$=right$(file$,len(file$)-len(DefaultDir$)-1) #fful.path projectfile$ 'set grid to 1 and invisible so controls stay where they import from initially 'grid=1 'gridvisible=0 'gosub [drawgrid] 'create objects for only those lines defining controls we are interested in wordlist$=" statictext textbox listbox combobox button bmpbutton graphicbox " wordlist$=wordlist$+"radiobutton checkbox groupbox texteditor open " 'no menu wordlist$=wordlist$+"textboxcolor$ listboxcolor$ comboboxcolor$ texteditorcolor$ " wordlist$=wordlist$+"windowwidth windowheight "' no upperleftx upperlefty " wordlist$=wordlist$+"backgroundcolor$ foregroundcolor$ font " ln=1 bln=1 open file$ for input as #bas while eof(#bas)=0 line input #bas, wln$ 'ignore 'or rem lines if left$(lower$(trim$(wln$)),1)="'" or left$(lower$(trim$(wln$)),4)="rem " then bas$(ln,1)=str$(ln) bas$(ln,2)=trim$(wln$) ln=ln+1 else 'break into multiple lines if ":" found outside quotes pos=1 ln$="" while pos<=len(wln$) c$=mid$(wln$,pos,1) if c$=chr$(34)then if quote=0 then quote=1 else quote=0 end if if c$=":" and quote=0 then gosub [line] ln$="" pos=pos+1 else ln$=ln$+c$ pos=pos+1 end if wend gosub [line] bln=bln+1 end if wend basln=ln-1 close #bas redim win$(30,10)'an array of forms within .bas redim hnd$(30)'an array of form names for handle combobox wh=1 'The following forms were found for ln=1 to basln if bas$(ln,3)="#" then if instr(bas$(ln,2),"BackgroundColor$",1)>0 then projectback$=getcolor$(bas$(ln,2)) : win$(wh,6)=bas$(ln,1) if instr(bas$(ln,2),"ForegroundColor$",1)>0 then projectfore$=getcolor$(bas$(ln,2)) : win$(wh,7)=bas$(ln,1) if instr(bas$(ln,2),"WindowWidth",1)>0 then w$=getsize$(bas$(ln,2)):win$(wh,8)=bas$(ln,1) if instr(bas$(ln,2),"WindowHeight",1)>0 then h$=getsize$(bas$(ln,2)):win$(wh,9)=bas$(ln,1) 'if instr(lower$(bas$(ln,2)),"open",1)>0 then 'if lower$(word$(bas$(ln,2),1)) = "open" and left$(word$(bas$(ln,2),2, " as "),1) = "#" then if lower$(word$(bas$(ln,2),1)) = "open" and left$(word$(bas$(ln,2),2, " as "),1) = "#" then if instr(lower$(bas$(ln,2)),"window",1)>0 or instr(lower$(bas$(ln,2)),"dialog",1)>0 or instr(lower$(bas$(ln,2)),"graphic",1)>0 then win$(wh,10)=bas$(ln,1) n$=word$(bas$(ln,2),2,chr$(34)) hn$="#"+right$(bas$(ln,2),len(bas$(ln,2))-instr(bas$(ln,2),"#",1)) 'find last "for" in command line i=1 while i oi=i i=instr(lower$(bas$(ln,2))," for ",i+1) wend wt$=right$(bas$(ln,2),len(bas$(ln,2))-oi) wt$=word$(wt$,2) win$(wh,1)=hn$ 'handle #fful etc win$(wh,2)=n$ 'title win$(wh,3)=w$ 'width win$(wh,4)=h$ 'height win$(wh,5)=wt$ 'windowtype hnd$(wh)=hn$ 'for combobox 'print wh;" ";hnd$(wh);" ";win$(wh,2);" ";win$(wh,3);" ";win$(wh,4);" ";win$(wh,5) wh=wh+1 end if end if end if next #fful.hand "reload" #fful.hand "selectindex 1" wh=1 gosub [loadwindow] end if if please = 1 then please = 0 close #please cursor normal end if return
[line] bas$(ln,1)=str$(ln) bas$(ln,2)=trim$(ln$) w$=lower$(word$(ln$,1)) if instr(w$,"=",1)>1 then w$=word$(w$,1,"=") if len(w$)>3 then w1$=" "+w$+" " w2$=" "+w$+"=" if instr(wordlist$,w1$,1)>0 or instr(wordlist$,w2$,1)>0 or instr(lower$(ln$),"font ",1)>0 then bas$(ln,3)="#" end if 'print ln;" ";bas$(ln,1);" ";bas$(ln,2);" ";bas$(ln,3) ln=ln+1 return
[hand] #fful.hand "selectionindex? wh" gosub [loadwindow] wait
[loadwindow] redim obj(300,6) 'x,y,width/height,type,textheight redim obj$(300,7) 'name,text content,resource,font obj=1 menuset=0 projectback$="white" TextboxColor$="white" ListboxColor$="white" ComboboxColor$="white" TexteditorColor$="white" projectfore$="black" projectw=val(win$(wh,3)) if projectw=0 then projectw=320 projecth=val(win$(wh,4)) if projecth=0 then projecth=360 projecttitl$=win$(wh,2) projectwind$=win$(wh,5) projectform$=win$(wh,1) tbc$="" lbc$="" cbc$="" tec$="" gosub [propertyupdate] #fful.w "!";str$(projectw) #fful.h "!";str$(projecth)
'find controls and create obj() array for form we are interested in for ln=1 to basln if bas$(ln,3)="#" then 'reset obj pointer bas$(ln,4)="" if instr(bas$(ln,2), lower$("texteditor #"),1) > 0 then textEd = textEd + 1 : gosub [drawgrid] 'create objects to control color only check lines after previous open statement up to our open statement if bas$(ln,1)>win$(wh-1,10) and bas$(ln,1)<=win$(wh,10) then if instr(bas$(ln,2),"TextboxColor$",1)>0 then obj(obj,T)=22 : obj$(obj,Bak)=getcolor$(bas$(ln,2)):obj$(obj,Bas)=bas$(ln,1):bas$(ln,4)=str$(obj):obj=obj+1 if instr(bas$(ln,2),"ListboxColor$",1)>0 then obj(obj,T)=23 : obj$(obj,Bak)=getcolor$(bas$(ln,2)):obj$(obj,Bas)=bas$(ln,1):bas$(ln,4)=str$(obj):obj=obj+1 if instr(bas$(ln,2),"ComboboxColor$",1)>0 then obj(obj,T)=24 : obj$(obj,Bak)=getcolor$(bas$(ln,2)):obj$(obj,Bas)=bas$(ln,1):bas$(ln,4)=str$(obj):obj=obj+1 if instr(bas$(ln,2),"TexteditorColor$",1)>0 then obj(obj,T)=21 : obj$(obj,Bak)=getcolor$(bas$(ln,2)):obj$(obj,Bas)=bas$(ln,1):bas$(ln,4)=str$(obj):obj=obj+1 end if for wc=1 to 12 if instr(lower$(bas$(ln,2)),word$(wordlist$,wc),1)=1 and instr(lower$(bas$(ln,2)),lower$(projectform$),1)>0 then exit for next if wc<=11 then obj$(obj,Bas)=bas$(ln,1) bas$(ln,4)=str$(obj) l$=bas$(ln,2) ll$="" 'remove spaces leaving only , separation but keep "" text untouched inString=0 for i=1 to len(l$) c$=mid$(l$,i,1) select case case c$=chr$(34) inString=1-inString case (inString=0) and c$=" " c$="" end select ll$=ll$+c$ next 'insert missing comma if missing if instr(ll$,","+chr$(34),1)=0 then ll$=left$(ll$,instr(ll$,chr$(34),1)-1)+","+right$(ll$,len(ll$)-instr(ll$,chr$(34),1)+1) if left$(ll$,1)="," then ll$=right$(ll$,len(ll$)-1) obj(obj,T)=wc 'type obj(obj,TH)=projectctrh 'get the .ctrl name obj$(obj,Ctr)=right$(word$(ll$,1,","),len(word$(ll$,1,","))-len(word$(ll$,1,"."))-1) 'for un-named controls if obj$(obj,Ctr)="" then obj$(obj,Ctr) = word$(wordlist$,wc);obj 'get the text if wc=1 or wc=5 or wc=8 or wc=9 or wc=10 then obj$(obj,Tex)=word$(ll$,2,chr$(34)) else obj$(obj,Tex)=word$(wordlist$,wc) 'get the array or bmp file name if wc=3 or wc=4 or wc=6 then obj$(obj,Res)=word$(ll$,2,",") if wc=8 or wc=9 then obj$(obj,Res)=word$(ll$,3,",")+","+word$(ll$,4,",") 'get rid of "" if wc=6 and left$(obj$(obj,Res),1)=chr$(34) then obj$(obj,Res)=mid$(obj$(obj,Res),2,len(obj$(obj,Res))-2) 'array() -> array( if (wc=3 or wc=4) and right$(obj$(obj,Res),1)=")" then obj$(obj,Res)=left$(obj$(obj,Res), len(obj$(obj,Res))-1) i=1 while word$(ll$,i,",")<>"" i=i+1 wend i=i-4 if wc=6 or wc=5 then 'buttons and bmpbuttons can have xy, wh is optional and they have XX corners if i=3 then obj(obj,X)=val(word$(ll$,i+2,","))'x obj(obj,Y)=val(word$(ll$,i+3,","))'y if wc=5 then 'we need to find a way to calculate width and height if not given #fful.gb "stringwidth? ";"A";" width" obj(obj,W)=width*len(obj$(obj,Tex))+10 obj(obj,H)=projectctrh end if if wc=6 then 'we need a way to set bmp w and h on error goto [dummybmp] open obj$(obj,Res) for input as #bmp 'the bmpfileheader bmp$ = Input$(#bmp,lof(#bmp)) if mid$(bmp$,1,2) ="BM" then 'always BM obj(obj,W)=value(mid$(bmp$,19,4))'width obj(obj,H)=value(mid$(bmp$,23,4))'height obj$(obj,Tex)="bmp" end if loadbmp obj$(obj,Ctr),obj$(obj,Res) close #bmp goto [passdummy]
[dummybmp] obj(obj,W)=25 obj(obj,H)=25 obj$(obj,Tex)="bmp" loadbmp obj$(obj,Ctr),"path.bmp" [passdummy] end if else obj(obj,X)=val(word$(ll$,i,","))'x obj(obj,Y)=val(word$(ll$,i+1,","))'y obj(obj,W)=val(word$(ll$,i+2,","))'w obj(obj,H)=val(word$(ll$,i+3,","))'h end if if upper$(word$(ll$,4,","))="LR" then obj(obj,X)=projectw-obj(obj,X)-obj(obj,W)'x obj(obj,Y)=projecth-obj(obj,Y)-obj(obj,H)'y end if if upper$(word$(ll$,4,","))="LL" then 'obj(obj,X)=projectw-obj(obj,X)-obj(obj,W)'x obj(obj,Y)=projecth-obj(obj,Y)-obj(obj,H)'y end if if upper$(word$(ll$,4,","))="UR" then obj(obj,X)=projectw-obj(obj,X)-obj(obj,W)'x 'obj(obj,Y)=projecth-obj(obj,Y)-obj(obj,H)'y end if else 'write to .bas tweaks listbox and combobox controls to line up properly 'so we need to untweak them now obj(obj,X)=val(word$(ll$,i,","))'x obj(obj,Y)=val(word$(ll$,i+1,","))'y if wc=1 then obj(obj,Y)=obj(obj,Y)-5 if wc=10 then obj(obj,Y)=obj(obj,Y)+5 if wc=3 or wc=4 then obj(obj,X)=obj(obj,X)-1 obj(obj,W)=val(word$(ll$,i+2,","))'w if wc=3 or wc=4 then obj(obj,W)=obj(obj,W)+2 obj(obj,H)=val(word$(ll$,i+3,","))'h end if obj=obj+1 end if end if next
'now find font commands listed after the open statement referring to the #form '#form.ctrl !font fontname 'if so add a new font object for ln = 1 to basln if bas$(ln,3)="#" then lln$=lower$(bas$(ln,2)) if (instr(lln$,lower$(projectform$),1)>0 and instr(lln$,chr$(34);"font ",1)>0) or (instr(lln$,lower$(projectform$),1)>0 and instr(lln$,chr$(34);"!font ",1)>0) then f$=right$(lln$,len(lln$)-instr(lln$,"font",1)-4) if instr(f$,";",1)=0 then obj$(obj,Fon)=f$ obj$(obj,Fon)=left$(obj$(obj,Fon),len(obj$(obj,Fon))-1) obj$(obj,Ctr)=word$(word$(lln$,1),2,".") if instr(lln$,"!font",1)>0 then obj(obj,T)=51 else obj(obj,T)=50 obj$(obj,Bas)=str$(ln) bas$(ln,4)=str$(obj)
'find the visible object and store the font change for n=1 to obj if obj$(n,Ctr)=obj$(obj,Ctr) then obj$(n,Fon)=obj$(obj,Fon) #fful.gb "font ";obj$(obj,Fon) #fful.gb "place 100 100 ;\Q\Q" #fful.gb "posxy xp yp" obj(n,TH)=(yp-100)/2+7 exit for end if next obj=obj+1 end if end if end if next if win$(wh,6)<>"" then bas$(val(win$(wh,6)),4)=str$(obj) obj$(obj,Bas)=win$(wh,6) obj(obj,T)=41 obj=obj+1 'backgroundcolor end if if win$(wh,7)<>"" then bas$(val(win$(wh,7)),4)=str$(obj) obj$(obj,Bas)=win$(wh,7) obj(obj,T)=42 obj=obj+1 'foregroundcolor end if if win$(wh,8)<>"" then bas$(val(win$(wh,8)),4)=str$(obj) obj$(obj,Bas)=win$(wh,8) obj(obj,T)=43 obj=obj+1 'windowwidth end if if win$(wh,9)<>"" then bas$(val(win$(wh,9)),4)=str$(obj) obj$(obj,Bas)=win$(wh,9) obj(obj,T)=44 obj=obj+1 n=n+1 'windowheight end if if win$(wh,10)<>"" then bas$(val(win$(wh,10)),4)=str$(obj) obj$(obj,Bas)=win$(wh,10) obj(obj,T)=45 obj=obj+1 'open statement end if obj=obj-1
for n=1 to obj print n;" ";obj$(n,Bas);" ";obj(n,X);" ";obj(n,Y);" ";obj(n,W);" ";obj(n,H);" ";obj(n,T);" ";obj(n,6);" "; print obj$(n,Ctr);" ";obj$(n,Tex);" ";obj$(n,Res);" ";obj$(n,Fon);" ";obj$(n,Bak);" ";obj$(n,6);" ";obj$(n,Bas) print "Obj ";n,"Bas ";obj$(n,Bas),"Type ";obj(n,T) next
gosub [drawgrid] gosub [drawall] #prop "hide" #prop "show" show=1 return
[export] 'all previously imported lines will be deleted and replaced by the obj( lines 'deletelist$ remembers the original imported line numbers in line number order if file$<>"" and right$(file$,3)="bas" then open file$ for output as #bas for ln=1 to basln 'find any object associated with this line found=0 for l=1 to obj if bas$(ln,1)=obj$(l,Bas) then found=1 'have we got to the open command line yet if obj(l,T)=45 then 'write all new lines prior to 45 (controls) for m=1 to obj if obj$(m,Bas)="" and obj(m,T)<45 and obj(m,T)<>0 then n=m gosub [exportline] end if next 'write 45 (open line) n=l gosub [exportline] 'write all new lines after 45 (open) ie (fonts) 'apply any control specific fonts" for m= 1 to obj if obj(m,T)<>0 and obj$(m,Fon)<>"" then if obj(m,T)=1 or obj(m,T)=2 or obj(m,T)=5 or obj(m,T)=10 or obj(m,T)=11 then #bas " ";projectform$;".";obj$(m,Ctr);" ";chr$(34);"!font ";obj$(m,Fon);chr$(34) end if if obj(m,T)=3 or obj(m,T)=4 or obj(m,T)=7 or obj(m,T)=8 or obj(m,T)=9 then #bas " ";projectform$;".";obj$(m,Ctr);" ";chr$(34);"font ";obj$(m,Fon);chr$(34) end if end if next end if 'edit or erase existing line if obj(l,T)=0 then 'print ln,"'erased" else if obj(l,T)<>45 then n=l gosub [exportline] end if end if end if next if found=0 then #bas " ";bas$(ln,2) next close #bas end if 'now reload amended .bas file gosub [importit] return
[exportline] select case obj(n,T) 'handle the visible controls case 1 'statictext #bas " statictext ";projectform$;".";obj$(n,Ctr);" ";chr$(34);trim$(obj$(n,Tex));chr$(34);",";obj(n,X);",";obj(n,Y)+5;",";obj(n,W);",";obj(n,H) case 2 'textbox #bas " textbox ";projectform$;".";obj$(n,Ctr);",";obj(n,X);",";obj(n,Y);",";obj(n,W);",";obj(n,H) case 3 'list box #bas " listbox ";projectform$;".";obj$(n,Ctr);",";obj$(n,Res);",[";obj$(n,Ctr);"Selected],";obj(n,X)+1;",";obj(n,Y);",";obj(n,W)-2;",";obj(n,H) case 4 'combobox #bas " combobox ";projectform$;".";obj$(n,Ctr);",";obj$(n,Res);",[";obj$(n,Ctr);"Selected],";obj(n,X)+1;",";obj(n,Y);",";obj(n,W)-2;",";obj(n,H) 'case 5 'button #bas " button ";projectform$;".";obj$(n,Ctr);",";chr$(34);obj$(n,Tex);chr$(34);",[";obj$(n,Ctr);"Clicked], UL, ";obj(n,X);",";obj(n,Y);",";obj(n,W);",";obj(n,H) case 6 'bmpbutton #bas " bmpbutton ";projectform$;".";obj$(n,Ctr);",";chr$(34);obj$(n,Res);chr$(34);",[";obj$(n,Ctr);"Clicked], UL, ";obj(n,X);",";obj(n,Y) case 7 'graphicbox #bas " graphicbox ";projectform$;".";obj$(n,Ctr);",";obj(n,X);",";obj(n,Y);",";obj(n,W);",";obj(n,H) case 8 'radiobutton #bas " radiobutton ";projectform$;".";obj$(n,Ctr);",";chr$(34);obj$(n,Tex);chr$(34);",";obj$(n,Res);",";obj(n,X);",";obj(n,Y);",";obj(n,W);",";obj(n,H) case 9 'checkbox #bas " checkbox ";projectform$;".";obj$(n,Ctr);",";chr$(34);obj$(n,Tex);chr$(34);",";obj$(n,Res);",";obj(n,X);",";obj(n,Y);",";obj(n,W);",";obj(n,H) case 10 'group box #bas " groupbox ";projectform$;".";obj$(n,Ctr);",";chr$(34);obj$(n,Tex);chr$(34);",";obj(n,X);",";obj(n,Y)-5;",";obj(n,W);",";obj(n,H) case 11 'texteditor #bas " texteditor ";projectform$;".";obj$(n,Ctr);",";obj(n,X);",";obj(n,Y);",";obj(n,W);",";obj(n,H)
'handle the undisplayed color and font objects only used for import/export case 22 'textboxcolor #bas " TextboxColor$=";chr$(34);obj$(n,Bak);chr$(34) case 23 'listboxcolor #bas " ListboxColor$=";chr$(34);obj$(n,Bak);chr$(34) case 24 'comboboxcolor #bas " ComboboxColor$=";chr$(34);obj$(n,Bak);chr$(34) case 21 'texteditorcolor #bas " TexteditorColor$=";chr$(34);obj$(n,Bak);chr$(34) ' handle the window code case 41'backgroundcolor #bas " BackgroundColor$=";chr$(34);projectback$;chr$(34) case 42'foregroundcolor #bas " ForegroundColor$=";chr$(34);projectfore$;chr$(34) case 43'windowidth #bas " WindowWidth=";projectw case 44'windowheight #bas " WindowHeight=";projecth case 45'open if trapped <> 1 then #bas " Open ";chr$(34);projecttitl$;chr$(34);" for ";projectwind$;" as ";projectform$ end if 'handle font changes case 50 'font #bas " ";projectform$;".";obj$(n,Ctr);" ";chr$(34);"font ";obj$(n,Fon);chr$(34) case 51 '!font #bas " ";projectform$;".";obj$(n,Ctr);" ";chr$(34);"!font ";obj$(n,Fon);chr$(34) end select return
function getsize$(l$) 'what if it is a variable? v$="" pos=1 n$=mid$(l$,pos,1) while instr("1234567890",n$,1)=0 and pos<len(l$) pos=pos+1 n$=mid$(l$,pos,1) wend while n$>="0" and n$<="9" and pos<=len(l$) v$=v$+n$ pos=pos+1 n$=mid$(l$,pos,1) wend getsize$=v$ end function
function getcolor$(l$) if l$="palegray" then l$="lightgray" 'what if it is a variable? cl$="darkgray lightgray buttonface darkred darkpink darkgreen blue yellow pink red brown green cyan white black " for c= 1 to 15 if instr(l$,word$(cl$,c),1)>0 then getcolor$=word$(cl$,c) : exit for next if getcolor$="" then getcolor$="white" end function
[new] redim obj(300,6) 'x,y,width/height,type,textheight redim obj$(300,7) 'name,text content,resource,font obj=0 menuset=0 textEd=0 projectw=600 projecth=400 projectback$="white" projectfore$="black" projectctrc$="white" projecttitl$="Untitled" projectform$="#1" projectfile$="Untitled.bas" projectwind$="window_nf" #prop.cbwind "select window_nf" redim hnd$(30) hnd$(1)=projectform$ #fful.hand "reload" #fful.hand "selectindex 1" #fful.w "select ";projectw #fful.h "select ";projecth #fful.path "File - untitled.ffu" gosub [propertyupdate] gosub [drawgrid] gosub [drawall] #prop "hide" #prop "show" show=1 return
[propertyupdate] #prop.tbfile projectfile$ #prop.cbwind "select ";projectwind$ #prop.tbtitl projecttitl$ #prop.tbform projectform$ #prop.tbctrl "" #prop.tbtext "" #prop.tbreso "" #prop.tbxywh projectw;"x";projecth #prop.tbfont projectfont$ #prop.tbcolo projectfore$;"/";projectback$ return
[resize] #fful.tool "select Add New" #fful.form "select File" if wh=0 then wh=1 #fful.hand "selectindex ";wh #fful.grid "select Set Grid" #fful.font "select Set Font" #fful.color "select Set Color" #fful.w "select ";projectw #fful.h "select ";projecth gosub [drawall] wait
[formsize] #fful.w "contents? w$" #fful.h "contents? h$" wf=val(w$) hf=val(h$) if wf=0 or hf=0 or (wf=projectw and hf=projecth) then wait projectw=wf projecth=hf insertx=grid inserty=grid gosub [drawgrid] #fful.gb "setfocus" gosub [drawall] wait
[grid] 'resize the grid spacing according to user choice, default is 10 #fful.grid "contents? g$" select case g$ case "Invisible" gridvisible=0 grid=1 case "Visible" gridvisible=1 case else grid=val(g$) if grid = 1 then gridvisible = 0 if grid > 2 then gridvisible = 1 end select gosub [drawgrid] gosub [drawall] #fful.gridsize grid #fful.gb "setfocus" wait
[drawgrid] projectgrid=grid #fful.gb "cls; fill buttonface" insertx=int((insertx+(grid/2))/grid)*grid inserty=int((inserty+(grid/2))/grid)*grid if grid > 0 and gridvisible = 1 then #fful.gb "color ";gridcolor$ ' Grid - Draw vertical lines if menuset = 0 and textEd = 0 then #fful.gb "place 0 0 ; color ";gridcolor$;" ; backcolor ";projectback$;" ; boxfilled ";projectw;" ";projecth-25 for xs = 0 to projectw step grid ' Grid - Draw horizontal lines #fful.gb "line "; xs; " "; 0; " "; xs; " "; projecth-25 next xs for ys = 0 to projecth-25 step grid #fful.gb "line "; 0; " "; ys; " "; projectw; " "; ys next ys end if 'adjust grid when menu, or texeditor control is selected - revert if menu and texeditor deleted /no longer used., if menuset = 1 or textEd > 0 then #fful.gb "place 0 0 ; color ";gridcolor$;" ; backcolor ";projectback$;" ; boxfilled ";projectw;" ";projecth-50 #fful.gb "color ";gridcolor$ for xs = 0 to projectw step grid #fful.gb "line "; xs; " "; 0; " "; xs; " "; projecth-50 next xs for ys = 0 to projecth-50 step grid #fful.gb "line "; 0; " "; ys; " "; projectw; " "; ys next ys end if end if [nogrid] if grid < 2 or gridvisible = 0 then if textEd =0 and menuset = 0 then #fful.gb "place 0 0 ; color white";" ; backcolor ";projectback$;" ; boxfilled ";projectw;" ";projecth-25 #fful.gb "color ";crosshair$ #fful.gb "line "; projectw/2; " "; 0; " "; projectw/2; " "; projecth-25 #fful.gb "line "; 0; " "; ((projecth)/2)-12; " "; projectw; " "; ((projecth)/2)-12 #fful.gb "color ";bordercolor$ #fful.gb "line "; projectw; " "; 0; " "; projectw; " "; projecth-25 #fful.gb "line ";0;" "; projecth-25;" "; projectw; " ";projecth-25 end if if textEd > 0 or menuset = 1 then #fful.gb "place 0 0 ; color white";" ; backcolor ";projectback$;" ; boxfilled ";projectw;" ";projecth-50 #fful.gb "color ";crosshair$ #fful.gb "line "; projectw/2; " "; 0; " "; projectw/2; " "; projecth-50 #fful.gb "line "; 0; " "; (projecth-50)/2; " "; projectw; " "; (projecth-50)/2 #fful.gb "color ";bordercolor$ #fful.gb "line "; projectw; " "; 0; " "; projectw; " "; projecth-50 #fful.gb "line ";0;" "; projecth-50;" "; projectw; " ";projecth-50 end if end if #fful.gb "flush bak" #fful.grid "!Set Grid" return
[font] #fful.font "contents? f$" if f$="Project Font" then fontdialog projectfont$,f$ if f$<>"" then projectfont$=f$ #fful.gb "font ";projectfont$ #fful.gb "place 100 100 ;\Q\Q" #fful.gb "posxy xp yp" projectctrh=(yp-100)/2+7 ctrf$=projectfont$ ctrh=projectctrh end if end if if f$="Control Font" then fontdialog projectfont$,f$ if f$<>"" then ctrf$=f$ #fful.gb "font ";ctrf$ #fful.gb "place 100 100 ;\Q\Q" #fful.gb "posxy xp yp" ctrh=(yp-100)/2+7 end if if selected then obj$(selected,4)=ctrf$ 'font obj(selected,6)=ctrh 'text height end if 'for single line text controls auto adjust w and h if selected and instr("1 2 5 8 9",str$(obj(selected,5)),1) >1 then obj(selected,4)=ctrh #fful.gb "stringwidth? ";"A";" width" obj(selected,3)=width*len(obj$(selected,2))+10 end if end if if f$="ResetControl" then ctrf$=projectfont$ ctrh=projectctrh if selected then obj$(selected,4)=ctrf$ obj(selected,6)=ctrh end if 'for single line text controls auto adjust w and h if selected and instr("1 2 5 8 9",str$(obj(selected,5)),1) >1 then #fful.gb "font ";ctrf$ obj(selected,4)=ctrh #fful.gb "stringwidth? ";"A";" width" obj(selected,3)=width*len(obj$(selected,2))+10 end if end if #fful.font "select Set Font" gosub [drawall] #fful.gb "setfocus" wait
[color] #fful.color "contents? c$" select case c$ case "Control Back" gosub [colorpick] if cp$<>"" then if selected then 'insert color change event ahead of control if obj(selected,T)=2 then ct=22 : projecttbcl$=cp$ if obj(selected,T)=3 then ct=23 : projectlbcl$=cp$ if obj(selected,T)=4 then ct=24 : projectcbcl$=cp$ if obj(selected,T)=11 then ct=21 : projecttecl$=cp$ for n=obj+1 to selected+1 step -1 obj(n,X)=obj(n-1,X) obj(n,Y)=obj(n-1,Y) obj(n,W)=obj(n-1,W) obj(n,H)=obj(n-1,H) obj(n,T)=obj(n-1,T) obj(n,TH)=obj(n-1,TH) obj$(n,Ctr)=obj$(n-1,Ctr) obj$(n,Tex)=obj$(n-1,Tex) obj$(n,Res)=obj$(n-1,Res) obj$(n,Fon)=obj$(n-1,Fon) obj$(n,Bak)=obj$(n-1,Bak) obj$(n,Bas)=obj$(n-1,Bas) next obj(selected,T)=ct obj$(selected,Tex)="Color!" obj$(selected,Bak)=cp$ 'remove any previous color change statement if selected>=2 then if obj(selected-1,T)=ct then obj(selected-1,T)=0 end if obj=obj+1 end if end if case "Project Back" gosub [colorpick] if cp$<>"" then projectback$=cp$ if cp$<>"" then ctrc$=cp$ gosub [drawgrid] case "Project Fore" gosub [colorpick] if cp$<>"" then projectfore$=cp$ case "Grid Color" gosub [colorpick] if cp$<>"" then gridcolor$=cp$ gosub [drawgrid] case "Border Color" gosub [colorpick] if cp$<>"" then bordercolor$=cp$ gosub [drawgrid] case "CrossHair" gosub [colorpick] if cp$<>"" then crosshair$=cp$ gosub [drawgrid] end select #fful.color "select Set Color" gosub [drawall] #fful.gb "setfocus" wait
[windowtype] #prop.cbwind "contents? projectwind$" wait
[colorpick] WindowWidth=230 WindowHeight=225 UpperLeftX = insertx UpperLeftY = inserty graphicbox #pick.gb,25,10,170,170 open "Color Pick" for dialog_nf_modal as #pick #pick "font Consolas 9" #pick "trapclose [quitpick]" #pick.gb "down ; fill white ; flush" cl$="black darkgray lightgray buttonface red green blue yellow pink darkpink darkred brown darkgreen cyan white white " c=1 for yc=1 to 160 step 40 for xc= 1 to 160 step 40 #pick.gb "backcolor ";word$(cl$,c);" ; place ";xc;" ";yc;" ; boxfilled ";xc+40;" ";yc+40 c=c+1 if c>15 then c=15 next next #pick.gb "when leftButtonDown [pick]" wait
[pick] xp=int(MouseX/40) yp=int(MouseY/40) c=xp+yp*4+1 cp$=word$(cl$,c)
[quitpick] close #pick return
[help] run "notepad help.txt" wait
[quitfful] 'save away current session to lastsession.ffu open "lastsession.ffu" for output as #ses #ses projectfile$ #ses projectwind$ #ses projectform$ #ses projecttitl$ #ses projectfont$ #ses projectback$ #ses projectfore$ #ses projectctrh #ses projectgrid #ses projectw #ses projecth for n=1 to obj if obj(n,T)<>0 then #ses obj(n,X);","; #ses obj(n,Y);","; #ses obj(n,W);","; #ses obj(n,H);","; #ses obj(n,T);","; #ses obj(n,TH) #ses obj$(n,Ctr) #ses obj$(n,Tex) #ses obj$(n,Res) #ses obj$(n,Fon) #ses obj$(n,Bak) end if next close #ses close #prop close #fful end
[negbarrier] if negbar = 1 then negbar = 0 #fful.negbarrier "Barrier -" else negbar = 1 #fful.negbarrier "No Barrier -" end if wait
[barrier] if barrier = 1 then barrier = 0 #fful.barrier "Barrier +" else barrier = 1 #fful.barrier "No Barrier +" end if wait
'control buttons [bttnSTTX] i=1 : gosub [drawTool] : wait [bttnTXBX] i=2 : gosub [drawTool] : wait : wait [bttnLSTBX] i=3 : gosub [drawTool] : wait [bttnCMBOBX] i=4 : gosub [drawTool] : wait [bttnBTTN] i=5 : gosub [drawTool] : wait [bttnBMPBTTN] i=6 : gosub [drawTool] : wait [bttnGRPHCBX] i=7 : gosub [drawTool] : wait [bttnRDBTTN] i=8 : gosub [drawTool] : wait [bttnCHKBX] i=9 : gosub [drawTool] : wait [bttnGRPBX] i=10 : gosub [drawTool] : wait [bttnTXTEDTR] i=11 : gosub [drawTool] : wait [bttnMNU] i=12 : gosub [drawTool] : wait
function nvl$(a$,b$) 'if a$ empty return b$, else a$ if a$<>"" then nvl$=a$ else nvl$=b$ end function
function value(x$) select case len(x$) case 1 value = asc(x$) case 2 value=asc(mid$(x$,1,1)) value=value+(asc(mid$(x$,2,1))*256) case 3 value=asc(mid$(x$,1,1)) value=value+(asc(mid$(x$,2,1))*256) value=value+(asc(mid$(x$,3,1))*65536) case 4 value=asc(mid$(x$,1,1)) value=value+(asc(mid$(x$,2,1))*256) value=value+(asc(mid$(x$,3,1))*65536) value=value+(asc(mid$(x$,4,1))*16777216) end select end function
function fileExists(path$, file$) files path$, file$, info$( fileExists = val(info$(0,0)) end function '
|
|