TiComponent.LoadThemes

TiComponent See Also

Loads all Themes for this component from disk into memory.

procedure
LoadThemes();

Description

Call LoadThemes to load all themes for this component from disk into memory. This procedure must be called before utilizing the other Theme methods.

Theme files store pre-setup configurations for a component. Each theme is made up of a collection of "schemes", such as "Color Scheme" or "User Interface Scheme". Each scheme will modify only those properties of the component that pertain to the scheme. For example, the "Color Scheme" only stores configurations that modify the color properties of the compoents. Think of themes as categorized collections of properties that affect the look and feel of the component. Themes will never modify the main property of the component such as the "Value" or "Position" properties.

Generally Themes are ony used at design-time with our own property editors, but you can utilize them at runtime by calling LoadThemes and then using several theme methods for applying themes as needed.

If you wish to simply save out all properties of the component into one file for later loading, consider using the SavePropertiesToFile and LoadPropertiesFromFile methods instead.

Theme files are loaded according to the following, depending on your operating system…

Windows

System-Wide Themes:

These are themes settings that apply to all users on the machine, no matter which user profile is used.

Copy theme files (they are initially installed in c:\iocomp\product\themes, but you can copy them to any directory on your user's computer) to a directory of your choice.

Set the following registry keys to point to this directory. You can look in your local Windows registry for a sample...

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Iocomp\Themes

String Value: "USER DEFINED THEME PATH" = "C:\Your Directory"

String Value: "IOCOMP DEFINED THEME PATH" = "C:\Your Directory"

You can have different paths for Iocomp Defined Themes or for User Defined Themes if you wish. The User Defined Theme Path will need to be write-enabled for users if you allow them to save user themes.

User-Specific Themes:

These are themes settings that apply to a particular user.

Copy theme files (they are initially installed in c:\iocomp\product\themes, but you can copy them to any directory on your user's computer) to a directory of your choice.

Set the following registry keys to point to this directory. You can look in your local Windows registry for a sample...

Key: HKEY_CURRENT_USER\SOFTWARE\Iocomp\Themes

String Value: "USER DEFINED THEME PATH" = "C:\Your Directory"

String Value: "IOCOMP DEFINED THEME PATH" = "C:\Your Directory"

Note that if the above keys exist for the current user, those settings will override the settings located in HKEY_LOCAL_MACHINE.

You can have different paths for Iocomp Defined Themes or for User Defined Themes if you wish. The User Defined Theme Path will need to be write-enabled for users if you allow them to save user themes.

Creating Your Own Preset Themes:

To create your own preset themes, you will need to do the following...

Create user themes on your system to your liking. When you save User themes on your development system, the file created is named iComponentNameUser.xml (for example, the Angular Gauge filename would be iAngularGaugeUser.xml).

Copy the user theme files (iComponentNameUser.xml) files to the location specified in the registry settings discussed above. Remove the word "User" from the file name for each component. This will turn theme file into

Linux

Themes are not yet enabled on the CLX version of our components running under Linux. CLX components under Windows currently use the Windows registry. A future version will allow the CLX version (both Windows and Linux) to utilize INI files which will contain similar information as presented above.

Example

Delphi/Kylix

iComponent.LoadThemes; //Load All Themes for this component

C++ Builder

iComponent->LoadThemes(); //Load All Themes for this component

Contents | Index | Previous | Next