|
Post by Rod on Mar 28, 2023 17:55:16 GMT
Defender did not flag it for me. Also we are never going to see a .bas for this utility. It is not coded in basic.
|
|
whiskeyd
Member in Training
That that is is, that that is not is not, that that is not is not that that is.
Posts: 23
|
Post by whiskeyd on Mar 29, 2023 17:14:07 GMT
I wanted to wait until others checked it out before responding; however that may not happen.
Thank you. I thought that was about the right size. If writing to the mass-storage device is allowed, the size of th main window will come up in the position and at the size it was on application termination.
I think that is not feisable. Each of the controls can have its own font and attributes. These are determined after the control is created. To programmatically adjust the size of the control to the font height would mean that the spacing between controls would change and might even overlap.
That is strange. It works well on my machine. The rubber outline appears immediately and follows the cursor.
That is strange. On mine machine it works on the down arrow and the body of list. It might be a windows thing on your machine. I am using Windows 10 Pro.
Everything is not wrapped in functions. That is what OPTIONS under the EDIT menu item is for. Click on "Use Functions" to turn functions off or, if off, click on it to turn it on. There are two functions that will always appear: FUNCTION FN.WinPos() and FUNCTION FN.WinSize(). Those are for convenience. I am forever misspelling WindowWidth and WindowHeight. For those who do not know anything about SUB/FUNCTION, it is time to learn.
Makes it a lot easier to distinguish an LB statement from everything else.
Are you refering to the function/label divders?
As for souce code, I will supply it to anyone who wants it; however, unless s/he has the programming system or can translate the source to another system, it is useless. Just send me a PM with your E-mail address. The source code is approx 8000 lines.
|
|
|
Post by Rod on Mar 29, 2023 17:24:33 GMT
Still to try on my PC, rubber banding might be a iMac issue. Re the point about text height, multiple text heights on one form is perhaps something to discourage. Multiple fonts also. So picking a font and a height at the start would allow a lot to be aligned neatly and automatically. But it is just a thought, folks might like wiggling multiple controls nearly into line
|
|
|
Post by tsh73 on Mar 29, 2023 19:37:25 GMT
Just run in under Win XP and Win 10 does work No antivirus warnings whatsoever.
Tried to put all controls, subs and branches mode. Looks working OK.
You can shrink main window to just menu bar and it will stay like this. Nice.
Just happened to find that Window_NF puts "TRAPCLOSE [SUB.#FORM1]" but does not create label [SUB.#FORM1]
Also, window_popup makes
OPEN "FORM 1" FOR POPUP AS #FORM1 instead of window_POPUP
Putting bmpbutton instantly make program not runnable (unless you manually supply BMP that is) Probably cannot be helped? (just checked - FreeForm JB asks for a BMP file and puts full path in a program)
Looks like after inserting, listboxes use same array (and comboboxes probably another one) Again comparing to FreeForm where array is the same too but it could be changed via properties.
I got some strange feeling that if I save program - open it and fix something, say BMP path then press "View" in form designer, BAS file gets overwritten. (like, I got this 2 times of 3 tries. ) Is it true?
One time I somehow got control off-screen (found negative coords in a resulting program) control was not visible (naturally), so I dunno haw I did that.
Tried "snap to grid" (on a button) It looks like it works for control creation but does not work for moving/resizing controls. (resize shows rubber band for me)
|
|
|
Post by Rod on Mar 30, 2023 14:45:55 GMT
It is Parallels on iMac that does not show the initial banding while placing a control. Their bug. On my PC the banding shows immediately.
I put three controls on the form. The starting position snaps to grid though not a multiple of five. But the ending position/length seems to vary. I expected start and length to be a multiple of 5.
[#FORM1]
'<--------------- BEGIN CONTROLS --------------> TEXTBOX #FORM1.TXT701, 81, 0, 139, 20 COMBOBOX #FORM1.CMB601, CmboAry$(), [SUB.#FORM1.CMB601], 81, 36, 135, 72 LISTBOX #FORM1.LST501, DmyAry$(), [SUB.#FORM1.LST501], 81, 81, 126, 81
|
|
|
Post by tsh73 on Mar 30, 2023 19:54:18 GMT
was able to replicate "negative coords" issue I clicked on a texteditor then I changed my mind - without drawing it, clicked on listbox and on View I've got
TEXTEDITOR #FORM1.EDT801, 81, -135, 0, 0 LISTBOX #FORM1.LST501, DmyAry$(), [SUB.#FORM1.LST501], 189, 27, 45, 45
Walt, out of curiosity - what language/ programming system you made it in?
|
|
whiskeyd
Member in Training
That that is is, that that is not is not, that that is not is not that that is.
Posts: 23
|
Post by whiskeyd on Mar 30, 2023 22:46:26 GMT
Fixed the two writing errors Fixed the negative control placement problem. The cursor is confined to the client area of the form so if you change your mind, just click twice in the same place. Also, you can set the lower right corner and expand to the upper left corner. The control will be placed at the ending position of the cursor. Fixed the bmp name problem with "YOURBMP.BMP". I could ask for a name if it is really necessary. Tsh, you are correct. List boxes use the same array, combo boxes use a different array. You are also correct that the source code gets over-written. The app loads the source code for display purposes only. All the info comes from the four data files it writes. Snap to Grid is turned off for sizing and moving. This allows one to overlap controls if one wants to. Glad you found the rubber band problem. Why would you expect the controls to be a multiple of 5? The client area begins at 0, 0. The grid size was set at 10 so zero to 9 is 10 and the sequence is 0, 9, 18, 27 etc. You can now set the grid size under menu bar item "EDIT - OPTIONS" in multiples of 5 up to 40. As for standard height of buttons, edit, and static controls based on font height, it is doable; however, LB does not do that and I think it is not a good idea. I often use different size fonts to grab the attention of the viewer.
LBFORMS_LITE.ZIP Approx 260.5 K uncompressed.
|
|
|
Post by Rod on Mar 31, 2023 12:33:37 GMT
Not sure I am getting my point across about snap to. The starting position is fine and snaps to the nearest grid point. However the end point does not.
If I wanted to create ten textbox controls I would easily get the start lined up but how to get the ends lined up? The ends should snap to as well. Then it will be very easy to get regimented controls.
If a user does want free placement just select option grid 1
|
|
|
Post by tsh73 on Mar 31, 2023 18:44:27 GMT
New version (LB FORMS LITE V2.EXE) I increased grid size to 15, and I definitely see end point snaps to grid as well.
Just took time to test all given window types DIALOG_FS opens window as DIALOG_NF DIALOG_NF_FS opens window as DIALOG_NF DIALOG_POPUP opens window as DIALOG_NF
I wonder what different in LOAD FILE, LOAD FORM, GRID SIZE dialog boxes? All dialoghs behave under Win 10 But under Win XP LOAD FILE / LOAD FORM (same window, right?) comes completely transparent So I was not aware window is opened at all And GRID SIZE just shows numbers (that supposed to be in a listbox) and button. If I grab that LOAD FILE window by titlebar (where it should be) and drag it reveals itself more, but still really weird (like it coped desktop it cames over but with a delay) I wonder if something with z-order or procedure that draws window. (then again, not many folks still use XP so you might as well ignore this)
|
|
|
Post by Rod on Apr 2, 2023 8:43:19 GMT
I set the grid to 50. I then created three textbox controls. One, one segment in from the left, four segments long and then two underneath side by side. They do snap to the end though the grid dots are visible but perhaps that's by design.
I am still confused by the numbers produced.
'<--------------- BEGIN CONTROLS --------------> TEXTBOX #FORM1.TXT701, 49, 0, 196, 49 TEXTBOX #FORM1.TXT702, 49, 49, 98, 49 TEXTBOX #FORM1.TXT703, 147, 49, 98, 49
0-49 defines the first segment but should the starting x for the second segment not be 50, should the length not be 50? should the height not be 50? Since the latter two are width and height values not zero based coordinates. I expected the length to be 200.
When a second control is placed in the line I might have expected the x coordinate to 150 not 147 and again width and height 100,50
Regarding the grid dots. I would expect the left hand pair to be covered by the control and the right hand pair to remain visible, which is probably exactly how you have it!
|
|
whiskeyd
Member in Training
That that is is, that that is not is not, that that is not is not that that is.
Posts: 23
|
Post by whiskeyd on Apr 2, 2023 15:05:54 GMT
The grid dots are zero based. Therefore, if the grid size is 50 and you pick the second grid point for the top that point is 49, 49. If you go down one row and over one grid point that point is 98, 98. The width and height is then calculated as an offset from the top, i. e. right - left, bottom - top (Brx - Ulx = width, Bry - Uly = height).
All of the grid points are zero based so each grid point marks the beginning of the next grid increment. To calculate the points any other way would result in the grid growing or shrinking to the right and down rather than being constant.
The point chosen is calculated by INT(Cursorposition / Gridsize - 1) * (Gridsize -1)
When the control is placed on the form the left and top row of points is hidden and the right and bottom row is visible. I can see where folks might get confused by both visual placement and numbers. Therefor I have incremented the width and height by one. This will cover the right and bottom rows of points. This will not change the numbers confusion problem since some will be even and some odd.
|
|
|
Post by Rod on Apr 2, 2023 17:16:33 GMT
If the first fifty pixel block occupies pixels 0-49 the second block must occupy pixels 50-99. The first is always even the last is always odd.
|
|
whiskeyd
Member in Training
That that is is, that that is not is not, that that is not is not that that is.
Posts: 23
|
Post by whiskeyd on Apr 3, 2023 0:25:08 GMT
I understand your reasoning, Rod, but it is invalid. If you have a 3 foot board and want to divide it into 3 equal pieces but only have a 1 foot ruler, how do you do it?
|
|
|
Post by Rod on Apr 3, 2023 6:26:55 GMT
Lay the rulers side by side so occupying three foot exactly. The first ruler covers pixel 0 to 11, the second ruler pixel 12 to 23 the third ruler pixel 24 to 35 so covering 36 pixels neatly. I think the zero index is the cause of the confusion but is necessary.
|
|
|
Post by Rod on Apr 3, 2023 8:17:27 GMT
This is quick and dirty demo of the placement I mean. So controls occupy their own space, no gaps if they are side by side.
nomainwin
dim obj(10,4) 'x,y,width/height, obj number = z order obj=1
WindowWidth=800 WindowHeight=600 UpperLeftX=(DisplayWidth-WindowWidth)/2 UpperLeftY=(DisplayHeight-WindowHeight)/2 open "Forms" for graphics_nsb_nf as #1 #1 "down ; trapclose [quit]" #1 "when leftButtonDown [start]" for x= 0 to 790 step 10 for y= 0 to 590 step 10 #1 "set ";x;" ";y next next #1 "flush bak" gosub [draw]
wait
[start] #1 "when leftButtonDown" #1 "when leftButtonMove [track]" #1 "when leftButtonUp [stop]" x=int(MouseX/10)*10 y=int(MouseY/10)*10 obj(obj,1)=x obj(obj,2)=y wait
[track] x=int(MouseX/10)*10 y=int(MouseY/10)*10 obj(obj,3)=x-obj(obj,1)'width obj(obj,4)=y-obj(obj,2)'height gosub [draw] wait
[stop] obj=obj+1 #1 "when leftButtonDown [start]" #1 "when leftButtonMove" #1 "when leftButtonUp" gosub [draw] wait
[draw] #1 "discard ; redraw bak" for n= 1 to obj #1 "place ";obj(n,1);" ";obj(n,2) #1 "box ";obj(n,1)+obj(n,3);" ";obj(n,2)+obj(n,4) next return
[quit] close #1 end
|
|