Magnifying glass

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!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Jean-Paul
Posts: 13
Joined: Wed Jun 05, 2024 5:19 pm
Location: France
Contact:

Magnifying glass

Post by Jean-Paul » Tue Jun 11, 2024 3:57 pm

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.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9785
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Magnifying glass

Post by dunbarx » Tue Jun 11, 2024 5:03 pm

Hi.

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?

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9867
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Magnifying glass

Post by FourthWorld » Tue Jun 11, 2024 5:17 pm

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

Jean-Paul
Posts: 13
Joined: Wed Jun 05, 2024 5:19 pm
Location: France
Contact:

Re: Magnifying glass

Post by Jean-Paul » Tue Jun 11, 2024 5:32 pm

Hi to all,

@dunbarx
Jacque made a magnifying tool years ago, but I am not sure that is what you are talking about
Yes, it is, I remember this lady who had developed a protection system against piracy too...
Ah, memories, memories!

This tool no longer works with the latest LC?

Regards, J-P.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9785
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Magnifying glass

Post by dunbarx » Tue Jun 11, 2024 6:02 pm

This tool no longer works with the latest LC?
I am sure it does. Jacque?

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:

Code: Select all

set the topLeft of control 1 to the botRight of control 2
is much better and more accurate. And again the "Align Controls" pane has really nice basic tools to do that sort of thing.

What are you trying to do?

Craig

Jean-Paul
Posts: 13
Joined: Wed Jun 05, 2024 5:19 pm
Location: France
Contact:

Re: Magnifying glass

Post by Jean-Paul » Tue Jun 11, 2024 6:46 pm

Craig wrote: And again the "Align Controls" pane has really nice basic tools to do that sort of thing
Ok, thanks, I'll look at this "Align Controls" pane...

Regards, J-P.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9785
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Magnifying glass

Post by dunbarx » Tue Jun 11, 2024 9:10 pm

Jean-Paul.

I think you will find the "Align Controls" invaluable. It is limited in features, but indispensable to me.

You can always roll your own gadgetry to do other things. Per example, to place the topLeft of a field 1 to the middle of the right side of a field 2:

Code: Select all

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.

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9785
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Magnifying glass

Post by dunbarx » Tue Jun 11, 2024 9:16 pm

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.

So, what are you trying to do?

Craig

stam
Posts: 2776
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Magnifying glass

Post by stam » Tue Jun 11, 2024 11:14 pm

If Jean-Paul means dragging objects to align, perhaps using guides is more useful?

LC now has guides of its own and Bernd has released a guides plugin; I personally use the plugin released by FerrusLogic as it's just a bit nicer:
https://github.com/Ferruslogic/DevGuide ... tag/v1.0.6

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.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9785
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Magnifying glass

Post by dunbarx » Tue Jun 11, 2024 11:26 pm

Stam.

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.

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9785
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Magnifying glass

Post by dunbarx » Tue Jun 11, 2024 11:41 pm

@ Anyone,

Make two fields, "F1" and F2" on a card somewhere. Put this in the card script:

Code: Select all

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.

Jean-Paul
Posts: 13
Joined: Wed Jun 05, 2024 5:19 pm
Location: France
Contact:

Re: Magnifying glass

Post by Jean-Paul » Wed Jun 12, 2024 9:48 am

Thanks to all for your answers.

I don't have enough time at the moment to delve into this further, but I'll come back to it...

Kind regards, J-P.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9867
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Magnifying glass

Post by FourthWorld » Wed Jun 12, 2024 3:07 pm

Most OSes have a keystroke to invoke zoom-in. Could it have been that?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7266
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Magnifying glass

Post by jacque » Wed Jun 12, 2024 6:09 pm

dunbarx wrote:
Tue Jun 11, 2024 6:02 pm
This tool no longer works with the latest LC?
I am sure it does. Jacque?
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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9867
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Magnifying glass

Post by FourthWorld » Wed Jun 12, 2024 6:54 pm

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

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”