|
|
|
Tooltips are descriptive messages that are displayed near the cursor when it hovers over a toolbar or panel button, or menu item.
The Description property associated to a command provides a simple description for what the command does. The value of the Description property is displayed as part of a basic tooltip that is displayed when the cursor hovers over a button on a toolbar, ribbon panel, or menu browser. Along with the description, a command tooltip also displays the name of the command, and the values assigned to the Command Display Name and Tags properties.
Additionally, a command can be assigned an extended help file and ID so it can display a second level of information for the command. The content from the extended help file is displayed in the extended description area of a tooltip. The content for the extended description area of a tooltip is stored in an XAML file, and can contain rich-text and images.
Control the Display of Tooltips
You control the display of tooltips and when
the extended help assigned to a command is displayed from the Options
dialog box. See
The XAML structure is a format that was developed by Microsoft. The following is an example of what an XAML file might look like for two custom commands that exist in your CUI file.
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows">
<src:ProgressivePanel x:Key="MYEH_CMD_0001">
<StackPanel>
<TextBlock Background="AntiqueWhite" TextAlignment="Center">
Creates a rectangular revision cloud on the <Bold>REVISION</Bold> layer.
</TextBlock>
<Image Source="images/rectcloud.jpg" Width="Auto" Height="Auto">
</Image>
</StackPanel>
</src:ProgressivePanel>
<src:ProgressivePanel x:Key="MYEH_CMD_0002">
<StackPanel>
<TextBlock Background="Yellow" TextAlignment="Left">
Creates a polygonal revision cloud on the
<Run Text=" REVISION " Foreground="Red" FontStyle="Italic"/>
layer.
</TextBlock>
<Image Source="images/rectcloud.jpg" Width="Auto" Height="Auto">
</Image>
</StackPanel>
</src:ProgressivePanel>
</ResourceDictionary>
The ResourceDictionary element is used to define the type of content that is in the XAML file; while the scr:ProgressivePanel element is used to define each of the extended help topics in the file. In the previous example there are two different extended help topics, and they are uniquely defined by the keys MYEH_CMD_0001 and MYEH_CMD_0002. The Stack Panel element groups the TextBlock and Image elements together. You can have as many TextBlock and Image elements under a StackPanel element that you need. The TextBlock element holds the text; the Image element holds an illustration that is part of the extended help. To learn more about XAML, visit Microsoft’s web site at http://www.microsoft.com and perform a search for XAML.
-
To add a tooltip to a command (Procedure)
-
To add extended help to a command (Procedure)
-
To create an XAML file (Procedure)