CanvasMap
Getting Started Tutorials 3D Reference

3D Deallocating

This topic deals with how items are selected in CanvasMap. When the user clicks on an item (something that appears in the GUI), any objects that are currently selected must first be unselected. Then the new item is selected. Users may also click on something that triggers an unselected without selecting a new item (i.e. nothing is then selected).

Approach:

Overriding

Note that selecting refers to selections of items in the MainContainer hierarchy. Objects will need to manage internal selections. As an example, a use may have selected a polygon in a layer and then selects another polygon in the same layer. This does not require a call to SetSelected() but the class will need to handle repainting and anyother issues internally. SetSelected() can be called but it will not have any effect because the object is already selected. Internal selections should call TheMainContainer.SelectionChanged() to send messages to listeners about selection changes that are internal to the item.

Messages

SELECTION_CHANGED is sent when the selectoin has changed to a new object.

 

Code

CMBase: SetSelected(Flag) - public function called to select a specific item. This function just calls CMBase.SetSelected(Target,Flag).

static CMBase.SetSelected(TargetItem,Flag)

protected CMBase.MakeSelected() - override to do antyhing that is needed when an object is selected (i.e. add tools to the tool bar)

protected CMBase.Unselected() - override to undo anything that was done when the object was selected (i.e. clear the tool bar)