Page 1 of 5
[REQ] Control selection during browse mode
Posted: Sat Dec 10, 2022 6:36 pm
by Emily-Elizabeth
Does anyone have any code that will allow one to select a control during browse mode? The code would have to be GPL as I am using the Community Edition of LiveCode.
Re: Control selection during browse mode
Posted: Sat Dec 10, 2022 6:57 pm
by Klaus
Hi Emily-Elizabeth,
you can simply do this e.g. in a card script like in my example, see screenshot
->
set the selected of the target to true
Also works in BROWSE mode.
Maybe you want to insert this into front when neccessary and remove it later,
depends on when you want to select objects.
Best
Klaus
Re: [REQ] Control selection during browse mode
Posted: Sat Dec 10, 2022 8:16 pm
by Emily-Elizabeth
I'm building a visual database editor and the user will switch between "browse" and "edit" modes, so I just need this to work in "edit" mode. Thanks for the info.
Edit: you can see the work in progress
https://github.com/emily-elizabeth/Database-Designer
Re: [REQ] Control selection during browse mode
Posted: Sun Dec 11, 2022 12:18 am
by Emily-Elizabeth
Can't resize or move the controls though.

Re: [REQ] Control selection during browse mode
Posted: Sun Dec 11, 2022 2:54 am
by Emily-Elizabeth
Setting the cantSelect of the tools pane means that they are "live" even when in edit mode (so the other controls can be selected, moved and resized).
Re: [REQ] Control selection during browse mode
Posted: Sun Dec 11, 2022 10:47 am
by Klaus
Aha, well, you didn't mention that!

Editing is a complete different story and not so easy.
Setting the cantSelect of the tools pane means that they are "live" even when in edit mode (so the other controls can be selected, moved and resized).
Que? Sorry, no idea what you mean? There is no "canSelect" property anywhere.
Maybe you just mean the "Pointer Tool"?
Re: [REQ] Control selection during browse mode
Posted: Sun Dec 11, 2022 3:10 pm
by stam
Klaus wrote: ↑Sun Dec 11, 2022 10:47 am
Que? Sorry, no idea what you mean? There is no "canSelect" property anywhere.
Maybe you just mean the "Pointer Tool"?
This is what EE means:
And in the context (though she doesn't seem to have mentioned it explicitly) a 'canSelect' property would be nice too!
Re: [REQ] Control selection during browse mode
Posted: Sun Dec 11, 2022 3:24 pm
by Klaus
Ouch, three blind mice, me being one of them...

Re: [REQ] Control selection during browse mode
Posted: Sun Dec 11, 2022 6:07 pm
by Cairoo
Actually, Klaus isn't blind at all. There really is no "canSelect" property.
But there is a "cantSelect" property (emphasis on the t).
However, contrary to what Emily suggested, the cantSelect property, when set to true, actually prevents the user from being able to select the control.
What Emily seems to want to do is be able to select the controls, and resize and move them, while in browse mode.
Not that easy in browse mode.
Re: [REQ] Control selection during browse mode
Posted: Sun Dec 11, 2022 6:14 pm
by Klaus
I AM blind, I missed the T!

Re: [REQ] Control selection during browse mode
Posted: Sun Dec 11, 2022 6:16 pm
by richmond62
It is extremely easy to select something in Browse mode:
and the result is "all very sweet and sexy":
-

- SShot 2022-12-11 at 19.15.28.png (14.36 KiB) Viewed 6985 times
-
BUT that's about all you will get, as that does NOT allow you to resize or move the object about.
You can, of course, do this:
Code: Select all
on mouseDown
select me
grab me
end mouseDown
which allows you to
move the object around and shows the selected dots . . .
Re: [REQ] Control selection during browse mode
Posted: Sun Dec 11, 2022 6:27 pm
by Emily-Elizabeth
Don't feel bad, it's a hard property to find as it's not listed in the Inspector palette, but some sleuthing and trying got it figured out
Re: [REQ] Control selection during browse mode
Posted: Sun Dec 11, 2022 6:31 pm
by richmond62
I don't feel bad: but I do feel slightly angry with myself that I haven't managed
to work out how to do it.
Re: [REQ] Control selection during browse mode
Posted: Sun Dec 11, 2022 7:00 pm
by Emily-Elizabeth
Everything that you don't want to move/resize set the cantSelect to true and then you can create a new control, switch to the edit tool and then you can select/move/resize the new control.
Re: [REQ] Control selection during browse mode
Posted: Sun Dec 11, 2022 8:20 pm
by richmond62
Wow: you are a right crafty so-and-so!
I should, perhaps, 'remind you', that the origin of the word 'crafty' in Anglo-Saxon
has NO negative connotations: 'cræftiȝ" meaning 'clever'.
Although setting "Everything that you don't want to move/resize set the cantSelect to true"
could be long-winded, and, what if you want to muck about with one of those at a later date?