EnumerateSkins - cCJSkinFramework
Searches a directory path and returns an array of all skin files and skin sections
Type: Function
Return Data Type: tSkinInformation[]
Parameters
| Parameter | Type | Description |
|---|---|---|
| sPath | String | The directory to search for skin files. If "", the default skin path is searched |
| bRecursive | Boolean | If true, sub-directories are also searched |
Syntax
Function EnumerateSkins String sPath Boolean bRecursive Returns tSkinInformation[]
Call Example
Get EnumerateSkins sPath bRecursive to tSkinInformation[]Variable
Description
EnumerateSkins searches a directory path and to returns an array of all skins and skin sections. This array can be used to determine what skins are available.
The sPath parameter determines which path to search. If sPath is "", the default skin directory will be searched. The default directory is determined by calling SkinPath. Unless this function is changed, the default path is the workspace's programs directory.
The bRecursive detertmines if the search should search sub-directories.
EnumerateSkins returns an array of tSkinInformation. tSkinInformation is a struct defined as:
| tSkinInformation Element | Description |
|---|---|
| sName | The name/description of the Skin file |
| sSkinFile | The file name and path of the skin file. This will be a relative path if the file is located under the default skin directory, else a qualified path. |
| sSkinIni | The name of the skin section within the file |
The following example loads all skins from the default skin directory. It then displays all of the skins by calling AddSkin for each skin. Finally it applies the first skin as the default skin.
Procedure LoadSkinsAndApplyFirst
Integer i iSkinsCount
tSkinInformation[] Skins
// get all skins in the default skin path
Get EnumerateSkins of ghoSkinFramework "" True to Skins
// Display all of the skin information
Move (SizeOfArray(Skins)) to iSkinsCount
For i from 0 to (iSkinsCount-1)
Send AddSkinsToList Skins[i].sName Skins[i].sSkinFile Skins[i].sSkinIni
Loop
// make the first skin the current skin
If (iSkinsCount=0) Begin // if no skin, apply an empty skin (no skin will be applied)
Set psSkinFile to ""
Set psSkinIni to ""
End
Else Begin
Set psSkinFile to Skins[0].sSkinFile
Set psSkinIni to Skins[0].sSkinIni
End
Send ApplySkin of ghoSkinFramework
End_Procedure
See Also
SkinPath | ApplySkin | psSkinFile | psSkinIni
Return Value
Returns an array of tSkinInformation, representing all skins files and sections found