nmpButtonWidth (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 width of a configurable button on the NMP.

To prevent the buttons from jumping when updated, it is recommended to only change the width of multiple buttons when they all are invisible.

 

Input:

id : INT

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

 

weight : INT

Determines the width of the button relative to the total weight of all the buttons.

A button with weight 2 is twice as wide as a button with weight 1. If the total weight of the buttons is 4, a button with weight 2 will a width 50% of this.

 

max_width : INT (0..100)

Determines the maximum width of the button as an integer between 1 and 100, where 100 is the entire width of the panel.To have no maximum value, use 0.

This is used to prevent a button from becoming too wide when only a few buttons are defined by limiting the width to e.g. 50 % of the total width.

 

 

Returns: INT

0

- Success.

-1

- Navigation interface is not open.

-2

- Error communicating with navigation device.

-4

- The navigation device rejected the command.

-8

- Invalid parameters.

-11

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

-12

- Navigation interface is busy.

 

Declaration:

FUNCTION nmpButtonWidth : INT;
VAR_INPUT
  id       : INT;
  weight   : INT := 1;
  max_width : INT := 0;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
BEGIN
  ...
  // Sets the width of four buttons: The first one is small, the next one twice as wide.
  // The next one takes up the same space as the second, but is only as wide as the first one.
  // The fourth button is the same width as all the others combined.
  nmpButtonWidth(id:=1, weight:=1);
  nmpButtonWidth(id:=2, weight:=2);
  nmpButtonWidth(id:=3, weight:=2, max_width:=10);
  nmpButtonWidth(id:=4, weight:=5);
  ...
END;
END_PROGRAM;