Nevron Forum

Selection problem

https://www.nevron.com/Forum/Topic7378.aspx

By Sergey Suloev - Wednesday, January 23, 2013

Hi Support,

I have a problem selecting a shape when it's nested in NGroup.
In my application I have parent NGroup, with a few nested NGroup objects, and each nested NGroup
has a number of NRectangleShape objects.
NGroup shapes have a padding , so that their background is partially visible.
I want to select a nested NGroup (by clicking on partially visible background), or a NRectangleShape immediately,
but instead I need to click 2 or 3 times to achieve this.

How to setup selection the way I need ?


Thank you
By Nevron Support - Thursday, January 24, 2013

Hi, you should apply Select protection to the groups you do not want to participate in the selection process. For example you can use the following method:

private static void SetSelectProtection(NShape shape)

{

        NAbilities protection = shape.Protection;

        protection.Select = true;

        shape.Protection = protection;

}

Then if you want to directly be able to select the rectangles you can call this method for the groups and the subgroups.

By Sergey Suloev - Thursday, January 24, 2013

Thank you for your response,
but I would like to select all the shapes, including the top level group, which I want to be draggable over the document, and subgroups too.
The only thing I don't like about default selection is that I 'm not able to select subgroups and rectangles directly by clicking on them.
First click on a rectangle always gives me top-level group selected, the second click select a subgroup, where rectangle resides, and the 3rd click gives me rectangle itself.
Look at screenshot to understand configuration.
By Sergey Suloev - Thursday, January 24, 2013

Thank you for your response,
but I would like to select all the shapes, including the top level group, which I want to be draggable over the document, and subgroups too.
The only thing I don't like about default selection is that I 'm not able to select subgroups and rectangles directly by clicking on them.
First click on a rectangle always gives me top-level group selected, the second click select a subgroup, where rectangle resides, and the 3rd click gives me rectangle itself.
Look at screenshot to understand configuration.