DirectSkin includes support for
skinning using more than one skin at a time. Please note that
secondary skins should not be used to change the global application
skin. This is done with the LoadUIS
method. The secondary skins features can be
very powerful, but also dangerous if used incorrectly. For
example, it is ok to skin different controls with different skins in
some situations, but it is a bad idea to skin several buttons in one
window with different skins. Secondary skinning internally uses
a table system that is will keep track of up to 64 skins. This table
is referred to by the secondary skin methods with an index. This
index is 0 based, so indexes 0 to 63 are available. It is
important to note that in the index, item 2 is used during ShowPreview
to load a skin for preview. This means that
secondary skinning is really maxed out at 63 secondary skins, with one
additional slot (index 2) available for temporary use when the ShowPreview
method is not in use.
- The following methods are
used for secondary skinning:
- AddPerWindowSkin
- DestroySecondarySkin
- LoadSecondarySkin
- LoadSecondarySkin2
- RemovePerWindowSkin
First, a secondary skin will need to be loaded using
either LoadSecondarySkin or LoadSecondarySkin2.
It is best to keep track of the index for de-allocation of the skin
later. Then, apply the secondary skin using AddPerWindowSkin.
If the window will always have this skin, this should be done before
the window is shown. The control is now using the secondary skin
rather than the global skin. Please note that skin exclusion
and inclusion still applies. Before destroying a control, it
is wise to use RemovePerWindowSkin
on it. If a skin is no longer in use, it will need to be
destroyed using the DestroySecondarySkin
method.
|