|
Post by Rod on Jun 4, 2023 11:48:37 GMT -5
I have two weeks away from home. I did pack my pc so hope to make some progress. I have not had time to look at the fixes posted. Some may disappear of their own accord. Some like duplicate labels may just be ignored and exported as is. They work in LB now and will do in the future. By stopping writing them in preview preview works.
I can’t work all these fixes and develop the core code so i am concentrating on the core code first.
|
|
|
Post by tsh73 on Jun 4, 2023 16:33:22 GMT -5
Not yet. But if you use "Write" you can save the file with the added controls as a .bas, or if you use "Save" you can save the file as a .ffu (form). Either way, you are only saving the form, not the entire imported .bas file. Let me say as it works for me just now: 1) I run FFUL 2) Import my program (sorry I mainly use one window, so I do not checked if it works for more complex programs) I tested on these two programs justbasiccom.proboards.com/thread/887/automating-selection(first post) and justbasiccom.proboards.com/thread/757/falling-sand(last post) 3) Change controls in FFUL - size, position, control text *!DO NOT press "preview"!* (or file$ gets changed so Export no more works - export starts from reading all lines from file$ ) 4) Then done, select "Export" my version writes file with "+" added (so "file.bas" export as "file+.bas") 5) Then I run resulting new file in JB. It is *whole* *working* program, with my changes (size, position, control text) in place. (but then I tried to add new controls - they are visible in FFUL, but do not get through to exported program. Then I Write or Preview, new control got saved, but all of the program naturally lost Also, I can delete controls, but Export writes them back. Probably these parts are just not ready yet. ) Program got really big. It is so big I would likely never use some parts at all. And may be I am going to use it my way (not designed way), as well. Rod mention what he (first?) wanted it to work as GUI designer I wanted it to import/change/export working program. So likely some fixes are just not visible to me, because I never got these problems. I tried your last version. I see you do not show labels in property window Then I tried import/export on my program (automating-selection), I did not get working version. It created button labels differing in single letter (click vs Click) button #main.btAccept,"Accept",[btAcceptclick], UL, 318,176,128,25 but [btAcceptClick] 'Perform action for the button named 'btAccept' t$=space$(4)
and it created new handlers for checkbox/radiobuttons radiobutton #main.rb6,"Evil",[radio],[radio],200,90,100,25 checkbox #main.ch1,"Ranger",[check],[check],342,46,100,25
differing from ones in a program (so program could not correctly run after that) and it even did not created these labels. Like I said, probably my way/intent of using the program is different. (and porting changes from one version of (BIG!) program to another is sure hard thing)
|
|
|
Post by xxgeek on Jun 5, 2023 10:48:57 GMT -5
tsh73I see, the export works as long as it's used before a preview. Good to know. Export even includes the "Menu" in the output but Import>Preview does not. I believe you are not having issues since your test files are fairly simple. Try some of the files mentioned in this thread and you will see issues. I went off on a tangent because I wanted each control to increase it's count individually, instead of increasing with the number of controls. Something I didn't like about Freeform that ships with LB and JB. It isn't working out as I'd hoped. RodUnderstood, like you said, some issues may fix themselves anyway. In the mean time, just for gaslouk, there are 2 issues to re-introduce to TSH73's code so you can work with the file you posted earlier. gaslouk and anyone else needing this fix for the time being. 1. Under [drawit] #################################################################### if projecttbcl$ = "" then projecttbcl$ = "white" 'add these 4 lines (color missing issue) if projectlbcl$ = "" then projectlbcl$ = "white" if projectcbcl$ = "" then projectcbcl$ = "white" if projecttecl$ = "" then projecttecl$ = "white" #################################################################### 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
2. Under [import] Change if instr(lower$(bas$(ln,2)),"open",1)>0 then to if lower$(word$(bas$(ln,2),1)) = "open" and left$(word$(bas$(ln,2),2, " as "),1) = "#" then You could also include this change to import "Text" windows as well as the other types. Not a necessity, up to you. change 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 to 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 or instr(lower$(bas$(ln,2)),"text",1)>0 then
|
|
|
Post by tsh73 on Jun 5, 2023 15:40:39 GMT -5
xxgeek, I see color fix allows program after importing gaslouk code (logistirioRight.bas) - switch windows I see "or instr(lower$(bas$(ln,2)),"text",1)>0 " adds text window But what problem second fix solves?
|
|
|
Post by xxgeek on Jun 6, 2023 11:00:32 GMT -5
xxgeek, I see color fix allows program after importing gaslouk code (logistirioRight.bas) - switch windows I see "or instr(lower$(bas$(ln,2)),"text",1)>0 " adds text window But what problem second fix solves? Ah, I forgot. The second fix is not necessary for gaslouks file. It was a fix for the a line in the JB fformj261006.bas file. statictext #formgen.st, "Open JB source file and double-click to select window.",_ 26, 211, 424, 30 becomes statictext #formgen.st, "Open JB source file and double-click to select window.",_.st "Open JB source file and double-click to select window.",0,0,0,25 The old line if instr(lower$(bas$(ln,2)),"open",1)>0 then When a line had "open" in it, and the word "window", or "graphic" was in the same line it was seen as a form and caused errors in the preview file.. The new line - if lower$(word$(bas$(ln,2),1)) = "open" and left$(word$(bas$(ln,2),2, " as "),1) = "#" then Makes sure the first word in the line is "open", and that the word after " as " has the left most character "#" Most lines that open a window read: open "blah blah" for window_etc as #blah Still not a perfect solution, but filters a lot more 'potential' bad lines, and fixed the issue with the JB freeform file. However, it does not fix a file I wrote with a line: open sp$;"" for window as #main So it still needs improved, but I'll wait till the next version to see if it gets fixed by the new code. If you would like to play around with the fformj261006.bas from JB it still has issues to show. The very first form is getting buttons, and a listbox from the #formgen form on 'import' Probably due to having the word 'form' in both, and using 'instr' instead of 'word' as well. Haven't fixed that yet. What you have now works well enough for what you want, and what I have works well enough for me. Let's wait and see what Rod comes up with for the core, then re-start the effort to harden it.
|
|
gaslouk
Full Member
Hi from beautiful Greece.
Posts: 131
|
Post by gaslouk on Jun 6, 2023 13:43:17 GMT -5
Hi I would like to clarify something. The file I uploaded was not uploaded for you to analyze because I asked for it. I put it in so you can work in FFUL because it is a multiform file and it would help make your work with it easier. So I uploaded it to help your work. What i don't understand is how you become a task that can probably help no one. In other words, what would it help me to pull the forms from a bas file since running it makes it easier to draw its forms. And if it has code besides the forms, why since it's already there, should I copy it this way. But if you think this will help someone then you are doing well and trying. Now loading "logistirio" I see that all the forms being loaded get a value in the hnd$ variable. Also, when I want to create an application that contains more than one form, the variable hnd$ does not take a value greater than 1. That is, I can request a new form, but not add a form to the project.
I think that's where we should put the burden of coding the application.
Gaslouk.
|
|
|
Post by Rod on Jun 7, 2023 1:08:27 GMT -5
Two good points, the early version created a single form program. That bit works well and the ability to show the preview during development was a neat addition.
Then someone asked if it could import and amend a form in an established basic program.
Now as it transpires importing has proved troublesome with many programming styles and errors needing to be catered for.
We are just about managing to import and display multiple forms from any .bas
Now the challenge is to allow any form to be amended and re-exported to the .bas. It is proving s real challenge for me. Not so much amending what is there but allowing for additions and deletions as well.
Now you give me another problem I had not even thought about, how to introduce an entirely new form:)
My main problem right now is time. Too many other things interfering. I will post what I have at the end of next week working or not. It will let followers see where I am headed.
|
|
gaslouk
Full Member
Hi from beautiful Greece.
Posts: 131
|
Post by gaslouk on Jun 10, 2023 13:40:42 GMT -5
Two good points, the early version created a single form program. That bit works well and the ability to show the preview during development was a neat addition. Then someone asked if it could import and amend a form in an established basic program. Now as it transpires importing has proved troublesome with many programming styles and errors needing to be catered for. We are just about managing to import and display multiple forms from any .bas Now the challenge is to allow any form to be amended and re-exported to the .bas. It is proving s real challenge for me. Not so much amending what is there but allowing for additions and deletions as well. Now you give me another problem I had not even thought about, how to introduce an entirely new form:) My main problem right now is time. Too many other things interfering. I will post what I have at the end of next week working or not. It will let followers see where I am headed. Rod, Walter, Anatoly, xxgeek this is an idea I have for an IDE And Form Designer for Liberty Basic 4.51. As I am very tired at the moment from my "just got back" work, I am uploading the relevant form to you without writing anything about it. Watch it and I'm sure you'll understand a lot.
'Project IDE And form Designer for Liberty Basic 4.51 'Created with Freeform Ultra Lite v1.2 on Áðñ 21, 2023
'Switch off mainwin debugging window nomainwin
'Set BackgroundColor$ and ForegroundColor$ of project BackgroundColor$="buttonface" ForegroundColor$="black" projectw=640 projecth=480
'Create arrays needed for controls listbox,combobox
'Create controls and open window WindowWidth = 1432 WindowHeight = 840 UpperLeftX = int((DisplayWidth-WindowWidth)/2) UpperLeftY = int((DisplayHeight-WindowHeight-50)/2) menu #1, "&File", "&Save", [dummy], "&Load", [dummy] menu #1, "&Color", "&Red", [dummy], "&Green", [dummy] menu #1, "Size", "Small", [dummy], "Large", [dummy]
statictext #1.st1 "________________IDE And Form Designer for Liberty Basic 4.51_________________",20,25,1400,40 groupbox #1.gr1,"Search Text",20,75,320,100 radiobutton #1.rb1,"",[radio],[radio],40,130,100,22 radiobutton #1.rb2,"",[radio],[radio],140,130,100,22 radiobutton #1.rb3,"",[radio],[radio],240,130,100,22 TextboxColor$="white" textbox #1.tb1,40,105,290,22 button #1.bt1,"Search",[bt1click], UL, 20,760,70,22 button #1.bt2,"Index",[bt2click], UL, 100,760,70,22 button #1.bt3,"Usage",[bt3click], UL, 180,760,70,22 groupbox #1.gr2,"design Window",590,60,820,715 graphicbox #1.gb31,600,80,800,690 groupbox #1.gr3,"code Window",20,180,520,560 texteditor #1.gb32,30,200,500,535 open "IDE And Form Designer for Liberty Basic 4.51" for window_nf as #1 #1 "trapclose [quit]"
'apply any control specific fonts #1.st1 "!font consolas 24 bold" #1.gr1 "!font consolas 10 bold" #1.rb1 "font consolas 10 bold" #1.rb2 "font consolas 10 bold" #1.rb3 "font consolas 10 bold" #1.tb1 "!font consolas 10 bold" #1.gr2 "!font consolas 10 bold" #1.bt1 "!font consolas 10 bold" #1.bt2 "!font consolas 10 bold" #1.bt3 "!font consolas 10 bold" #1.gr3 "!font consolas 10 bold" #1.gb31 "font consolas 10 bold" #1.gb32 "!font consolas 10 bold" #1.gb31 "autoresize" #1.gb31 "vertscrollbar on 0 ";projectw #1.gb31 "horizscrollbar on 0 ";projecth
wait
'Create the required handlers for each control 'Radiobutton and Checkboxes are given a single handler [radio] 'Your handler code here wait
[bt1click] 'Your handler code here wait
[bt2click] 'Your handler code here wait
[bt3click] 'Your handler code here wait
[quit] close #1 end
Good rest. Have a good Sunday. Gaslouk.
|
|
gaslouk
Full Member
Hi from beautiful Greece.
Posts: 131
|
Post by gaslouk on Jun 11, 2023 4:40:38 GMT -5
Rod, Walter, Anatoly, xxgeek this is an idea I have for an IDE And Form Designer for Liberty Basic 4.51. As I am very tired at the moment from my "just got back" work, I am uploading the relevant form to you without writing anything about it. Watch it and I'm sure you'll understand a lot.
Good rest. Have a good Sunday. Gaslouk. Hello. Correction, for Just Basic. For Liberty Basic It will be different. Gaslouk
|
|
|
Post by Walt Decker on Jun 11, 2023 15:22:01 GMT -5
Gaslouk, if you are addressing me, although combining a designer with an IDE is doable I will not consider it. Building an IDE is an enormous task and becomes almost impossible if one attempts to correct syntax errors.
|
|
|
Post by Rod on Jun 12, 2023 2:29:32 GMT -5
Plus one on that Walt. My intention was to visually encode twelve or so controls that a GUI can host. Only twelve command lines........... I should have called a halt when it was working perfectly and simply generating single form code. That worked, still works and remains useful.
I hope to get to your OpenGL code sometime soon. It is something I have wanted to better understand. I remember finding the blitter! I expect OpenGL will be just as much fun.
|
|
|
Post by Walt Decker on Jun 12, 2023 17:09:21 GMT -5
I though about jumping in. I did not because I have difficulty following sketti code. Later, when it was decided to add import and IDE tasks I thought that was too much. A designer is a tool to allow the coder to place controls on a form. It may write empty blocks of code for events, but that is as far as it should go. It has its own syntax rules. Trying to cater to external rules is beyond its scope.
I have seen designers that link to an IDE, but they invariable write a file recognized by the IDE first. That data is no longer a part of the designer data.
|
|
|
Post by Rod on Jun 13, 2023 7:29:28 GMT -5
:) Once I have a strategy that actually works I will try and unwind the spaghetti, its all a bit organic right now.
|
|
|
Post by Walt Decker on Jun 13, 2023 10:24:08 GMT -5
I do have one suggestion. A designer is a personal tool. You could set up a config file that contains the user's personal preference in regards to form handle and control syntax. For example: ' #1 <--- default form syntax #1.R <--- default radio button syntax '
You could all the user to define proto-types such as: ' #WIN <--- for forms of type window #DLG <--- for forms of type dialog #WIN.RDO <--- radio button #DLG.RDO <--- radio button '
You then just substitute the proto-type for the default.
|
|
|
Post by Rod on Jun 22, 2023 4:18:40 GMT -5
I have not been completely idle but finding programming time has been difficult. So this is a version that at last manages to import, change, and export a form withing an original .bas. The process is Import the desired .bas file, select the desired form within that ,bas file. It will be loaded and displayed. Make any changes you wish. Preview if needed. Then Export those changes back to the .bas file. Repeat for any other forms. That is the goal, load an existing form, alter it and replace it in the .bas Please bear in mind that the original concept of a lite version of freeform works! You can simply create a single form and Write it as a .bas file. But we have taken it to another level, now we have the ability to tinker with existing .bas forms. So have a play, there will be bugs but lets see if it is heading in the right direction. gamebin.webs.com/Freeform%20Ultra%20Lite%20v1.14.zip
|
|