|
Post by Walt Decker on Dec 1, 2022 10:20:09 GMT -5
Anyone interested in a form designer that uses actual forms for control layout? I have one about half complete. Basically it looks like that shown in the attached zip.
IN THE ZIP:
QHELP.TXT
LBFDESIGN.CFG
APIFORMS_032._BAS
MNUCB.DLL
CTL_COLOR.DLL
TABCTL.DLL
FileDesign.dll
|
|
|
Post by xxgeek on Dec 1, 2022 14:33:54 GMT -5
Yes Walt, I would be interested. Thanks.
It will be a nice tool - addition to something I've been working on. I could use a quick form/code generator.
Will this generate the code for the form as well?
|
|
|
Post by Walt Decker on Dec 1, 2022 15:18:04 GMT -5
Will this generate the code for the form as well?
Yes, although I have not arrived at that point. The plan is to give the option to use functions or labels to generate the form code, and use subs or labels to generate the event handlers. There is also an option to snap to a grid node when designing the form so all controls that should be aligned are.
Items left to do: set up a menu form to make it easy to generate menus, write the help, and set up the code to write and save the form(s). There many be a few miscellaneous items along the way. Hopefully I will have it complete by Christmas. Of course there will probably be some bugs that I do not catch.
|
|
|
Post by xxgeek on Dec 1, 2022 16:22:57 GMT -5
Just after I posted this I realized what a dumb question that was, but thanks for you answer regardless. lol - If it created the window in your picture, then obviously there was code created. duh!!
I have a request, in the form of a question to - hide my intent.....
Will your code be LB specific, or will it be useful to JB as well?
|
|
|
Post by Walt Decker on Dec 1, 2022 17:22:01 GMT -5
I know nothing about JB; however, I suspicion LB and JB syntax is similar so I think it would be fairly easy to modify the code to fit. Or, with a little help I may be able to add a JB option.
|
|
|
Post by xxgeek on Dec 1, 2022 19:53:49 GMT -5
JB v2.0 and LB v4.5.1 syntax is practically identical Walt. LB has more commands though, and can deal with dll's and the api where JB either can't, or it takes a lot of work around to use dll's, or go to 3rd party apps. If you can keep the api calls and dll's out of your code, JB should be able to run it. If not, I'll see what I can come up with to make it work in JB. The code produced by your app should be ok since the code for forms is identical (I think) Maybe the odd tiny difference I'm not positive, but I'm sure that can be worked around. It's the main program I would need to be able to run in JB, or at least be able to re-write to work in JB. Thanks Walt, for all you do around here. I've taken some of your advice, and your code Not to make money, just to help the 2 communities. Also, when I create something in JB that works well, I like to make a version for LB as well. JB community and LB community both benefit.
|
|
|
Post by Walt Decker on Dec 2, 2022 9:19:16 GMT -5
There will be no DLLs or API calls. Form and control styles will be defined. The events for lists, combos, check, and radio buttons have appropriate responses. Menu items will just have a block of code to show response. What is done withing the events depends on the programmer.
Bottom line, if JB and LB forms and controls share the same syntax there is no problem.
|
|
|
Post by xxgeek on Dec 2, 2022 13:58:17 GMT -5
Sounds good Walt. That should work on JB.
JB doesn't have a stylebits command, but that just means editing out the stylebits stuff and the JB forms/windows produced won't have style. No big deal.
Here is a program written by cundo to create quick windows I've been editing - incomplete code - creates the windows, but adding function not finished yet. I will attempt to meld your code with this code to create quick window types, the jb functions and forms(using your code). Might try and add some more useful user created subs and functions as well.
'Written by cundo at the jb forums - https://justbasiccom.proboards.com/ 'edited by xxgeek global upath$, fastfuncs$ JBpath$ = "c:\Program Files (x86)\Just Basic v2.0" JBexe$ = "jbasic.exe"
[fastcode] dim windowTypes$(19) windowTypes$(0)= "":windowTypes$(1)= "dialog":windowTypes$(2)= "dialog_fs":windowTypes$(3)= "dialog_nf":windowTypes$(4)= "dialog_nf_fs" windowTypes$(5)= "dialog_ns_modal":windowTypes$(6)= "dialog_modal":windowTypes$(7)= "dialog_popup":windowTypes$(8)= "graphics" windowTypes$(9)= "graphics_fs":windowTypes$(10) = "graphics_nf":windowTypes$(11)= "graphics_nsb":windowTypes$(12)= "graphics_nsb_nf" windowTypes$(13)= "text":windowTypes$(14)= "text_fs":windowTypes$(15)= "text_nsb":windowTypes$(16)= "text_nsb_ins":windowTypes$(17)= "window" windowTypes$(18)= "window_nf":windowTypes$(19)= "window_popup"
nomainwin WindowWidth = 430:WindowHeight = 470 UpperLeftX= int((DisplayWidth-WindowWidth)/2) UpperLeftY= int((DisplayHeight-WindowHeight)/2) BackgroundColor$ = "lightgray" ForegroundColor$ = "black"
'fastcode code by cundo texteditor #fastcode.ed, 8, 150, 400, 200 statictext #fastcode.fastcode, "Create Window Code", 135, 5, 165, 20 statictext #fastcode.st1, "< Name && Handle >", 150, 25, 128, 20 statictext #fastcode.st1, "Window Type", 50, 55, 90, 20 textbox #fastcode.txt1, 290, 20, 115, 20 textbox #fastcode.txt2, 20, 20, 115, 20 button #fastcode.button1, "&Generate Code ^ + > Copy to Clipboard", dummy, ul, 70, 370, 270, 25 combobox #fastcode.combo, windowTypes$(, dummy, 145, 50, 140, 20 checkbox #fastcode.r1, "Use Labels instead of Subs", dummy, dummy, 8, 80, 222, 20 checkbox #fastcode.adjbfunction, "Add Selected JB Function >>>", [addfastfunction], [noaddfastfunction], 8, 100, 222, 20 statictext #fastcode.fastfunctionstext, "JB Functions", 285, 83, 120, 15 combobox #fastcode.fastfunctionsList, fastfunctionsList$(), fastfunctionSelected , 245, 99, 160, 15
button #fastcode.freeform, "Open Just Basic &FreeForm Editor", [openFreeForm], UL, 90, 127, 230, 20 open "Just Basic v2.0 Help Lab and Project Organizer" for window as #fastcode
#fastcode "trapclose [quit.fastcode]" #fastcode "font arial 10 Bold" #fastcode.txt1 "#main" #fastcode.txt2 "untiltled" #fastcode.r1 "set" #fastcode.combo "selectindex 17" call getUserPath call getfastfunctions wait
[addfastfunction] addfastfunction = 1 wait
[noaddfastfunction] addfastfunction = 0 wait
[openFreeForm] freeForm$ = upath$;"\AppData\Roaming\Just BASIC v2.0\fformj261006.bas" run JBpath$;"\";JBexe$;" -R -A ";freeForm$ wait
[quit.fastcode] close #fastcode wait
sub fastfunctionSelected fastfunctionsList$ #fastcode.fastfunctionsList, "selection? fastfuncs$" fastfuncs$ = fastfuncs$;".txt" end sub
sub getfastfunctions dim folderInfo$(1, 1) dim fastfunctionsList$(11) files upath$;"\AppData\Roaming\Just Basic v2.0\FFFunctions", folderInfo$() numFiles = val(folderInfo$(0, 0)) dim fastfunctionsList$(numFiles) for x = 1 to numFiles filename$ = folderInfo$(x, 0) if right$(filename$, 3) <> "txt" or filename$ = "readme.txt" then [skip] if filename$ = "readme.txt" then [skip] fastfunctionsList$(x) = left$(filename$, len(filename$) - 4) [skip] next x sort fastfunctionsList$(), 0 ,numFiles #fastcode.fastfunctionsList, "reload" end sub
sub quit fast$ 'close help lab (and all open htmlviewer.exe windows if checked) if closehtml <> 0 then run "taskkill /IM htmlviewer.exe /F",HIDE close #fastcode end sub
'sub to generate the window code and copy to clipboard, and texeditor sub dummy fast$ select case case fast$ = "#fastcode.button1" #fastcode.txt1 "!contents? txt$" #fastcode.txt2 "!contents? theName$" #fastcode.r1 "value? result$" if result$="set" then itag$="[" otag$="]" closingCode$= "[quit]";chr$(13);_ " close ";txt$;chr$(13);_ " end" else closingCode$ = "Sub quit fast$";chr$(13);_ " close #fast$" ;chr$(13);_ " end";chr$(13);_ "End Sub" end if #fastcode.combo "selection? sel$" if instr(sel$,"popup") then includeButton$= "button ";txt$;".button1 ";chr$(34);_ "&X";chr$(34);", "; itag$;"quit";otag$;", ul, 610, 5, 25, 20" end if toPrint$ = "WindowWidth = 640 : WindowHeight = 480";chr$(13);_ "UpperLeftX=int((DisplayWidth-WindowWidth)/2)";chr$(13);_ "UpperLeftY=int((DisplayHeight-WindowHeight)/2)";chr$(13);chr$(13);_ includeButton$;chr$(13);chr$(13);_ "Open ";chr$(34);theName$;chr$(34);" for ";sel$; " as ";txt$;chr$(13);_ " ";txt$;" "; chr$(34); "trapclose ";itag$;"quit";otag$; chr$(34);chr$(13);_ "wait";chr$(13);chr$(13);_ closingCode$ #fastcode.ed "!cls" #fastcode.ed toPrint$ if addfastfunction = 1 then #fastcode.ed "" #fastcode.ed "" x = 0 dim codeLine$(500) open upath$;"\AppData\Roaming\Just Basic v2.0\FFFunctions\";fastfuncs$ for input as #fastfunc while eof(#fastfunc) = 0 line input #fastfunc, codeLine$(x) line$ = codeLine$(x) if x < 6 then [skipme] #fastcode.ed, line$ [skipme] if x < 6 and line$ <> "" then #fastcode.ed, "'";line$ if x = 5 then #fastcode.ed, "" x = x + 1 wend close #fastfunc end if #fastcode.ed "" #fastcode.ed "!selectall" #fastcode.ed "!copy" #fastcode.ed "!paste" #fastcode.ed "!origin 0 0" end select end sub
sub getUserPath cursor hourglass run "cmd.exe /c echo %userprofile% |clip", HIDE call pause 1500 open "GetUserPath" for text as #1 #1 "!paste" #1 "!contents? upath$" upath$ = trim$(upath$) close #1 cursor normal end sub
'sub to create pauses in program sub pause mil t=time$("ms")+mil while time$("ms")<t scan wend end sub
|
|
|
Post by Walt Decker on Dec 7, 2022 18:21:22 GMT -5
Since JB does not have STYLEBITS, how does one go about changing check boxes and radio buttons to WM_PUSHLIKE, i. e., make them look like buttons instead of labels?
|
|
|
Post by xxgeek on Dec 7, 2022 20:24:08 GMT -5
Since JB does not have STYLEBITS, how does one go about changing check boxes and radio buttons to WM_PUSHLIKE, i. e., make them look like buttons instead of labels? Honestly Walt, I have no idea at this point. Never done it before. But I do know "If there is a will, there is a way" I'll have to read the code, and figure it out. or Get this guy I know named Walt to write a version just for me. Kidding of course, I like figuring stuff out. I believe you do too.
|
|
|
Post by Walt Decker on Dec 8, 2022 9:53:41 GMT -5
Does JB support API calls?
|
|
|
Post by Rod on Dec 8, 2022 10:16:30 GMT -5
No, it is a subset of Liberty and does not support API or Stylebits. There is a form designer that ships with Just BASIC, I believe it draws the form graphically.
|
|
|
Post by Walt Decker on Dec 8, 2022 14:12:09 GMT -5
Hmmm. With this info I do not see much reason to write a designer for JB. The gui is too limited.
The designer for LB is pretty limited, that is why I am attempting to write one that uses an actual form on which to design.
|
|
|
Post by xxgeek on Dec 8, 2022 21:22:20 GMT -5
No worries Walt. If your code can't be edited to create a version compatible with JB I'll just do what I can with JB code.
Note that the form editor that comes with JB (named freeform) is written in JB code, and available to the user. Maybe I can sift through it and use some of it as well.
As stated I have code written by cundo to create all the "Window Types" quickly, just need to add the other available things like buttons, checkboxes, comboboxes, listboxes etc etc. And finish up the code I've already started for adding any of the JB functions. I also have a whole wack of user functions/subroutines to add as well.
What it produces will be generic, and need to be edited by the user, but will save the user a lot of time. Personally I never use freeform since I got used to making GUI's manually, but I would use a quick shell creator, then just do a bit of editing to suit the current need.
Thanks for the consideration Walt. I'll be checking out your designer when it's posted anyway. It sounds like it will be a "must have" app for Liberty
|
|
|
Post by Walt Decker on Dec 9, 2022 7:51:08 GMT -5
Will JB run a .TKN written in LB?
|
|