Component is designed for centralized management of program skinning process. For work of this component is enough to define a skin and set the Active property to True.
There are two ways of skins deploying with the application :
These two ways may be used together also. If external skin is not found, then first internal skin will be loaded automatically in this case.
Component is active only when the Active property is enabled. Please note, if a loading of skin fails (for example, if the skin is not selected), then Active property is changed to False automatically and program will have a standard look.
The AnimEffects structure contains a set of animation settings for different events:
Before running of animation effect the image in memory is created. This feature may be useful even if animation is not used. For example, if a form contains a lot of controls and showing of this form is slow, you can set the animation time to 0, Active to True. Then the whole image will be produced in the memory, and the form will appear almost instantly.
Note that FormShow animation will work better if the TsSkinProvider component was placed on form in design-time.
The CommonSections property allows add new sections to the skin in real-time. If new section is defined in this property, then this section will be automatically added to each applied skin. For example, we need a white panel in the each applied skin, but borders should be inherited from the "PANEL" section of this skin. Then we should open CommonSections and add such section there:
Now it is sufficient in the panel or in other control to change the SkinData.SkinSection property to "PANEL_WHITE" and component will have a new look.
Example of the CommonStyle property using may be downloaded there.
Effects contains properties that controls a set of special effects that are available in the skin:
The ExtendedBorders enables a using of extra borders in forms and dialogs of application. Usually these additional borders are used for adding of shadows to forms, but they can implement and other effects also.
HUEOffset specifies an offset of color palette in all skin. Below are screenshots of window where HUEOffset is 0 and 80.
InternalSkins contains skins, embedded in Exe. Adding skins produced in the design-time with using a special dialog. Number of skins that can be embedded in Exe, is not limited, but a large number of built-skins can greatly increase the size of executable file. The "Update all" button allow to update all internal skins in design-time by a single click. A source directory with newer versions of skins is shown as "External location" in the upper left corner of the dialog.
The IsDefault property determines a skin manager which will be default for all application (DefaultManager). If application has defined several skin managers, then DefaultManager will be used for skinning of dialogs, as well as for all forms and controls which do not have a manager specially defined in the SkinData.SkinManager property. DefaultManager always the first to be created, or the first created by the manager will be a key.
The MenuSupport structure allow to control a process of the popup menus skinning.
Saturation - sets the saturation of current skin on the entire application. Below are screenshots of window where Saturation is -100 and 100.
SkinDirectory - directory where component should look for external skins. If used embedded skins only, this property may be not defined.
SkinInfo stores information about the active skin.
SkinName specifies a skin which should be activated. Name of skin should be specified without a file extension.
SkinnedPopups disables a skinning of menus. If this property is False, then menus will be drawn by windows system.
SkinningRules contains some rules of the application skinning.
The ThirdParty list contains rules of a skin applying for standard and third-party controls. Skinning of standard and third-party controls works only when SkinningRules.srThirdParty is True è and form is skinned (it is desirable to place the TsSkinProvider component on this form in design).
A special property-editor used for a changing of this list in design-time. At the left is a list of types which should be skinned. It's possible to add all items manually by using of bottom toolbar. But may be used a special lists with predefined sets of components, which is on the right. Please note, that names of types are case-sensitive there.
The Version property stores the current version of the package.
OnActivate occurs immediately after a component activation.
OnAfterChange occurs after changing of the current skin.
OnBeforeChange occurs before changing of the current skin.
OnDeactivate occurs after a skins deactivation.
OnGetMenuExtraLine called before a drawing of the popup menu, if MenuSupport.UseExtraLine property is active. Additional left vertical line will be drawn if LineVisible parameter is True. FirstItem parameter points to the first menu item for this popup menu. Focusing on this option you can enable or disable the extra line, also may be defined such parameters as SkinSection, Caption, and Glyph. Example of handling of this event may be found in ASkinDemo and ASLDemo.
The OnGetPopupItemData event occurs before a drawing of popup menu and allow to define a font for an each menu item.
OnSkinListChanged occurs when a list of internal skins is changed and when SkinDirectory property is changed.
OnSysDlgInit occurs when a system dialog is opened, and contains such parameters as window Handle and AllowSkinning. The event allows to disable a skinning of custom dialog.
Installing, using and licensing the demo programs © Serge Goncharov, 2004-2016