Object Constants

Top  Previous  Next

ObjectX(ObjectLabel)

returns X (horizontal) position of specified object

Position retrieving starts from upper-left corner of project's window.

Returned position represents object's upper-left corner.

Specifying of object you want position for is done through label inside parenthesis.

For example: ObjectX(Button)

ConstantObjectX

Script example:

Message("Current object X position: ","ObjectX(Button)")

Script line above will retrieve upper-left corner X position of object labeled "Button"

 

ObjectY(ObjectLabel)

returns Y (vertical) position of specified object

Position retrieving starts from upper-left corner of project's window.

Returned position represents object's upper-left corner.

Specifying of object you want position for is done through label inside parenthesis.

For example: ObjectY(Button)

ConstantObjectY

Script example:

Message("Current object Y position: ","ObjectY(Button)")

Script line above will retrieve upper-left corner Y position of object labeled "Button"

 

ObjectWidth(ObjectLabel)

returns width of specified object in pixels

Width retrieving starts from object's upper-left corner

Specifying of object you want width for is done through label inside parenthesis.

For example: ObjectWidth(Button)

ConstantObjectWidth

Script example:

Message("Button width is: ","ObjectWidth(Button)")

Script line above will retrieve width of object labeled "Button"

 

ObjectHeight(ObjectLabel)

returns height of specified object in pixels

Height retrieving starts from object's upper-left corner

Specifying of object you want height for is done through label inside parenthesis.

For example: ObjectHeight(Button)

ConstantObjectHeight

Script example:

Message("Button height is: ","ObjectHeight(Button)")

Script line above will retrieve height of object labeled "Button"

 

CurrentObject()

returns name of current object from which is this function called.

Script example:

obj$=CurrentObject()

Message("Current object name: ","obj$")

For example, if this function is placed in object called "TextBTN", it will return "TextBTN" string. It's good mainly in case you want copy/paste an object multiple times, especially if there is reference to a current object inside the script.

 

IsVisible(ObjectLabel)

this constant will check if specified object exists on current page and is it visible or hidden

Integer value is returned, having one of three available states:

-1 = object doesn't exist on current page

 0 = object is hidden

 1 = object is visible

Specifying of object you want status for is done through label inside parenthesis.

Script example:

Message("Object status : ","IsVisible(Button)")

Example above will check if object labeled "Button" exists and is it visible or hidden.

If object doesn't exist, message box will display "-1".

 

ImageScrollX(ObjectLabel)

returns X position of left/top point of the image inside the Image object.

This is useful in case if image inside the Image object is bigger/smaller than Image object itself and it's scrollable inside the Image object ("Keep Actual Image Size" option must be enabled).

ImageScrollX returns negative values if left/top corner of the image object is out of the visible area of the Image object.

ImageScrollX

Script example:

Message("X position of Bitmap is: ","ImageScrollX(Bitmap)")

Script line above will retrieve X position of Left/Top corner of Bitmap.

 

ImageScrollY(ObjectLabel)

returns Y position of left/top point of the image inside the Image object.

This is useful in case if image inside the Image object is bigger/smaller than Image object itself and it's scrollable inside the Image object ("Keep Actual Image Size" option must be enabled).

ImageScrollY returns negative values if left/top corner of the image object is out of the visible area of the Image object.

ImageScrollY

Script example:

Message("Y position of Bitmap is: ","ImageScrollY(Bitmap)")

Script line above will retrieve Y position of Left/Top corner of Bitmap.

 

ImageWidth(ObjectLabel)

returns full width of image in pixels.

While ObjectWidth returns width of the object, ImageWidth returns width of entire Image, even if some parts of Image are invisible (because image is bigger than Image object).

Specifying of image you want width for is done through label inside parenthesis.

For example: ImageWidth(Bitmap)

ImageWidth

Script example:

Message("Image width is: ","ImageWidth(Bitmap)")

Script line above will retrieve width of image labeled "Bitmap"

 

ImageHeight(ObjectLabel)

returns full height of image in pixels.

While ObjectHeight returns height of the object, ImageHeight returns height of entire Image, even if some parts of Image are invisible (because image is bigger than Image object).

Specifying of image you want height for is done through label inside parenthesis.

For example: ImageHeight(Bitmap)

ImageHeight

Script example:

Message("Image height is: ","ImageHeight(Bitmap)")

Script line above will retrieve height of image labeled "Bitmap"

 

GetImageOpacity(ObjectLabel)

returns current opacity of a given Bitmap object.

The ImageOpacity can be set both in a design time (via Bitmap properties dialog) or runtime (via ImageOpacity command).

Script example:

obj=ImageOpacity(Bitmap)

Message("Current opacity:","obj")

 

ScrollBarSize(ObjectLabel)

returns width (if ScrollBar is vertical) or height (if ScrollBar is horizontal) of image ScrollBar in pixels.

It's useful in cases when ScrollBar in Image object is enabled and you want to know the size of Image object including the ScrollBars. ScollBar size can be different on various OS.

Script example:

Message("Image ScrollBar height is: ","ScrollBarSize(Bitmap)")

Script line above will retrieve size of ScrollBar from image object labeled "Bitmap"

 

GetVideoParam(ObjectLabel)

returns the current state (0/1 = OFF/ON) of a given video parameter:

fullscreen

FullScreen mode is enabled (1) or disabled (0)

loop

Loop is enabled (1) or disabled (0)

mute

Sound is enabled (1) or disabled (0)

time

Video is switched to Time mode (1).

0 = Video is in frame mode

frame

Video is switched to Frame mode (1)

0 = Video is in time mode

Script example:

GetVideoState=GetVideoParam(Video, fullscreen)

returns 0 or 1 according the current state of Video screen

GetVideoState=GetVideoParam(Video, mute)

returns 0 or 1 if the audio Mute is disabled/enabled