ShapeContainer Help File

ShapeContainer Help File

Plugin Name:

ShapeContainer

Current Version:

2.0.0.1

Description:

ShapeContenair Action Plugin will create a container object using shapes (built in object in AMS) which can contain many objects (All kind of object type, Plugin included. Lua scripting knockledge required)

Licence:

Free

Author:

@w

Web:

none

E-mail:

awna@live.fr

Requirements:

This plugin require that you create, at least, Two (2) Objects Shape on the stage (Page or Dialog) of your project and this for each Shape Container that will go to create.
Each Object Shape on your project pages and dialogs must have an unique name (eg: usualy you can have for exemple an object named "Shape1" on multiple page or dialog, with Shape Container each object need to have an unique name and that whether on a page or dialog.)
PS: Setup, before create the ShapeContainer, the properties named: Stroke Size of each object shape.

Copyright:

Copyright @ 2000 - 2011 : All rights reserved too

Install Notes:

Copy folder \ShapeContainer and all its content to your \AutoPlay Media Studio\Plugins\Action folder.


Table of Contents:

   
First Steps

    ShapeContainer - How to

Functions


    ShapeContainer.AddObjects
    ShapeContainer.Create

Lua Scripting 
(Advanced user)

    ShapeContenair - Extended Scripting
    ShapeContainer - Internal Tables and Variables (Extended scripting)

    ShapeContainer - Shortcuts


ShapeContainer - How To

^

"On Startup" Event

startpage = true;
startdialog = true;



"On Show" Event

if startpage then
    -------------------------------------------------------------------
    -- Add here all objects that will be inside the created shape container
    -- The visibility state of each object inside will be managed by each ShapeContainer
    -- If extended scripting will be enabled
    -------------------------------------------------------------------
    startpage = false;
end


"On Preload" Event of each opened DialogEx:

OnPreloadDialogExSetScript()


"On Show" Event of each opened DialogEx:

if startdialog then
    -------------------------------------------------------------------
    -- Add here all objects that will be inside the created shape container
    -- The visibility state of each object inside will be managed by each ShapeContainer
    -- If extended scripting will be enabled
    -------------------------------------------------------------------
    startdialog = false;
end



ShapeContainer.AddObjects

^

(boolean) ShapeContainer.AddObjects ( 

(number) n = 1,

(table) tbl_objects = {"Label1",{20,20},"Label2",{20,40}},

(string) link = "http://www.microsoft.com",

(boolean) msg = false )

Description

This action allow to add existing objects (collapse and expand) into the ShapeContainer. (Objects must exist on the stage: Page or Dialog, you can add them after the creation of ShapeContainer).

THIS ACTION DOES NOT CREATE ANY AMS OBJECTS (except for built in ShapeContenair objects)
( You must create the ShapeContainer before adding AMS objects )

Note: Arguments multiples

Parameters

n

(number) ShapeContainer index (using .Create and begin at 1, default = 0)

Note: Argument must be a valid number (index of ShapeContainer that you created before)
(number) n = 1

tbl_objects

(table) Table of all objects that will be management by the created ShapeContainer

Note: Arguments multiples (string and table)
(table) tbl_objects = {ObjectName, {Lag X, Lag Y}....}
    Where Lag X and Lag Y are based on X:0 and Y:0 of body ShapeContainer
    (PosX, PosY: Arguments from .Create function that you used before add objects).
(table) tbl_objects = {"Label1",{20,20},"Label2",{20,40}....}

link

(string) The link that will be associated with ShapeContainer Title (On Click Event)

Note: Argument must be a valid string (http://...), can be nil but not "" (blank string)
(string) link = "http://www.microsoft.com"

msg

(boolean) Enable or Disable Warning and Infos messages
(PS: When adding objects it update the file ExtendedScript.lua then ShapeContainer need to be restarted when all objects are added to all shape containers)

Note: Argument must be a type boolean
(boolean) msg = false

Value

Description

true

if show warning messages

false

(Default) if do not show warning messages

Returns

(boolean) This action return true if the file ExtendedScipt.lua was updated and false if not.


Example

-- set arguments
SC_Index = 1;
tbl_objects = { "Input1",{20,20},
                "CheckBox1",{20,50},
                "RadioButton1",{20,120},
                "ComboBox1",{20,150}
             }
link = "http://www.microsoft.com";
msg = false;
-- Run function
result = ShapeContainer.AddObjects(SC_Index, tbl_objects, link, msg)


ShapeContainer.Create

^

(boolean) ShapeContainer.Create ( 

(table) tbl_object = {"Shape1", "Shape2"},

(table) tbl_arguments {20, 20, 200, 120, {16777215}, {0}, 0, 0, 1},

(table) tbl_label = {Text="ShapeContainer1", FontName="Time New Roman", FontSize=12, ColorNormal=0},

(boolean) show_button = true,

(string) iicon = "AutoPlay\\Images\\icon.png",

(table) tbl_body_image = {},

(boolean) extended_script = false )

Description

This action will create a shape container

Note: Arguments multiples.

Parameters

tbl_object

(table) The two (2) object shape id (name, label)

Note: Argument must be a type table:
(table: strings)
tbl_object = {Shape1, Shape2}

tbl_arguments

(table) Properties of ShapeContainer Top and Body (both shapes object)

Note: Argument must be a type table:
(table: numbers) 
tbl_arguments (BackColor and StrokeColor are tables, you can set 2 different values on each table but its optional) = {Body Pos X, Body Pos Y, Body Width, Body Height, {BackColor}, {StrokeColor}, BackMode, StrokeMode, ShapeType}
(Top Pos X, Top Pos Y, Top Width and Top Height are based on values of Body Shape and Title font size)

tbl_label

(table) Properties ShapeContainer Label (Title)

Note: Argument must be a type table (All Label properties are available, at least 4 are required):
(table: strings, numbers, booleans)
tbl_label = {Text="ShapeContainer1", FontName="Time New Roman", FontSize=12, ColorNormal=0}

show_button

(boolean) Whether to Show or Hide the Action Button at top right of ShapeContainer (that will collapse or expand the ShapeContainer Body)

Note: Argument must be a type Boolean
(boolean: true or false)
show_button = true

Value

Description

true

(Default) if show action button

false

if hide action button

iicon

(string) The ShapeContainer Image "Icon" Full Path (Located at the ShapeContainer Top Left).
When you click this icon if the ShapeContainer body is collapsed then it will be expanded. (without animation and extended script must be enabled)

Note: Argument must be a type string (PS: ImageFile size must be 16x16 but you can try others)
Recommended: Use always as possible the full path.
(string)
iicon = _SourceFolder.."\\AutoPlay\\Images\\icon.png" or "AutoPlay\\Images\\icon.png"

tbl_body_image

(table) The ShapeContainer Body Picture (All ImageProperties are available; see built in image object table in ams).
    PS: Default = {} -> Dont use body image.

Note: Argument must be a type table
(table: strings, numbers, booleans)
tbl_body_image = {All ImageProperties are available};

extended_script

(boolean) Enable or Disable Extended Lua Scripting with ShapeContainer

Note: Argument must be a type boolean
PS: See at the bottom: Content of Extended Scripting
(boolean: true or false)
extended_script = false

Value

Description

true

if use Extended scripting (script must be located in the project scripts folder)

false

(Default) if dont use Extended scripting.

Returns

(boolean) This action return true if the ShapeContainer was created sucessfuly and false if not.


Example

-- ARGUMENTS:
-- tbl_object: {Shape1, Shape2}
-- tbl_arguments: {posX, posY, Width, Height, back_color, stroke_color, back_mode, stroke_mode, type}
-- tb_label: {text, fontname, fontsize, fontcolor} -- at least but all label props are available
-- show_button: Whether show or hide the Action panel button, default = false
-- iicon: Full path to icon picture (recommended picture size: 16x16)
-- tbl_body_image: { All table images properties can be used }
-- extended_script: Whether Use or not Extended Scripting Function.

-- Exemple:
tbl_object = {"TOPA", "BODYA"};
posX, posY = 30, 40;
Width, Height = 200, 100;
back_color, stroke_color = 11206655, 0;
back_mode, stroke_mode = 1, 0;
shtype = 1;
tbl_arguments = { posX, posY, Width, Height, back_color, stroke_color, back_mode, stroke_mode, shtype };
tbl_label = {Text="ShapeContainer", FontName="Constantia", FontSize=10, ColorNormal=255};
iicon = "AutoPlay\\Images\\icon.png";
tbl_body_image = {};  -- Dont use body image
extended_script = true;  -- Default is false;
    
result = ShapeContainer.Create (tbl_object, tbl_arguments, tbl_label, true, iicon, tbl_body_image, true)


ShapeContainer - Extended Scripting

^

Description:


    - true, 
to enable functions:
        - Collapse or expand Shape container
        - Move Shape container
        - Use link title

     - false, to disable functions:
        - All functions above are disabled.


ShapeContainer - Shortcuts (Hands and feet)

^

ShortcutsDescriptions (Press this keys at startup)
CTRL + SHIFT
CTRL + SHIFT + ALT
SHIFT + ALT
CTRL + ALT

CTRL + Left Mouse Button


(MOST POWER FULL SHORTCUT:)
CTRL+SHIFT+ALT+P+Left Mouse Button
- Enable Debug Dialog Mode (to disable restart is required, Usefull to know built in object name)
- Create DEL file to block extended scripting functions (ExtendedScipt.lua will not be deleted)
- Re Enable extended scripting after it been blocked by (CTRL+SHIFT+ALT), Delete DEL file.
- Delete ExtendedScript.lua and Block futur Extended scripting function, creating DEL file.

- Selecting a ShapeContainer, This will move the Shape Container on the main window.
(ShapeContainer's Position will not be saved at shutdown).

- For This you need 2 hands and 1 feet - LOL its a shortcuts joke...


ShapeContainer - Tables and Variables

^

ALL THIS STUFF ARE SHOWED IN THE FIRST GOAL OF:
TO NOT RE USE OR DUPLICATE
VARIABLES, TABLES OR FUNCTIONS NAMES


Main Function TableDescription
ShapeContainer = {};Main function of ShapeContainer Action Plugin (to extend functionality).


TablesDescriptions (for each ShapeContainer where first index is n (SC) for each table)
TB_TOP = {};
TB_BODY = {};
TB_IMA_BODY = {};
TB_ICON = {};
TB_TITLE = {};
TB_MENUS = {};
TB_IDX = {};
TB_WIDTH = {};
TB_HEIGHT = {};
TB_STATES = {};
TB_URL = {};
TB_GROUP = {};
TB_GROUP_X = {};
TB_GROUP_Y = {};
TB_GROUP_WIDTH  = {};
TB_GROUP_HEIGHT = {};
TB_SC_CONTENTS  = {};
TB_EXTENDED_LUA = {};
TBL_PLUGIN         = {};    
-- table of top shape id (name, label)
-- table of body shape id (name, label)
-- table of body image (properties)
-- table of icon image (properties)
-- table of title (text label)
-- table of image action to open close SC (properties)
-- table of index of each SCAP (begin at 1)
-- table of all WIDTH's of each SCAP ( REF. shape BODY )
-- table of all HEIGHT's of each SCAP ( REF. shape BODY )
-- table of all states of each SCAP (open or close)
-- table of all url title for each SCAP (optional, extended script)
-- table of all content of each SCAP (move each SC on stage with mouse clicked and ctrl key pressed)
-- table of all X position of each built in object of SCAP
-- table of all Y position of each built in object of SCAP
-- table of all WIDTH of each object of SCAP (content object, external not built in by SCAP)
-- table of all HEIGHT of each object of SCAP (content object, external not built in by SCAP)
-- table of all content object of each SCAP (content object, external not built in by SCAP)
-- table to store ExtendedScript.lua content
-- table to store all enumerated object of current stage (page or dialog)

VariablesDescriptions
b_DEFAULT_IMAGES = false;    
b_DEBUG_THIS = false;    
TBL_PLUGIN = {};        
tDisplay = System.GetDisplayInfo();
nWidth_Screen = tDisplay.Width;
nHeight_Screen = tDisplay.Height;
nWidth_App = 0;        
nHeight_App = 0;        
nCountSC = 0;        
sLabel = "";        
extended_script = false;    
b_MOVE_SC = false;    
n_CURRENT_SC = 0;        
-- store if exist default images (open, close, icon)
-- show added variables to tables index of SCAP
-- table to store all enumerated object of current stage (page or dialog)
-- Get display size
-- Set display width variable
-- Set display height variable
-- width of window application
-- height of window application
-- global counter (used to index each SCAP)
-- sub variable to store current label title of SCAP
-- enable or disable extended scripting (default= disable)
-- enable or disable moving SCAP
-- current active SCAP (body shape)

Built-in TablesDescriptions
tbl_label_props
tbl_image_props
tbl_icon_props
tbl_body_props
tbl_mouse_props
-- Title (label) properties table
-- Action image properties table (top right of SCAP)
-- Icon image properties table (top left of SCAP)
-- Body image properties table (body of each SCAP)
-- Mous image properties table (sweet image icon when moving a SCAP)

Built-in FunctionsDescriptions
SC_CheckImage ()
SetLabel()
SetImage()
SetIcn()
SetBody()
SetMousePic()
SC_ExtractObjectPlugin ()
SC_CreateImageObject ()
SC_CreateIconObject ()
SC_CreateBodyObject ()
SC_CreateMouseObject ()
SC_CreateLabelObject ()
SC_SetImageProperties ()
SC_SetLabelProperties ()
SC_EnumerateAllObjectsOnPage ()
SC_EnumerateAllObjectsOnDialog ()
SC_MoveShapeContainer ()
SC_CollectAllObjectsDataNameSizeAndPos ()
SC_MouseMove()
SC_GetWindowSize ()
SC_DebugObjectsNameSizePos ()
OnPreloadDialogExSetScript ()
IsIcon ()
GetCurrentStage ()
SC_GlobalCounterIsNull ()
SC_ifExistObjectsAskToReplace ()
SC_ReadExtendedScriptLua ()
SC_GetUniqueIDCount ()
SC_BuildContentData ()
SC_InsertReplaceObjectsContent ()
SC_SetObjectsContentVisibility ()
SC_RemoveShowContent ()
SC_BuildShowContent ()
SC_RemoveHideContent ()
SC_BuildHideContent ()
SC_RemoveLinkContent ()

* Other functions are built inside the main function:
[ ShapeContainer.Create() ] and destroyed:
at the end of this main function.
Dont modify or use this function names in your project.
This function are showed only to secure you to not repeat function names.
Arguments of theses functions are not showed.



Copyright @ 2000 - 2011 : All rights reserved too
This File Was Generated With AMS ActionFile Editor