Object Help File

Object Help File

Plugin Name:

Object

Current Version:

1.0.0.3

Description:

A L-OOP model for all standard AMS Visual Object's actions.

Author:

Imagine Programming

Web:

www.imagine-programming.com

E-mail:

contact@imagine-programming.com

Copyright:

© Imagine Programming, 2010.


Table of Contents

Object:Create
Object:Append
Object:SetAppendDelimiter
Object:GetRect
Object:SetRect
Object:Center
Object:CenterRelative
Object:ToggleEnabled
Object:ToggleVisible
Object:Destroy
Grid.GetCellState
Object:RestoreOriginalRect

Object:Create


(table) Object:Create ( 

(string) Objectname,

(table) Propertiestable,

(number) Objecttype )

Description

Creates a new L-OOP Object for an AMS visual object.

Note: This method can not be used as method for L-OOP objects

Parameters

Objectname

(string) The object name to create a handle for.

Propertiestable

(table) When the Object given doesn't exist, create it on the fly!

Note: An object type is requried now too!

Objecttype

(number) Objecttype for the to be created object.

CONSTANT

VALUE

DESCRIPTION

OBJECT_BUTTON

0

NA

OBJECT_LABEL

1

NA

OBJECT_PARAGRAPH

2

NA

OBJECT_IMAGE

3

NA

OBJECT_FLASH

4

NA

OBJECT_VIDEO

5

NA

OBJECT_WEB

6

NA

OBJECT_INPUT

7

NA

OBJECT_HOTSPOT

8

NA

OBJECT_LISTBOX

9

NA

OBJECT_COMBOBOX

10

NA

OBJECT_PROGRESS

11

NA

OBJECT_TREE

12

NA

OBJECT_RADIOBUTTON

13

NA

OBJECT_RICHTEXT

14

NA

OBJECT_CHECKBOX

15

NA

OBJECT_SLIDESHOW

16

NA

OBJECT_GRID

17

NA

Returns

(table) This will return a handle/object for the Object class.

With this object, you can preform any action available
in the AMS Object's actionlist.


Example

Input1 = Object:Create("Input1") --it exists, so no properties table and objecttype have to be passed.

Input1:SetText("Hello World!");
Input1:Append("Greets from Imagine Programming!","\r\n");
Input1:Destroy();



Object:Append


Object:Append ( 

(string) Text,

(string) Delimiter )

Description

Append text to the object's text

Parameters

Text

(string) The text to append

Delimiter

(string) The custom delimiter, if you don't use the default one you can set.

Returns

This action dose not return any value.


Example

Input1:Append("This is a string, which will append using the defailt delimiter");
Input1:Append("This string will be appended using a custom delimiter", "\r\n\r\n");



Object:SetAppendDelimiter


Object:SetAppendDelimiter ( 

(string) Delimiter )

Description

Set's the default 'Append' delimiter for Object:Append();

Note: The AppendDelimiter is unique for each object handle!

Parameters

Delimiter

(string) The default delimiter for Object:Append();

Returns

This action dose not return any value.


Example

Input1:SetAppendDelimiter("\r\n\r\n");
Input1:SetText("First line");
Input1:Append("Second line of text using the newly set delimiter");
Input1:Append("Third line of text using only one newrule", "\r\n");



Object:GetRect


(table) Object:GetRect ()

Description

Get the position and size of an object.

Returns

(table) This function will return a table containing the next entrys:

Result.X = Position from the left in pixels
Result.Y = Position from the top in pixels
Result.Width = The width of the object in pixels
Result.Height = The height of the object in pixels


Example

Par1 = Object:Create("Paragraph1");
local oldRect = Par1:GetRect();
oldRect.X = oldRect.X+10;
oldRect.Y = oldRect.Y+10;
Par1:SetRect(oldRect); -- you can also pass the rect as 4 seperate values, see the helpfile on this function.



Object:SetRect


Object:SetRect ( 

(number) Position_X (Or the RectTable),

(number) Position_Y,

(number) Size_Width,

(number) Size_Height )

Description

Set the size and position of an object.

Parameters

Position_X (Or the RectTable)

(number) The position from the left, leave nil for old position.

Note: You can parse a Rect table aswell, {X=0,Y=0,Width=100,Height=200} is an example of a RectTable

Position_Y

(number) The position from the top, leave nil for old position.

Size_Width

(number) The width of the object, leave nil for old size.

Size_Height

(number) The height of the object, leave nil for old size.

Returns

This action dose not return any value.


Example

-- Example 1
Par1 = Object:Create("Paragraph1");
local oldRect = Par1:GetRect();
oldRect.X = oldRect.X+10;
oldRect.Y = oldRect.Y+10;
Par1:SetRect(oldRect); -- you can also pass the rect as 4 seperate values, see the helpfile on this function.

-- Example 2, as from the Par1:SetRect line in first example
Par1:SetRect(oldRect.X+10,oldRect.Y+10,oldRect.Width-10,oldRect.Height-10);

-- Example 3, ignore fields, they stay what they were.
Par1:SetRect(oldRect.X+10,nil,oldRect.Width-10,nil);



Object:Center


Object:Center ( 

(number) Windowhandle = Application.GetWndHandle() )

Description

Center an object on the page.

Parameters

Windowhandle

(number) A valid window handle, the handle of the window this object's on.

Note: This is required, so the object can be centered on the window/dialog.

Returns

This action dose not return any value.


Example

Par1:Center(Application.GetWndHandle());



Object:CenterRelative


Object:CenterRelative ( 

(string) Parent Object )

Description

Center an object onto another object

Parameters

Parent Object

(string) The object to center this object on.

Returns

This action dose not return any value.


Example

Par1:CenterRelative("Paragraph2");



Object:ToggleEnabled


Object:ToggleEnabled ()

Description

Toggles the enabled state for an object

Returns

This action dose not return any value.


Object:ToggleVisible


Object:ToggleVisible ()

Description

Toggles the visible state for an object

Returns

This action dose not return any value.


Object:Destroy


Object:Destroy ( 

(boolean) RemoveObject = false )

Description

Destroys the handle for the object.

Parameters

RemoveObject

(boolean) Removes object from the Page/DialogEx

Returns

This action dose not return any value.


Grid.GetCellState


Grid.GetCellState ( 

(string) Object Name = "",

(number) Row,

(number) Column )

Description

Returns a table containing the state of a cell.

Note: This is also in the Object Action Plugin, Object:GetCellState

Parameters

Object Name

(string) The object name of the grid object.

Row

(number) The row

Column

(number) The column

Returns

This action dose not return any value.


Object:RestoreOriginalRect


Object:RestoreOriginalRect ()

Description

Restores the initial position and size for an object.

Note: This would be the position and size from the time Object:Create was called for this object.

Returns

This action dose not return any value.



© Imagine Programming, 2010.
This File Was Generated With AMS ActionFile Editor