ToolTipsFactory

Object Model - Common Methods and Functions - SaveLayout

This method saves the current layout of the tooltip component into a file.

[Visual Basic]
Public Sub SaveLayout(ByVal layoutFile As String)
[C#]
public void SaveLayout(string layoutFile);

Parameters

layoutFile

A string that contains the name of the file into which to save the tooltip-layout.

Description

This method saves the current layout of a tooltip-component into a file. The tooltip layout-files created this way correspond to the files created through one of the "ToolTips layout designers". By default, the designer of each of the tooltip components saves the files with it's own extension, but SaveLayout() does not enforce the layout-files for saved component-layouts to have the expected matching extension. Of course it is strongly suggested to follow the naming-convention shown below, but the application programmer (or the end-user of the application) are free to use whatever extension they like.

Component Extension
ToolTipsFactoryAnimation: *.att
ToolTipsFactoryImage: *.itt
ToolTipsFactoryMultiLine: *.mtt
ToolTipsFactorySingleLine: *.stt

 

Tooltip layouts are saved as XML-files, where each property is stored as a key/value-pair (see Listing 1). This makes it possible to "share" layouts between different kinds of tooltips. Layouts saved by SaveLayout() or through one of the "ToolTips layout designers" can be loaded with the LoadLayout()-method.

SaveLayout() will throw exceptions, when one of the typical situations arises when accessing files (FileNotFoundException, ArgumentException etc.). It is up to the application developer to catch and - optionally - handle this exceptions appropriately.

Example

The following code saves a tooltip-layout to file: 

'Save the current layout of the MultiLineToolTip to file...

Me.MultiLine.SaveLayout("C:\Layouts\DeepBlue.mtt")

Listing 1   

This listing shows the XML saved for the layout of a SingleLineToolTip:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ToolTipsFactory>
    <Version>
1.0.0.0</Version>
    <ToolTipsFactoryLayout>
        <AutomaticDelay>
500</AutomaticDelay>
        <AutoPopDelay>
5000</AutoPopDelay>
        <InitialDelay>
500</InitialDelay>
        <DefaultWidth>
80</DefaultWidth>
        <ReshowDelay>
50</ReshowDelay>
        <Transparency>
15</Transparency>
        <BorderLayout>
            <Border>
Normal</Border>
            <BorderWidth>
1</BorderWidth>
            <BorderColor>
                <ColorType>
KnownColor</ColorType>
                <Color>
Goldenrod</Color>
            </BorderColor>
        </BorderLayout>
    </ToolTipsFactoryLayout>
    <SingleLineToolTip>
        <Version>
1.0.0.0</Version>
        <Behaviour>
            <FollowPointer>
True</FollowPointer>
        </Behaviour>
        <ContentLayout>
            <AutoSize>
True</AutoSize>
            <TextStyle>
Solid</TextStyle>
            <Alignment>
Center</Alignment>
            <FontName>
Arial</FontName>
            <FontSize>
12</FontSize>
            <FontUnit>
Point</FontUnit>
            <FontStyle>
Regular</FontStyle>
            <FontColor>
                <ColorType>
KnownColor</ColorType>
                <Color>
DarkGoldenrod</Color>
            </FontColor>
            <FontShadow>
False</FontShadow>
        </ContentLayout>
        <BackgroundLayout>
            <Background>
TextureTakeCenter</Background>
            <BackColor>
                <ColorType>
KnownColor</ColorType>
                <Color>
LemonChiffon</Color>
            </BackColor>
            <BackTexture />
        </BackgroundLayout>
        <SymbolLayout>
            <Symbol />
            <SymbolAlignment>
Left</SymbolAlignment>
        </SymbolLayout>
    </SingleLineToolTip>
</ToolTipsFactory>