Page 2 of 2
Re: Is a selection rectangle possible?
Posted: Thu Nov 17, 2022 9:15 pm
by FourthWorld
M-A Kuttner wrote: Thu Nov 17, 2022 9:12 pm
Thanks guys! The project is that I have a large field of small rectangle graphics butted up against one another, and I want to select any subset of them within the larger field so as to access the names of each. However, I don't want to reposition any of them.
To make sure I understand, where you wrote "large
field of small rectangle graphics", did you mean "large
group of rectange graphics", or are these images displayed in a field object?
Re: Is a selection rectangle possible?
Posted: Thu Nov 17, 2022 9:21 pm
by M-A Kuttner
Sorry. I refer to it as a field to the users. It is indeed a large group (but not a Group) of graphics, each of which is sequentially numbered according to column and row.
Re: Is a selection rectangle possible?
Posted: Thu Nov 17, 2022 9:24 pm
by dunbarx
@Richard.
Yes, I used the actual pointer tool, and I wished I did not have to. I also think there should be a better way.
@ M-A Kuttner
If you have a bunch of controls scattered around, and I hear they are closely spaced, how are you going to set the bounds of your selection rectangle? Normally you would need to drag the pointer tool, right?
But if you want to do this from "above", how do you know? Can you click, perhaps with the optionKey, at the upperLeft and lowerRight corners and use those locs to set the react? That would work, and be far easier that typing in four integer items. It would be, as I mentioned to Richard above, a better way, and you do not have to change tools.
Craig
Re: Is a selection rectangle possible?
Posted: Thu Nov 17, 2022 9:26 pm
by M-A Kuttner
Yeah, that's how I'm doing it right now, and that does work. I was just wondering if there was a way to make that a more intuitive experience to the users (who are users of graphics applications).
Re: Is a selection rectangle possible?
Posted: Thu Nov 17, 2022 9:26 pm
by dunbarx
each of which is sequentially numbered according to column and row.
It always takes a while for everyone to get what is going on. This is normal.
Are these controls arranged in a grid? In that case, click on the upperLeft and lowerRight ones with, say, the optionKey, and you are done.
Craig
Re: Is a selection rectangle possible?
Posted: Thu Nov 17, 2022 9:28 pm
by dunbarx
Hmmm.
Are these graphics all the same size?
Craig
Re: Is a selection rectangle possible?
Posted: Thu Nov 17, 2022 9:28 pm
by M-A Kuttner
For context, here's what I'm talking about:
Re: Is a selection rectangle possible?
Posted: Thu Nov 17, 2022 9:40 pm
by M-A Kuttner
The rectangles in the black area are all 8 x 20. There are somewhere north of 4,000 of them.
Re: Is a selection rectangle possible?
Posted: Thu Nov 17, 2022 10:02 pm
by dunbarx
Whew.
Quite a few more than I thought. So how are you with clicking on the upperLeftMost and lowerRightMost rectangle, and nailing all the ones in between? I assume that one of the control keys should be held down when you do this to distinguish that process from any "normal" one.
Are you OK with writing the handler to do that, assuming that is how you want to do the selecting?
On another note, that is a handsome, if rather busy card you have there.
Craig
Re: Is a selection rectangle possible?
Posted: Thu Nov 17, 2022 10:12 pm
by M-A Kuttner
Haha - thank you Craig. It's turned into a much bigger beast than I was expecting when I started it a year ago.

Luckily it's an internal tool, so I don't have to worry about releasing it (and supporting it) to the general populace...
The handler already works. My question was more out of curiosity than necessity. What happens is that you select either the 4th or 5th tool down in the tool palette in the upper left, for copy or paste respectively. As you suggested, the user clicks the upper left and then the lower right rectangles that they want bounded, and the foregroundColor of each of those rectangles highlights in neon pink. Then the user clicks on the rectangle where they want to paste that block and voila!
Re: Is a selection rectangle possible?
Posted: Thu Nov 17, 2022 10:13 pm
by M-A Kuttner
In case it's not obvious, it's essentially a timeline based animation tool.
Re: Is a selection rectangle possible?
Posted: Thu Nov 17, 2022 10:13 pm
by FourthWorld
M-A Kuttner wrote: Thu Nov 17, 2022 9:40 pm
The rectangles in the black area are all 8 x 20. There are somewhere north of 4,000 of them.
Nice UI. Is this for a lightboard?
I'm assuming that the rect objects here change color when "selected", yes? That is, what you're after is effectively a form of "painting" by dragging across the rects, applying the currently selected color to their backColor, is that correct?
If so, I don't think you need object selection per se at all. I would imagine tracking a mouseMove handler that set the color of the mouseControl would suffice, no?
Re: Is a selection rectangle possible?
Posted: Thu Nov 17, 2022 10:25 pm
by M-A Kuttner
Thanks Richard. Yes, exactly. Each of the vertical pixel assignments (P01, P02, etc) corresponds to an LED in a light ring on the toy I'm helping with. The horizontal is 5 seconds, broken into 24 frames per second. You can select one or more of the "P" labels on the left to activate the corresponding lights and then either colour individual frames or do colour inbetweening over a range of frames to make some pretty nice animated arrangements that then play out on the ring. Here's a more detailed view of it in its full form:
And yes, this changes each rectangle's backcolor. The selection thing, as per my other message above, was more a nice-to-have that I was curious about rather than a needed feature.
Re: Is a selection rectangle possible?
Posted: Thu Nov 17, 2022 10:40 pm
by FourthWorld
M-A Kuttner wrote: Thu Nov 17, 2022 10:25 pm
The selection thing, as per my other message above, was more a nice-to-have that I was curious about rather than a needed feature.
I think mouseMove checking the mouseControl should cover what you need there. If you run into snags let me know.
The UI is cool enough that I would also like to suggest you consider writing a guest blog entry for LC. You can contact Heather at support AT livecode.com. They welcome guess blogs, and every backlink to you helps.
If nothing else, I'd get more backstory on this, and it's cool enough I'm eager to learn more.

Re: Is a selection rectangle possible?
Posted: Thu Nov 17, 2022 10:49 pm
by M-A Kuttner
Thanks again. I'd be happy to share. Just need to clear it with the crew here first.
That said, I'd be pretty embarrassed to show you the code. I'm not a programmer by training, and at the start I was getting back to a hypertalk-like language after many years away. Especially in the older features, it's a spaghetti factory in there.
But
that said, almost everything does work, so the end result is what we needed. And the other guys who we asked about writing something told us they'd need a 10 Million dollar LED order in order to customize their software for us. So LiveCode really ended up fitting the bill for what we needed.
Also, a big thanks to everyone in the forums. This has to be one of the friendliest and most helpful places on the internet.