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 14:19:15 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. No. You have only one ruler. Put one end of the ruler at the end of the board. Place a mark at the other end of the ruler. Move the ruler end to the mark, place a mark at the other end of the ruler. You now have three 1-foot segments. Each mark placed becomes the end of the board (the zeroth point, if you like).
When you draw a line segment on a piece of paper from X0, Y0 to X1, Y1, then want to draw a second line segment at a different angle but attached to the first line at one of its ends you do not start at X0 - 0.1, Y0 - 0.1 or X1 + 0.1, Y1 + 0.1. The same applies to evenly spaced grid points. You use point X0, Y0 to calculate where point X1, Y1 is, X1, Y1 to calculate where X2, Y2 is, etc.
As far as control placement goes, if one wants to place controls so there is no gap between them all that is necessary is select the proper grid points.
|
|
|
Post by Rod on Apr 3, 2023 15:56:11 GMT
You are discussing fictional lines between pixels. The code needs to deal with actual pixels. But I have explained my point well enough.
|
|
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 19:57:06 GMT
Fixed code that produced "bad file label" errors. Added a bitmap for BMPBUTTONS that the user creates. To eliminate the production of this bitmap the user has to go into properties and change the caption to define h/er bitmap. The bitmap name is "YOURBMP.BMP" as is sized to the size of the button as layed out in the designer. Added a "TEST" mode. This mode allows the user to click on a button, listbox or combobox in the designer and receive a message which gives the ID number and the caption of the control clicked. To exit text mode click on the red test button at the upper right corner of the main window. Added function FN.GetHndl() and an error trap in the first window close sub/label that checks if other windows were closed before closing the first window created. In JB this may have to be revised since it uses function HWND() and I do not know whether JB has that function. Tsh, I am not sure what you are referring to when you say that the dialogs are coming up as DIALOG_NF. All of the windows come up as they are supposed to except they all have a sizing border to enable the user to size them to suit. LB brings them up the way they are suppose to. I do not have WinXP, wish I did, but I think I have fixed the smear and caption problem by changing the window styles. Anyway, here is the latest.
LBFORMS_V2.1.ZIP approx 280 K uncompressed.
|
|
|
Post by tsh73 on Apr 3, 2023 21:54:47 GMT
Sorry it got worse. Forget it - you cannot fix it without Win XP, and it does not worth it.
|
|
|
Post by cundo on Apr 4, 2023 21:12:34 GMT
Would be to have some sort of log/debug text so we know if it is working right. At the status area perhaps. Something like : 'button was added at 12 123 with size 125 25'. 'Button wasn't added because of...". Well, just an idea.
|
|
|
Post by cundo on Apr 4, 2023 21:14:20 GMT
This code was saved ok, but it's not JB compatible at the moment '/=====================================================/' ' CREATED BY LB FORMS DESIGNER LITE ' 04-04-2023 ' 18:12:56 '/=====================================================/'
'-------------------------------------------------------------------------------- ' BEGIN CODE '--------------------------------------------------------------------------------
RetVal = 0
RetVal = FN.FORM1()
WAIT
'-------------------------------------------------------------------------------- '--------------------------------------------------------------------------------
FUNCTION FN.FORM1()
'<--------------- BEGIN CONTROLS --------------> BUTTON #FORM1.BTN101, "BUTTON 101", FORM1.BTN101, UL, 36, 45, 1, 1 BUTTON #FORM1.BTN102, "BUTTON 102", FORM1.BTN102, UL, 36, 45, 145, 55
'<--------------- BEGIN MENUS ------------------>
'<--------------- BEGIN FORM ------------------>
Cx = 0 Cy = 0 Ux = 0 Uy = 0 Bx = 0 By = 0
Cx = DisplayWidth / 2 Cy = DisplayHeight / 2 Ux = Cx - 316 / 2 Uy = Cy - 339 / 2
RetVal = FN.WinPos(Ux, Uy) RetVal = FN.WinSize(316, 339)
OPEN "none" FOR WINDOW AS #FORM1
PRINT #FORM1, "TRAPCLOSE CLOSE.FORM1" PRINT #FORM1, "RESIZEHANDLER RESIZE.FORM1" END FUNCTION
'------------------------------------------------- '-------------------------------------------------
'<--------------- BEGIN EVENT BRANCHES -------->
'------------------------------------------------- '-------------------------------------------------
SUB CLOSE.FORM1 FormHndl$
CLOSE #FORM1
END
END SUB
SUB RESIZE.FORM1 Formhndl$ '<------- YOUR CODE HERE ------->
END SUB
'------------------------------------------------- '-------------------------------------------------
SUB FORM1.BTN101 BtnHndl$
'<--- YOUR CODE HERE ---->
END SUB
'------------------------------------------------- '-------------------------------------------------
SUB FORM1.BTN102 BtnHndl$
'<--- YOUR CODE HERE ---->
END SUB
'------------------------------------------------- '-------------------------------------------------
FUNCTION FN.WinPos(Posx, Posy)
UpperLeftX = Posx UpperLeftY = Posy
END FUNCTION
'------------------------------------------------- '-------------------------------------------------
FUNCTION FN.WinSize(Xwide, Yhigh)
WindowWidth = Xwide WindowHeight = Yhigh
END FUNCTION
'------------------------------------------------- '-------------------------------------------------
FUNCTION FN.GetHndl(HndlTag$)
Hndl = 0
ON ERROR GOTO [HNDL.ERR] Hndl = HWND(#HndlTag$) FN.GetHndl = Hndl EXIT FUNCTION
[HNDL.ERR] END FUNCTION
|
|
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 5, 2023 21:29:25 GMT
I am guessing it was a compile time error that stopped here:
FUNCTION FN.GetHndl(HndlTag$)
Hndl = 0
ON ERROR GOTO [HNDL.ERR] Hndl = HWND(#HndlTag$) '<--- ERROR HERE FN.GetHndl = Hndl EXIT FUNCTION
[HNDL.ERR] END FUNCTION I could not find LB function HWND() in the JB help although I did find function HBMP(), and procedure MAPHANDLE. Thought it might be an omission.
Anyway this should work.
As for an error log, the only thing I can think of that would cause a control to not be added is if the width or height is zero. In that case the app assumes that the user changed h/er mind. If you can think of something that would cause a control not to be added, I am all ears.
I am exploring a method to enable the user to add code without it being over-written on save.
|
|
|
Post by cundo on Apr 6, 2023 19:49:26 GMT
Yes, that happened to me. But I wasn't sure if the control was added with a very small width and height by mistake.
|
|
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 6, 2023 23:48:25 GMT
When a control is added it will show up in the source code; however, if it is deleted after being added to the visual form in the designer, it is deleted from the form and will not be listed in the source code.
You can define the control placement by starting at the lower right corner and moving to the upper left corner. The control will be correctly placed.
|
|