Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
In my old, old version of LC (6.5), I remember that there was a magnifying glass to position objects precisely on the sheet. But I don't remember how I did it...
If anyone would like to refresh my memory, thank you in advance.
Kind regards, Jean-Paul.
Jacque made a magnifying tool years ago, but I am not sure that is what you are talking about.
In a CAD program, there are many tools to aid one in snapping various features of one object onto, or aligned with, another. I do not recall any such tool in LC.
You are aware of the very nice "Align Controls" tool in the inspector, right? Or the somewhat useful "Geometry manager", also in the inspector?
dunbarx wrote: Tue Jun 11, 2024 5:03 pm
In a CAD program, there are many tools to aid one in snapping various features of one object onto, or aligned with, another. I do not recall any such tool in LC.
A snap-to grid can be toggled from the Objects menu, with the grid size settable in Prefs.
Richard Gaskin LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
But zooming in on an area of the card is, to me, not very valuable. Would you nudge one control under magnification as it approaches a point of interest? Doing this sort of thing under script control:
on mouseUp
put the right of fld 2 & "," & the top of fld 2 + (the height of fld 2 / 2) into rightMidPoint
set the topLeft of fld 1 to rightMidPoint
end mouseUp
That sort of thing. Useful if you do a lot of that kind of rearranging. Once you have a library of similar stuff you can create a CAD program. For example, you could expand the rect of a control in much the same way, using existing points. The rect could be enlarged from, say, its current topLeft to that same rightMidPoint.
I am going on and on because I do not know what you really want. In the last example, it would be better to use the "mouseMove" handler to expand that control instead of specifying points.
FerrusLogic appear to have disappeared as an entity, but their products are still good - and as were released as opensource, the code is fully accessible.
I do a bit of CAD work, and an active grid can be very helpful indeed. But it is not nearly as useful as the ability to have features of objects snap to the principal features of other objects, perimeter endpoints and midpoints, centers of the objects themselves, those sorts of things.
The issue is best seen if one is trying to align controls that are not the same size. Unless their rects, in both axes, are integral multiples of the grid setting, a grid is worse than useless. Better to use the properties inherent in the objects to align with those of other objects than to drag them around trying to get them to behave the way you want. The most basic type available in LC is to be able to set the locs of features of controls, as in the examples I gave above.
on mousemove
if abs(item 1 of the botLeft of fld "F1" - item 1 of the topRight of fld "F2") < 8 and\
abs(item 2 of the botLeft of fld "F1" - item 2 of the topRight of fld "F2") < 8 then set the botLeft of fld 1 to the topRight of fld 2
end mousemove
Now choose the pointer tool and drag field 1 around a bit and then make the botLeft of fld 1 approach the topRight of fld 2. When they get close, the two fields will snap together. The "mousemove" message is sent while in edit mode. That sort of gadget is what I was suggesting.
Craig
Last edited by dunbarx on Wed Jun 12, 2024 1:46 pm, edited 1 time in total.
That tool was for zooming into an image but didn't have any layout capabilities. It was a list challenge for viewing only a subsection of an image at various sizes. In this case I think the OP wants the grid lines option.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
I think what he's looking for is the type of stuff we see in Quant-UX, Figma, and Appli, where UI elements snap along boundaries related to other controls and common layout margins.
Richard Gaskin LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn