Group Help File

Group Help File

Plugin Name:

Group

Current Version:

2.0.0.3

Description:

This plugin allows the programmer to make groups of objects and manipulate them.

Original concept by Worm and RizlaUK.

Licence:

Free to use and distribute.

Author:

Centauri Soldier

Web:

www.AMSPublic.com

E-mail:

CentauriSoldier@AMSPublic.com

Copyright:

© 2010 AMSPublic.com

Install Notes:

Place the "Group" folder inside your "AutoPlay Media Studio/Plugins/Actions" folder.


Table of Contents

Group.AddObject
Group.AdjustPos
Group.AdjustSize
Group.ClearSettings
Group.Count
Group.Create
Group.CreateObject
Group.Delete
Group.DeleteInactiveSettings
Group.DeleteObject
Group.DoesExist
Group.Enumerate
Group.GetEnabled
Group.GetGroupNames
Group.GetObjects
Group.GetRectPos
Group.GetRectSize
Group.GetVisible
Group.LoadSettings
Group.Merge
Group.ObjectDoesExist
Group.ObjectIsInGroup
Group.RecallSettings
Group.Remove
Group.RemoveObject
Group.Rename
Group.SaveSettings
Group.SetEnabled
Group.SetPos
Group.SetRectPos
Group.SetSize
Group.SetVisible
Group.StoreSettings
Group.ToggleEnabled
Group.ToggleVisible

Group.AddObject


(number) Group.AddObject ( 

(string) Group = "Group1",

(string) Object = "Image1" )

Description

Adds an object on the page or dialog to the specified group. If the group does not exist, it will be created.

Parameters

Group

(string) The name of the group.

Object

(string) The name of the object to add.

Returns

(number)
Returns 1 if the object is already in the specifed group.

Returns -1 if the object does not exist.

Retuns 0 if the action was successful.


Example

local nRet = Group.AddObject("Group1", "Image1");



Group.AdjustPos


(number) Group.AdjustPos ( 

(string) Group = "Group1",

(number) X = 5,

(number) Y = 5 )

Description

This action adjusts the position of each object in the group by the specified amount.

Note: Set either the X or Y value to 0 to move objects only on the other axis.

Parameters

Group

(string) The name of group.

X

(number) The value to move objects on the X axis.

Note: Set the X value to 0 to move objects on the Y axis only.

Y

(number) The value to move objects on the Y axis.

Note: Set the Y value to 0 to move objects on the X axis only.

Returns

(number)
Returns -2 if the group does not exist.

Returns 0 if the action was successful.


Group.AdjustSize


(number) Group.AdjustSize ( 

(string) Group = "Group1",

(number) Width = 25,

(number) Height = 25 )

Description

This action adjusts the size of each object in the group by the specified amount.

Note: Set either the Width or Height to 0 to change only the other dimension.

Parameters

Group

(string) The name of the group.

Width

(number) The number by which to adjust the width.

Note: Set this to zero to adjust only the height.

Height

(number) The number by which to adjust the height.

Note: Set this to zero to adjust only the width.

Returns

(number)
Returns -2 if the group does not exist.

Returns 0 if the action was successful.


Group.ClearSettings


(number) Group.ClearSettings ( 

(string) Key = "Key1" )

Description

Clears the specified settings bank from memory.

Parameters

Key

(string) The Group Memory Key to clear.

Returns

(number)
Returns -1 if the bank does not exist.

Returns 0 if the action was successful.


Group.Count


(number) Group.Count ( 

(string) Group = "Group1" )

Description

Counts the number of objects in a group.

Parameters

Group

(string) The name of the group.

Returns

(number)
Returns the number of objects in the specified group.

Returns -2 if the group does not exist.


Group.Create


(number) Group.Create ( 

(string) Group = "Group2" )

Description

Manually creates a group. This action is called automatically when an object is created within [Group.CreateObject()] or added to [Group.AddObject()] a group.

Note: Group names are case-sensitive.

Parameters

Group

(string) The name of group.

Note: This action is optional since groups are automatically created when an object is created within or added to a group.

Returns

(number)
Returns 1 if the group already exists.

Returns 0 if the action was successful.


Group.CreateObject


(number) Group.CreateObject ( 

(string) Group = "Group1",

(string) Object = "ListBox1",

(number) Object Type = OBJECT_LISTBOX,

(table) Properties = ListBox_Props )

Description

This performs the same action as Page/DialogEx.CreateObject() as well as adding the newly-created object to the specified group (and also creating the group if it does not exist).

Parameters

Group

(string) The group name.

Object

(string) The name of the object to create.

Note: This name must be unique among objects on the current page/dialog.

Object Type

(number) The type of the object.

Properties

(table) The table containing the object's properties.

Returns

(number)
If and error occurs, the error number is returned.

Returns 0 if the action was successful.


Group.Delete


(number) Group.Delete ( 

(string) Group = "Group1" )

Description

Deletes a group from memory along with all of that group's objects from the page/dialog.

Parameters

Group

(string) The name of group.

Returns

(number)
Returns -2 if the group does not exist.

Returns 0 if the action was successful.


Group.DeleteInactiveSettings


(number) Group.DeleteInactiveSettings ( 

(string) File = "C:\\Group Settings.ini" )

Description

Deletes all sections, from the specified settings file, that reference groups which are no longer in memory.

Parameters

File

(string) The full path to the settings file where group information is stored.

Returns

(number)
Returns -1 if the file does not exist.

Returns 0 if the action was successful.


Group.DeleteObject


(number) Group.DeleteObject ( 

(string) Group = "Group1",

(string) Object = "ListBox1",

(boolean) Remove Group = true )

Description

Deletes an object from the page/dialog and removes it from the specified group (Optionally, the group is deleted if the last object is removed from the group).

Parameters

Group

(string) The name of the group.

Object

(string) The name of the object.

Remove Group

(boolean) Whether or not to remove the group from memory if the listed object is the last in the group.

Returns

(number)
Returns 1 if the object and the group were both deleted.

Returns -1 if the object does not exist.

Returns -2 if the specified group does not exist.

Returns -3 if the object is not in the specified group.

Returns 0 if the action was successful.


Group.DoesExist


(boolean) Group.DoesExist ( 

(string) Group = "Group1" )

Description

Determines whether or not a group exists.

Parameters

Group

(string) The name of the group.

Returns

(boolean)
Returns true if the group exists and false if it does not.


Group.Enumerate


(table) Group.Enumerate ( 

(string) Group = "Group1" )

Description

Gets the group objects and each object's common properties. Use Group.GetObjects() to get a table containing each object's full properties.

Parameters

Group

(string) The name of the group.

Returns

(table)
Returns a table indexed by object names which are subtables containing the object's common properties.
Object subtables are indexed by X, Y, Width, Height, IsEnabled, IsVisible and Type.

Returns nil if there are no objects in the group.

Returns -2 if the group does not exist.


Group.GetEnabled


(boolean) Group.GetEnabled ( 

(string) Group = "Group1" )

Description

Determines whether or not all of the objects in a group are enabled.

Parameters

Group

(string) The name of the group.

Returns

(boolean)
Returns true if all of the group's objects are enabled and false if they are not.

Returns nil if the result is ambiguous (some objects enabled, some not).

Returns -2 if the group does not exist.


Group.GetGroupNames


(table) Group.GetGroupNames ()

Description

Gets all of the groups names of the currently active groups.

Returns

(table)
Returns a numerically-indexed table whose values are the group names.

Returns nil if no groups exist.


Group.GetObjects


(table) Group.GetObjects ( 

(string) Group = "Group1" )

Description

Gets all of the objects within a specified group and their complete properties tables.

Parameters

Group

(string) The name of the group.

Returns

(table)
Returns an numerically-indexed table containing subtables indexed by Object, Type and Properties.

Returns nil if the there are no objects in the group.

Returns -2 if the group does not exist.


Group.GetRectPos


(table) Group.GetRectPos ( 

(string) Group = "Group1" )

Description

Returns the position of the group's two-dimensional rectangle referencing the top-left corner.

Parameters

Group

(string) The name of the group.

Returns

(table)
Returns a table indexed by X and Y.

Returns nil if there are no objects in the group.

Returns -2 if the group does not exist.


Group.GetRectSize


(table) Group.GetRectSize ( 

(string) Group = "Group1" )

Description

Returns the size of the group's two-dimensional rectangle.

Parameters

Group

(string) The name of the group.

Returns

(table)
Returns a table indexed by Width and Height.

Returns nil if there are no objects in the group.

Returns -2 if the group does not exist.


Group.GetVisible


(boolean) Group.GetVisible ( 

(string) Group = "Group1" )

Description

Determines whether or not all of the objects in a group are visible.

Parameters

Group

(string) The name of the group.

Returns

(boolean)
Returns true if all of the group's objects are visible and false if they are not.

Returns nil if the result is ambiguous (some objects visible, some not).

Returns -2 if the group does not exist.


Group.LoadSettings


(number) Group.LoadSettings ( 

(string) Group = "Group1",

(string) File = "C:\\Group Settings.ini" )

Description

Loads and applys settings to a specific group froma group settings file (which is created by Group.SaveSettings()).

Parameters

Group

(string) The name of the group.

File

(string) The full path to the settings file where group information is stored.

Returns

(number)
Returns -2 if the group does not exist.

Returns -3 if the group section in the settings file does not exist or if there are no settings listed in the group's section.

Returns -4 if the specified settings file does not exist.

Returns 0 if the action was successful.


Group.Merge


(number) Group.Merge ( 

(string) Destination Group = "Group1",

(string) Source Group = "Group2" )

Description

Merges one group with another.

Parameters

Destination Group

(string) The group that will receive the other group's obejcts and their properties.

Source Group

(string) The group from which the objects originate,

Note: This group will be removed from memory once the transfer is complete.

Returns

(number) Returns 1 if the group-to-be-imported has no objects.

Returns -2 if either of the groups do not exist.

Returns 0 if the action was successsful.


Group.ObjectDoesExist


(boolean) Group.ObjectDoesExist ( 

(string) Object = "ListBox1" )

Description

Determines whether an object exists on the current page/dialog.

Parameters

Object

(string) The name of the object.

Returns

(boolean) Returns true if the object exists and false if it does not.


Group.ObjectIsInGroup


(boolean) Group.ObjectIsInGroup ( 

(string) Group = "Group1",

(string) Object = "ListBox1" )

Description

Determines whether or not an object is referenced in the specified group's settings.

Note: If, by an external(non-Group Plugin) action, an object is deleted, its reference will still remain in the group's settings. To determine whether or not an object exists on the page/dialog, use Group.ObjectDoesExist().

Parameters

Group

(string) The name of the group.

Object

(string) The name of the object.

Returns

(boolean)
Returns true if the object is referenced in the specified group's settings and false if it is not.

Returns -2 if the group does not exist.


Group.RecallSettings


(number) Group.RecallSettings ( 

(string) Group = "Group1",

(string) Key = "Key1" )

Description

Recalls and applys settings to a specified group from a Group Memory Key created by the Group.StoreSettings() function.

Parameters

Group

(string) The name of the group to which the settings will be applied.

Key

(string) The Group Memory Key from which the settings will be derived.

Returns

(number)
Returns -1 if the specified settings key does not exist.

Returns -2 if the group does not exist.

Returns 0 if the action was successful.


Group.Remove


(number) Group.Remove ( 

(string) Group = "Group2" )

Description

Removes a group and all of its object references from memory.

Note: This action does not delete the objects from the page/dialog. To also delete the objects, use Group.Delete().

Parameters

Group

(string) The name of the group.

Returns

(number)
Returns -2 if the group does not exist.

Returns 0 if the action was successful.


Group.RemoveObject


(number) Group.RemoveObject ( 

(string) Group = "Group1",

(string) Object = "ListBox1",

(boolean) Remove Group = true )

Description

Removes an object's reference from the specified group (Optionally, the group is removed if the last object is removed from the group).

Note: This action does not delete the object from the page/dialog. To also delete the object, use Group.DeleteObject().

Parameters

Group

(string) The name of the group.

Object

(string) The name of the object.

Remove Group

(boolean) Whether or not to remove the group if the listed object is the last in the group.

Returns

(number)
Returns 1 if the object and the group were removed from memory.

Retuns -1 if the object is not in the specified group.

Returns -2 if the group does not exist.

Returns 0 if the action was successful.


Group.Rename


(number) Group.Rename ( 

(string) Group = "Group1",

(string) New Name = "Group5" )

Description

Renames a group.

Parameters

Group

(string) The original name of the group.

New Name

(string) The name by which the group will be referenced hence.

Returns

(number)
Returns -1 if new group name is invalid.

Returns -2 if the group does not exist.

Returns -3 if the new group name references a group that already exists.

Returns 0 if the action was successful.


Group.SaveSettings


(number) Group.SaveSettings ( 

(string) Group = "Group1",

(string) File = "C:\\Group Settings.ini" )

Description

Saves a group and its object settings to a file.

Parameters

Group

(string) The name of the group.

File

(string) The full path to the settings file where group information is stored.

Returns

(number)
Returns -1 if there are no objects in the specified group.

Returns -2 if the group does not exist.

Returns the error number if a problem with file access was encountered.

Returns 0 if the action was successful.


Group.SetEnabled


(number) Group.SetEnabled ( 

(string) Group = "Group1",

(boolean) Enable = false )

Description

Enables or disables all items in the specified group.

Note: This action does not affect Web objects.

Parameters

Group

(string) The name of the group.

Enable

(boolean) Whether or not to enable the group objects.

Note: This action does not affect Web objects.

Returns

(number)
Returns - 2 if the group does not exist.

Returns 0 if the action was successful.


Group.SetPos


(number) Group.SetPos ( 

(string) Group = "Group1",

(number) X = 50,

(number) Y = 50 )

Description

Sets the position of each object in the specified group to the specified coordinates.

Note: Set either the X or Y value to nil to move objects on the other axis only.

Parameters

Group

(string) The name of the group.

X

(number) The value of X the coordinate.

Note: Set the X value to nil to move objects on the Y axis only.

Y

(number) The value of the Y coordinate.

Note: Set the Y value to nil to move objects on the X axis only.

Returns

(number)
Returns -2 if the group does not exist.

Returns 0 if the action was successful.


Group.SetRectPos


(number) Group.SetRectPos ( 

(string) Group = "Group1",

(number) X = 50,

(number) Y = 50 )

Description

Moves the group rectangle to the specified coordinates using the left-most and top-most object as reference.

Note: Use Group.GetRectPos() to get the current position of the group rectangle.

Parameters

Group

(string) The name of the group.

X

(number) The value of the X coordinate.

Note: Set the X value to nil to move the group on the Y axis only.

Y

(number) The value of the Y coordinate.

Note: Set the Y value to nil to move objects on the X axis only.

Returns

(number)
Returns -2 if the group does not exist.

Returns 0 if the action was successful.


Group.SetSize


(number) Group.SetSize ( 

(string) Group = "Group1",

(number) Width = 200,

(number) Height = 75 )

Description

Sets the size of each object in the specified group to the specified size.

Note: Set either the Width or Height to nil to change the other dimension only.

Parameters

Group

(string) The name of the group.

Width

(number) The number in width to set each object in the group.

Note: Set the Width to nil to change the Height only.

Height

(number) The number in height to set each object in the group.

Note: Set the Height to nil to change the Width only.

Returns

(number)
Returns -2 if the group does not exist.

Returns 0 if the action was successful.


Group.SetVisible


(number) Group.SetVisible ( 

(string) Group = "Group1",

(boolean) Make Visible = false )

Description

Set all of the objects in the specified group to visible or not visible.

Parameters

Group

(string) The name of the group

Make Visible

(boolean) Whether or not to make all of the group's objects visible.

Returns

(number)
Returns -2 if the group does not exist.

Returns 0 if the action was successful.


Group.StoreSettings


(number) Group.StoreSettings ( 

(string) Group = "Group1",

(string) Key = "Key1" )

Description

Stores a group and its object references and settings in Group Memory Key which is stored in memory for later recall by the Group.RecallSettings() function.

Parameters

Group

(string) The name of the group.

Key

(string) The Group Memory Key in which to store the settings.

Note: If the key already exists, it will be overwritten.

Returns

(number)
Returns -2 if the group does not exist.

Returns 0 if the action was successful.


Group.ToggleEnabled


(number) Group.ToggleEnabled ( 

(string) Group = "Group1" )

Description

Toggles the enabled status of each individual object in the specified group.

Parameters

Group

(string) The name of the group.

Returns

(number)
Returns -2 if the group does not exist.

Returns 0 if the action was successful.


Group.ToggleVisible


(number) Group.ToggleVisible ()

Description

Toggles the visible status of each individual object in the specified group.

Returns

(number)
Returns -2 if the group does not exist.

Returns 0 if the action was successful.



© 2010 AMSPublic.com
This File Was Generated With AMS ActionFile Editor