Untitled Document
CApplicationAPI.OnMenuCommand Method 
GPS NAVIGATION SDK
version 8.3 build 47035

The function provides direct access to menu items.

public static int OnMenuCommand(
   out SError Error,
   int nID,
   int nSubID,
   bool bShowApplication,
   int MaxTime
);

Parameters

Error
Additional error information returned from Drive.
nID
Menu ID to which function provides access. Possible values are enumerated in CApplicationMenu.ID enum.
Name of most of CApplicationMenu.ID items is similar to name of menu displayed in screen top left corner. It is also similar to button name in main menu which opens corresponding menu.
nSubID
Menu SubID corresponding to menu ID.
Name of most of SubID items is similar to name of correspondig button in corresponding menu (nID).
OnMenuCommand function calls function which is called after clicking this button.
Links to possible enums are listed in CApplicationMenu.ID.

For example: if nID = CApplicationMenu.ID.IdMenuManagePoi nSubID must be chosen from CApplicationMenu.IdMenuManagePoi enum.
bShowApplication
Flag determining whether Drive should be brought to foreground automatically.
true - Drive will be brought to foreground
false - Drive will stay in background
MaxTime
Maximum of time (in milliseconds) function can take. If MaxTime=0 function execution is not time limited.

Return Value

1 if successful, other value otherwise.

Remarks



Possible error codes returned from Drive are:



Example

SError error;
int nID = CApplicationMenu.ID.IdMenuMain;
int nSubID = CApplicationMenu.IdMenuMain.OnMainNavigateTo;
bool bShowApplication = true;
int nMaxTime = 10000;

CApplicationAPI.OnMenuCommand(out error, nID, nSubID, bShowApplication, nMaxTime);
This code brings Drive to foreground and shows NavigateTo menu.

See Also

CApplicationAPI Class | ApplicationAPI Namespace