Settings.ClearSelectionOnAdd

Coordinator
Jul 2, 2010 at 6:04 AM
Edited Jul 2, 2010 at 6:07 AM

Hi David and others,

I'm looking at Settings.ClearSelectionOnAdd = true. There are two places in code where it is used:

1. FigureCreator.Stopping:

========================

public override void Stopping()
{
    ...
    if (Settings.ClearSelectionOnAdd)
    {
        Drawing.Figures.ClearSelection();
    }

========================

2.

========================

public void Add(IFigure figure)
{
    if (Settings.ClearSelectionOnAdd)
    {
        Figures.ClearSelection();
    }

I'm thinking maybe we should juse remove both calls to ClearSelection and get rid of the setting.

Thoughts?

Thanks, Kirill

Developer
Jul 2, 2010 at 1:07 PM
Kirill, I added this setting as a way to change the behavior of the Dynamic Geometry library without having to subclass or replace a class altogether. The ClearSelectionOnAdd settting was added because in Tabula (my adaption of the library) I would like figures to remain selected after they are added to the drawing. So the default value for the DG Library is true, but I change this to false in Tabula. This selection behavior is common for many vector drawing apps so I figure others who might also want to change the setting. Without the ClearSelectionOnAdd setting developers like me would have to subclass or replace both FigureCreator and Drawing (plus make other related changes). So with that said, is this a good strategy? I think it and the other settings I added would be a nice convenience and not too much extra baggage. David
Coordinator
Jul 2, 2010 at 5:28 PM

Thanks David, this is a great change actually. I've switched the default to false for LiveGeometry as well. I'm thinking of completely deleting the setting and the code that clears the selection in those two places. Any objections?

Developer
Jul 2, 2010 at 5:54 PM
No objections Kirill. ( Glad to have you back! )