Examples of Using iRidium Script

From iRidium Mobile Wiki
Jump to: navigation, search

Working with Keyboards and EditBox

DOWNLOAD: Example of a project

With iRidiumScript you can:

  • Activate different types of keyboards
  • Write a text from a keyboard into the EditBox item and edit the written text


Activating Keyboards

You can activate the following keyboard types in iRidium:

  • Regular
  • Numeric
  • Smart
  • Voice dialog


Receiving Data from EditBox

Using iRidiumScript you can read data written in EditBox. To do that use the following command:

Text = IR.GetItem("Page_Name").GetItem("Item_Name").Text;

  • Text - the variable where the data from EditBox are to be written to
  • Page_Name - the name of the page with EditBox
  • Item_Name - the name of EditBox
IR.AddListener(IR.EVENT_WORK, 0, function() //Event is activated while the application is running
{
  IR.GetItem("Page 1").GetItem("Item 2").Text = IR.GetItem("Page 1").GetItem("Item 1").Text; //The command reading data from EditBox and writing it into the item
});

Reading Data from EditBox

In iRidiumScript you can read data from EditBox:

IR.AddListener(IR.EVENT_ITEM_CHANGE, IR.GetItem("Page 1").GetItem("Item 1"),function()  //Event is activated at change
{
 IR.Log(IR.GetItem("Page 1").GetItem("Item 1").Text);  //The changed data is output in the log
});

↑ Back

Working with Color Schemes

DOWNLOAD: Example of a project


Working with Color

With iRidiumScript you can change the following colors used when displaying an object:

  • FillColor,
  • BorderColor,
  • TextColor,
  • TextEffectColor


To change the colors use the following commands:

IR.GetItem("Page_Name").GetItem("Item_Name").GetState(State_Number).Fillcolor=0xFFFFFFFF;

IR.GetItem("Page_Name").GetItem("Item_Name").GetState(State_Number).BorderColor=0xFFFFFFFF;

IR.GetItem("Page_Name").GetItem("Item_Name").GetState(State_Number).TextColor=0xFFFFFFFF;

IR.GetItem("Page_Name").GetItem("Item_Name").GetState(State_Number).TextEffectColor=0xFFFFFFFF;

  • Page_Name - the name of the page with the selected item
  • Item_Name - the name of the item which color you want to change
  • State_Number - the number of state which color you want to change
  • 0xFFFFFFFF - a color scheme in the Hex format


Color Format

In iRidiumScript the color schemes has the following structure:

0x FF FF FF FF

  • FF - Red colors (00 - FF)
  • FF - Green colors (00 - FF)
  • FF - Blue colors (00 - FF)
  • FF - Opacity (00 - FF)



Example:

 IR.GetItem("Page 1").GetItem("Item 1").GetState(0).FillColor       = 0xFFFF00FF;    //The command for changing the color of  	background fill 
 IR.GetItem("Page 1").GetItem("Item 1").GetState(0).BorderColor     = 0xFFFF00FF;    //The command for changing the border color
 IR.GetItem("Page 1").GetItem("Item 1").GetState(0).TextColor       = 0xFFFF00FF;    //The command for changing the text color
 (Coming soon)IR.GetItem("Page 1").GetItem("Item 1").GetState(0).TextEffectColor = 0xFFFFFFFF;    //The command for changing the text effect color

Main Color Codes

  • Red 0xFF0000FF - Red
  • Orange 0xFF0800FF - Orange
  • Yellow 0xFFFF00FF - Yellow
  • Green 0x00FF00FF - Green
  • Light blue 0x00FBFFFF - Light blue
  • Dark blue 0x0000FFFF - Dark blue
  • Violet 0x0800FFFF - Violet

↑ Back