Skin Action Plugin

Description

Skin is an action plugin that can be used to apply visual styles to an application created with AutoPlay Media Studio. You will need at least one file in the MSSTYLES format.

Actions

Skin.ApplyStyle(number hWnd, string VisualStyle, string Substyle);

Description:

Loads and applies a visual style to current window and child windows.

hWnd:

(number) Handle to the window to be skinned. You will get this handle with Application.GetWndHandle().

VisualStyle:

(string) The full path to the file with the visual style to be used. For example: ".\\AutoPlay\\Docs\\VisualStyle.msstyles". To revert to the default window appearance, or just to initialize the plugin, leave the field blank ("").

Substyle:

(string) The substyle of the skin to be used. Several skins feature more than one substyle, for different color schemes, and/or different font sizes. If there is only one substyle in the skin, or you want just to load the default appearance, leave this field blank ("").

Returns:

(value) 0 if success, 1 otherwise. You can use Application.GetLastError to determine whether this action failed, and why.

Example:

-- Load and apply a skin
result = Skin.ApplyStyle(hWnd, ".\\AutoPlay\\Docs\\MyOwnSkin.mysstyles", "NormalBlue.ini");

Skin.GetSubstyles(string VisualStyle);

Description:

Retrieves the substyles names from a visual style.

VisualStyle:

(string) The full path to the file with the visual style to be used. For example: ".\\AutoPlay\\Docs\\VisualStyle.msstyles".

Returns:

(table) A table with the names of the available substyles in the skin. You can use Application.GetLastError to determine whether this action failed, and why.

Examples:

substyles = Skin.GetSubstyles(".\\AutoPlay\\Docs\\MyOwnSkin.mysstyles");
if (Table.Count(substyles) > 1) then
    -- several themes in the selected visual style
    for i, name in substyles do
        -- display all the names in a ListBox
        ListBox.AddItem("Substyles", name, i);
    end
end

Skin.GetColor(number ColorId);

Description:

Retrieves the COLORREF value of a component of the current skin.

ColorId:

(number) A number identifying the color index of a skin.

Returns:

(string) A number as hexadecimal string, repesenting the RGB values of the color. You can use Application.GetLastError to determine whether this action failed, and why.

Examples:

-- try to use a matching background color for our window, using a color defined in the skin
-- two of the best matches are: (always check what works best for you)
-- 3 = the menu background color defined in the skin
-- 4 = the window background color defined in the skin
color = Skin.GetColor(4); -- returns the color as string representation of a hexadecimal RGB
tbPageProperties = {}
tbPageProperties.BackgroundColor = Math.HexColorToNumber(color);
Application.SetPageProperties("Page1",tbPageProperties);

 

Error Codes

12011 - Failed to open Skin Actions plugin.
12012 - Could not load skin.
12013 - Could not open skin file.

Change Log

1.0.2.0

1.0.1.0

1.0.0.0

Additional Information

You can use any visual style in the MSSTYLE format. There are thousands of styles available on the internet, but to use them in your product you might need to contact the author before using his work in a commercial application.

MSSTYLES are dynamic link libraries (DLL's), so remember that they can be compressed substantially with certain tools.

Author:

Ulrich Peters
upeters@mindquake.com.br

Copyright:

Plugin is copyright © 2008-2009 MindQuake Serviços de Informática Ltda.

Website:

http://www.mindquake.com.br


Copyright © 2008-2009 MindQuake Serviços de Informática Ltda.
All Rights Reserved.