nmpButtonColor (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

MX2i pro, CX1 pro/flex/warp, SX1, MX2 turbo, NX-200, NX-400, NX-900, LX2

Firmware version:

2.64 / 1.00.00

Nav. API level:

2


This function will set the background colors for a configurable button on the NMP.

 

 

Input:

id : INT

The ID of the button - between 1 and the button count defined in nmpButtonsDefine.

 

color: DINT (-1, 16#00_00_00..16#FF_FF_FF, default: -1)

Determines the color of the button. If -1, the theme color will be used.

Instead of specifying the color directly, the nmpRGBToDint function can be used.

 

night_color: DINT (-1, 16#00_00_00..16#FF_FF_FF, default: -1)

Determines the color of the button to use when in the night theme. If -1, the day color will be used - unless it is set to use the theme, in which case the color of the night theme will be used.

Instead of specifying the color directly, the nmpRGBToDint function can be used.

 

 

 

Returns: INT

0

- Success.

-1

- Navigation interface is not open.

-2

- Error communicating with navigation device.

-4

- The navigation device rejected the command.

-8

- Illegal ID.

-11

- This is not supported by the device (the device is not an NMP device).

-12

- Navigation interface is busy.

 

Declaration:

FUNCTION nmpButtonColor : INT;
VAR_INPUT
  id         : INT;
  color       : DINT := -1;
  night_color : DINT := -1;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc : INT;
END_VAR;
BEGIN
  ...
  // Set backgound color for button 1 to a bright yellow, and the night color to a dark yellow
  rc := nmpButtonColor(id := 1, color := 16#FF_FF_00, night_color := 16#C8_C8_00);
  IF rc <> 0 THEN
    DebugFmt(message := "Error: nmpButtonColor=\1", v1 := rc);
  END_IF;
  ...
END;
END_PROGRAM;