[REQ] Control selection during browse mode

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Emily-Elizabeth
Posts: 205
Joined: Mon Jan 03, 2022 7:10 pm
Contact:

[REQ] Control selection during browse mode

Post 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.
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Control selection during browse mode

Post 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
Bildschirmfoto 2022-12-10 um 18.56.50.png
Emily-Elizabeth
Posts: 205
Joined: Mon Jan 03, 2022 7:10 pm
Contact:

Re: [REQ] Control selection during browse mode

Post 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. :D

Edit: you can see the work in progress https://github.com/emily-elizabeth/Database-Designer
Emily-Elizabeth
Posts: 205
Joined: Mon Jan 03, 2022 7:10 pm
Contact:

Re: [REQ] Control selection during browse mode

Post by Emily-Elizabeth »

Can't resize or move the controls though. :(
Emily-Elizabeth
Posts: 205
Joined: Mon Jan 03, 2022 7:10 pm
Contact:

Re: [REQ] Control selection during browse mode

Post 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).
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: [REQ] Control selection during browse mode

Post 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"?
stam
Posts: 3209
Joined: Sun Jun 04, 2006 9:39 pm

Re: [REQ] Control selection during browse mode

Post 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:
cantselect.jpg

And in the context (though she doesn't seem to have mentioned it explicitly) a 'canSelect' property would be nice too!
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: [REQ] Control selection during browse mode

Post by Klaus »

Ouch, three blind mice, me being one of them... :oops:
Cairoo
Posts: 112
Joined: Wed Dec 05, 2012 5:54 pm

Re: [REQ] Control selection during browse mode

Post 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.
Last edited by Cairoo on Sun Dec 11, 2022 9:11 pm, edited 2 times in total.
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: [REQ] Control selection during browse mode

Post by Klaus »

I AM blind, I missed the T! :-D
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: [REQ] Control selection during browse mode

Post by richmond62 »

It is extremely easy to select something in Browse mode:

Code: Select all

on mouseUp
   select me
end mouseUp
and the result is "all very sweet and sexy":
-
SShot 2022-12-11 at 19.15.28.png
SShot 2022-12-11 at 19.15.28.png (14.36 KiB) Viewed 11816 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 . . .
Last edited by richmond62 on Sun Dec 11, 2022 6:28 pm, edited 1 time in total.
Emily-Elizabeth
Posts: 205
Joined: Mon Jan 03, 2022 7:10 pm
Contact:

Re: [REQ] Control selection during browse mode

Post 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
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: [REQ] Control selection during browse mode

Post 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.
Emily-Elizabeth
Posts: 205
Joined: Mon Jan 03, 2022 7:10 pm
Contact:

Re: [REQ] Control selection during browse mode

Post 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.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: [REQ] Control selection during browse mode

Post 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'. 8)

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?
Post Reply