Proposal for the behavior of the SelectionChanged and SelectBoxFinal events


#1

Hello All (including, but not limited to @pmeems, @GKing, and @Anthony.

Whether or not you have following the ‘Selection by polygon’ conversation, I am going to make a proposal regarding the behavior of the SelectionChanged and SelectBoxFinal events. To summarize, the two events should be triggered independently of each other, and behave in a consistent manner independent of each other.

Regarding the SelectionChanged event, the following describes the current behavior, and will remain unchanged.

  1. Both the cmSelection and cmSelectByPolygon tools are capable of selecting from a single layer (via the ChooseLayer event) or from multiple layers (based on the Shapefile.Selectable property).
  2. Whether using the cmSelection or cmSelectByPolygon tool, if any shapes are ‘selected’, you will receive a SelectionChanged event for each layer containing ‘selected’ shapes.

Regarding the SelectBoxFinal event

  1. If you set the Map.SendSelectBoxFinal property = True, then the SelectBoxFinal event should be raised any time you finish dragging a selection box on the screen. This currently applies to the both the cmZoomIn and cmSelection tools, and should not be dependent upon whether or not any shapes were actually ‘selected’ by the cmSelection tool.
  2. This behavior differs slightly from what has been in place up through v4.9.x of MapWinGIS, for which the SelectBoxFinal event was only raised from the cmSelection tool if no shapes were ‘selected’ by the tool. It is more consistent to always raise the SelectBoxFinal event, whether or not any shapes were ‘selected’. The SelectionChanged event is always raised first, and thus the programmer can decide within the SelectBoxFinal event whether or not any further action is necessary.

I believe these rules represent a simple and intuitive behavior, and result in a consistent and predictable programming paradigm.

Please feel free to provide any feedback as you see fit, and unless there are any serious concerns, I will likely move forward with this behavior within the next week. My goal would be to get these updates into a near-term follow-up to the v5.0 release.

Thank you,
Jerry.