tsc_JobMapBeforeSelectionPopupEventArgs

An instance of this class is provided to the tsc_JobMap::OnEntityPopup event handler in response to a tap-and-hold on the map window by the user.  The event handler is called after the popup menu has been created, but before it is displayed.

The OnEntityPopup event handler may modify the menu before it is presented to the user, and this class provides the methods to do that.

The menu's content is very dependent upon the items that are selected at the time.  The list of currently selected entities can be obtained by calling the tsc_JobMap::GetSelections method.

Public members

tsc_JobMapStateEventArgs& State;
This property contains a number of methods to obtain the current map state and perform coordinate conversions.

tsc_XCodeList GetMenuItems () const;
Returns a copy of the items that are currently on the popup menu.  Changing this list has no effect on the menu.

void RemoveItem (x_Code item);
Removes an item from the menu.  If the item does not exist, the list remains unchanged.

void EnableItem (x_Code item, bool enabled);
Enables or disables an item on the menu.  Disabled items are displayed but are greyed out and cannot be selected.

void AddItem (x_Code item, bool enabled = true);
Adds an item to the end of the menu.  The x-code for the item may be any Survey Core x-code or a PX_ code defined by the plugin's language file.  If the x-code is known by the map (see list below) then the corresponding action will be performed without further action by this class.  Avoid adding duplicate x-codes to the menu.

If the x-code of the inserted item is not known to the map or is a PX_ code defined by the plugin, then it must be handled within the plugin, by overriding the OnEntityPopupSelection event handler, which is called when the user selects an item from the menu.

Possible Map Popup Menu X Codes

This table shows the x-codes that are recognised by the Survey Core map popup menu item selection handling.  Any custom codes that are added to the menu must be handled by the plugin, or they will be ignored.  This list is subject to change at any time. 

Note: Since this list was documented, many changes (mostly additions) have occurred, plus in this version of Google Sites it is difficult to maintain the table. In any case we suggest you override the OnEntityPopup in your tsc_JobMap subclass and log out (or debug) the values that are passed for the items you are interested in. You can find the x-code names for these values by looking them up in the include\tsc_xcodes.h header file in the SDK.