Page History: Built-in data types
Compare Page Revisions
Page Revision: 2012/02/01 06:17
|
Custom data types
|
Info |
Category: |
Programming
| |
Role: |
|
EventIDE provides several built-in data types that are used for element properties. The built-in types are also available for coding in the snippets and developing the custom AddIns. The built-in types are not classes but plain
.NET values types - it means they don't need a class constructor and disposing. On this page all built-in EventIDE types are listed with complete descriptions and code examples.
stColor type
stColor is a data type for managing colors in EventIDE. stColor is a
data struct that stores a single 32-bits ARGB value.
Fields
stColor contains the following struct fields:
Field Name | Description | Value Type |
---|
.A | Defines a value for the Alpha channel (transparency). The valid range is 0..255. | Int32 |
.R | Defines a value for the Red channel. The valid range is 0..255. | Int32 |
.G | Defines a value for the Green channel. The valid range is 0..255. | Int32 |
.B | Defines a value for the Blue channel. The valid range is 0..255. | Int32 |
.Hue | Defines the color hue in HSB/HSV color space. The value has to be in the range 0..360. If the Saturation and Brightness have extreme values(e.g. 0 or 100) changes in the Hue field are ignored | Double |
.Saturation | Defines the color saturation in HSB/HSV color space The value has to be in the range 0..100 | Double |
.Brightness | Defines the color saturation in HSB/HSV color space The value has to be in the range 0..100 | Double |
.Color | Represents the current value in System.Windows.Media.Color format | System.Windows.Media.Color |
.GDIColor | Represents the current value in GDI+System.Drawing.Color format | System.Drawing.Color |
GUI type editor
stColor data type underlies a majority of color properties in EventIDE objects. The program provides an dedicated editor for stColor values.
Screenshot of the stColor GUI editor |
Code examples
// Declaration and initialization
// declare a new stColor and initialize its value to the green
stColor MyColor;
MyColor.A=255;
MyColor.R=0;
MyColor.G=255;
MyColor.B=0;
// declare and initialize with the green color with an optional stColor constructors
stColor MyColor2=new stColor(0,255,0);
stColor MyColor3=new stColor(255,0,255,0);
// declare and initialize the blue color with functions and constants of GDI+ API
stColor MyColor3.GDIColor=Color.FromArgb(255,0,0,255);
stColor MyColor4.GDIColor=Color.Blue;
// using stColor type in GDI+ drawing procedures
stColor RedColor=new stColor(127,0,0);
Pen BluePen = new Pen(RedColor.GDIColor, 3);
Graphics.DrawRectangle(BluePen, 0,0,50,50);
// The following examples cause runtime errors because the field values have to be integers in the range 0..255
stColor MyColor=new stColor(0,256,0);
stColor MyColor2;
MyColor2.R=-20;
clPoint
clPoint is a data type for managing screen positions in EventIDE. clPoint is a
data struct that stores a 2D screen position both in cartesian (units: pixels) and polar coordinates (units: visual degrees).
Fields
clPoint contains the following struct fields:
Field Name | Description | Value Type |
---|
.X | Defines the X-Axis value (in pixels) relatively to left-top corner of the screen. | Int32 |
.Y | Defines the Y-Axis value (in pixels) relatively to left-top corner of the screen. | Int32 |
.R | Defines a distance (in visual degrees) between the given point and the screen center,as the radius in the polar coordinate system. The exact pixels/visual degree conversion depends on chosen screen settings for each experiment. | float/Single |
.Theta | Defines a polar angle (in degrees) to the given point from the screen center, as azimuth in the polar coordinate system. The angles (0..360) are counted from the right arm of the horizontal axis in the anticlockwise direction. | float/Single |
.IsNotDefined | Indicates invalid screen point that either was not initialized or it marks invalid screen position. The fields of the invalid screen point can not be accessed. | boolean |
GUI type editor
clPoint data type underlies a majority of coordinates properties in EventIDE objects. The program provides an dedicated editor for clPoint values.
Screenshot of the clPoint GUI editor |
// declare and initialize clPoint type
clPoint MyPoint; // the point is declared but not initialized with values yet and can not be used before an explicit assignment. IsNotDefined field is equal true.
clPoint MyPoint2=new clPoint(0,0); // the point is declared and initialized with pixel coordinates
clPoint MyPoint3=new clPoint(4.0f,45.0f); // the point is declared and initialized with the polar coordinates 4,45
clPoint MyPoint4;
MyPoint4.R=0.0f; // the point is declared and set to the screen center by the zero polar radius
// using clPoint type
clPoint MyPoint; // the point is declared but not initialized with values yet. IsNotDefined field is equal true.
clPoint MyPoint2=new clPoint(0,0); // the point is declared and initialized with pixel coordinates
clPoint MyPoint3;
MyPoint3.R=0.0f; // the point is declared and set to the screen center
clSize
// Check the trial outcome. Result and RT just other user variables
// insert code snippet here..
Enum Types
=== stAlignment ==
// Check the trial outcome. Result and RT just other user variables
// insert code snippet here..
// Check the trial outcome. Result and RT just other user variables
// insert code snippet here..
Final Notes
Insert Notes here..