Creating Dynamic Lists in TPDesign4: IRLB Commands

From iRidium Mobile Wiki
Jump to: navigation, search

Dynamic iRidium List (List) is an item in AMX projects. On its basis you can form a scrolling list from one popup (template). Components of the scrolling list can be added or deleted during project work on your control panel.

The number of list components is set up by the controller command and can be limited by the settings of the graphic item – the list basis. You can change the content of the popup (template) in each list component when working with the project with the help of special commands.


Preparation of the List Basis in AMX TPDesign4

AMX commands cannot be assigned to the popup (template) of the list in a regular way.

When pressing on one of the list components, the list sends its identifier and the identifier of the sub-item in the component where the pressing is done to the AMX controller. The controller processes these values and activates the corresponding scenarios.


Multistate-Bargraph is always used as the list basis. In the properties of the item indicate the popup (template) of the list as follows:

IridiumList=Template_1;
  • where Template_1 – the name of the popup (template) for forming the list


AMX DinList AddBase1.png


In the Programming tab of the list basis set up the way how information about pressing on the list components will be received. The information is sent to the AMX controller and the controller forms activation of the corresponding scenarios on its basis:

Address Code is used to control the list from the controller.

If you send value 10 to Address Code of the list, the cursor is positioned on the 10th item (if there is one).

Level Code is used to monitor pressings on list items.

Level Code sends information about items or sub-items which are pressed by the user to the controller.
If you set up Level Code: 401 for the list and press the 10th list item, the controller receives value 10 in Level Code: 401. Information about the pressed sub-item of the list is sent to the following Level Code: 402.
If the 10th item has 3 sub-items and we press the second sub-item, Level Code: 402 receives value 2 (starting with zero: 0 – item base, 1 – the first sub-item, ...)


AMX DinList AddBase2.png


A standard Popup is always used as a template of the list component). The identifier of the first list component (ID of the first item) is indicated when forming the list with the help of the IRLB_ADD command (see the list of commands). Sub-items of each list component are standard buttons or other graphic items.

If you make Level or Joystick on of the list components, the value selected on the level CANNOT be sent to the controller. You can only send information about pressing on Level or Joystick which are sub-items of one of the list components.


AMX DinList AddTemplate.png


IRLB Commands –Controlling Dynamic Lists

IRLB commands is the set of commands you can send to iRidium Apps. They cannot be perceived by standard AMX panels.


1. Adding a required number of components to the list

send_command dvTP, "'IRLB_ADD-<address,count,start_id>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • count – a number of list components you need to create
  • start_id – the identifier of the first component in the list

Example: create the list of 25 components (basis – item with Code:400, number of components - 25, ID of the first component - 0)

AMX DinList SendAdd.png


2. Deleting the selected component by its ID

send_command dvTP, "'IRLB_DELETE-<address,id>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id – the identifier of the list component you want to delete


3. Deleting all components

send_command dvTP, "'IRLB_CLEAR-<address>'" 
  • address – the address of the list basis (Multistate-Bargraph)


4. Setting up the list "resistance" in the percentage terms from 0 to 100% (0 – no resistance, 100 – no movement)

send_command dvTP, "'IRLB_RESISTENCE-<address,value>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • value – the "resistance" value in the range from 0 to 100


5. Setting up the list position

send_command dvTP, "'IRLB_POSITION-<address,id>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component you want to go to


6. Setting up the list color

send_command dvTP, "'IRLB_SCROLL_COLOR-<address,color>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • color - HEX, RGB, the color name


7. Setting up the X coordinate of the list sub-item

send_command dvTP, "'IRLB_ITEM_X-<address,id,subitem,value>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • value – the X coordinate value of the sub-item in pixels


8. Setting up the Y coordinate of the list sub-item

send_command dvTP, "'IRLB_ITEM_Y-<address,id,subitem,value>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • value - the Y coordinate value of the sub-item in pixels


9. Setting up the width of the list sub-item

send_command dvTP, "'IRLB_ITEM_WIDTH-<address,id,subitem,value>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • value – the width of the sub-item in pixels


10. Setting up the height of the list sub-item

send_command dvTP, "'IRLB_ITEM_HEIGHT-<address,id,subitem,value>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • value - the height of the sub-item in pixels


11. Setting up the color of the list sub-item

send_command dvTP, "'IRLB_ITEM_COLOR-<address,id,subitem,color>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • color - HEX, RGB, the color name


12. Setting up the opacity of the list sub-item

send_command dvTP, "'IRLB_ITEM_OPACITY-<address,id,subitem,value>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • value – the opacity value in the range from 0 to 255


13. Setting up the text of the list sub-item in the CP1251 format

send_command dvTP, "'IRLB_ITEM_TEXT-<address,id,subitem,string>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • string – in the CP1251 format


'14. Setting up the text of the list sub-item in the Unicode format send_command dvTP, "'IRLB_ITEM_UNI-<address,id,subitem,string>'"

  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • string – in the Unicode format


15. Setting up the text color of the list sub-item

send_command dvTP, "'IRLB_ITEM_TEXT_COLOR-<address,id,subitem,color>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • color - HEX, RGB, the color name


16. Setting up the text aligning of the list sub-item

send_command dvTP, "'IRLB_ITEM_TEXT_ALIGN-<address,id,subitem,align>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • align - the way of aligning


17. Setting up the image of the list sub-item

send_command dvTP, "'IRLB_ITEM_IMAGE-<address,id,subitem,image name>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • image name - имя изображения, добавленного в галерею проекта


18. Setting up the image aligning of the list sub-item

send_command dvTP, "'IRLB_ITEM_IMAGE_ALIGN-<address,id,subitem,align>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • align - the way of aligning


19. Setting up the icon of the list sub-item

send_command dvTP, "'IRLB_ITEM_ICON_ALIGN-<address,id,subitem,name>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • name – the name of the image added in Project Gallery


20. Setting up the icon aligning of the list sub-item

send_command dvTP, "'IRLB_ITEM_ICON_ALIGN-<address,id,subitem,align>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • align – the way of aligning


21. Setting up the border of the list sub-item by its identifier

send_command dvTP, "'IRLB_ITEM_BORDER-<address,id,subitem,border>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • border – the border type

22. Setting up the border color of the list sub-item

send_command dvTP, "'IRLB_ITEM_BORDER_COLOR-<address,id,subitem,color>'"
  • address – the address of the list basis (Multistate-Bargraph)
  • id - the identifier of the list component
  • subitem - the identifier of the sub-item in the component list (beginning with 0, 0 – background , etc.)
  • color - HEX, RGB, the color name


Downloads

Download: Example of creating dynamic lists in AMX TPDesign4 (52,4 KB)