How to select shapes on a panel in runtime?

Find and share HowTos to various installations / configurations!
Search

Post Reply
5 posts • Page 1 of 1
dbindernagel
Posts: 151
Joined: Mon Feb 23, 2015 1:34 pm

How to select shapes on a panel in runtime?

Post by dbindernagel »

Dear all,

is there a way to select shapes / panel references on a panel in runtime via the mouse, like you would in the Gedi by drawing a border around the objects?
I know that a panel has the property "selection" [dyn_shape], but it seems you can only use it to manually store a list of shapes in there.

I need to be able to allow my users to easily select mutliple objects on my panel. I do have a working solution for this (by drawing&resizing a rectangle when the user clicks on the panel and calculating the shape insides the rectangle), but after seeing the "selection" property I'm not sure if there isn't already an in-built solution that I have overlooked.

Has anyone done this before?
What is the use case of the "selection" property?

BR
Dennis

User avatar
leoknipp
Posts: 2846
Joined: Tue Aug 24, 2010 7:28 pm

Re: How to select shapes on a panel in runtime?

Post by leoknipp »

I have tested it.
It looks like it works when the option "Runtime Selection" is set for a panel. For a graphical object the property "Selectable" must be set.
Then "selection" returns a shape list of selected objects. A multi selection is possible with the "Ctrl"-key.

Best Regards
Leopold Knipp
Senior Support Specialist

gschijndel
Posts: 330
Joined: Tue Jan 15, 2019 3:12 pm

Re: How to select shapes on a panel in runtime?

Post by gschijndel »

Although it does not contain this selection property (yet), I guess it is part of the feature multiselection at run time

dbindernagel
Posts: 151
Joined: Mon Feb 23, 2015 1:34 pm

Re: How to select shapes on a panel in runtime?

Post by dbindernagel »

Thanks alot Leopold Knipp and gschijndel!
This works like a charm.

Setting "Runtime Selection" to true on the process panels and then "Selectable" to true on the clickframe of my objects and I can select these by either drawing an rectangle around them or by clicking on them directly while holding CTRL.

BR
Dennis

tpjctrl
Posts: 141
Joined: Tue May 08, 2018 10:30 am

Re: How to select shapes on a panel in runtime?

Post by tpjctrl »

I'll tag along here and ask a related question.

Lets say I have a few rectangles on a panel, the panel has "Runtime Selection" enabled and each of the rectangles has "Selectable" set to true. I can get the list of selected rectangles using the "selection" method, but there's no event linked with selection on the panel level, so how do you "uiconnect" so that you can react to a user using their mouse to select rectangles?

Post Reply
5 posts • Page 1 of 1