[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: 101
Joined: Mon Jan 03, 2022 7:10 pm

[REQ] Control selection during browse mode

Post by Emily-Elizabeth » Sat Dec 10, 2022 6:36 pm

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: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Control selection during browse mode

Post by Klaus » Sat Dec 10, 2022 6:57 pm

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: 101
Joined: Mon Jan 03, 2022 7:10 pm

Re: [REQ] Control selection during browse mode

Post by Emily-Elizabeth » Sat Dec 10, 2022 8:16 pm

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: 101
Joined: Mon Jan 03, 2022 7:10 pm

Re: [REQ] Control selection during browse mode

Post by Emily-Elizabeth » Sun Dec 11, 2022 12:18 am

Can't resize or move the controls though. :(

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

Re: [REQ] Control selection during browse mode

Post by Emily-Elizabeth » Sun Dec 11, 2022 2:54 am

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: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: [REQ] Control selection during browse mode

Post by Klaus » Sun Dec 11, 2022 10:47 am

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: 2688
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: [REQ] Control selection during browse mode

Post by stam » Sun Dec 11, 2022 3:10 pm

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: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: [REQ] Control selection during browse mode

Post by Klaus » Sun Dec 11, 2022 3:24 pm

Ouch, three blind mice, me being one of them... :oops:

Cairoo
Posts: 107
Joined: Wed Dec 05, 2012 5:54 pm

Re: [REQ] Control selection during browse mode

Post by Cairoo » Sun Dec 11, 2022 6:07 pm

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: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: [REQ] Control selection during browse mode

Post by Klaus » Sun Dec 11, 2022 6:14 pm

I AM blind, I missed the T! :-D

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9393
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: [REQ] Control selection during browse mode

Post by richmond62 » Sun Dec 11, 2022 6:16 pm

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 4024 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: 101
Joined: Mon Jan 03, 2022 7:10 pm

Re: [REQ] Control selection during browse mode

Post by Emily-Elizabeth » Sun Dec 11, 2022 6:27 pm

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: 9393
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: [REQ] Control selection during browse mode

Post by richmond62 » Sun Dec 11, 2022 6:31 pm

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: 101
Joined: Mon Jan 03, 2022 7:10 pm

Re: [REQ] Control selection during browse mode

Post by Emily-Elizabeth » Sun Dec 11, 2022 7:00 pm

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: 9393
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: [REQ] Control selection during browse mode

Post by richmond62 » Sun Dec 11, 2022 8:20 pm

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

Return to “Getting Started with LiveCode - Experienced Developers”