This AutoCAD Team Tip is from Randall "Randy" Young who is on the AutoCAD QA Team.
According to Wikipedia “The tooltip is a common graphical user interface element. It is used in conjunction with a cursor, usually a mouse pointer. The user hovers the cursor over an item, without clicking it, and a small box appears with supplementary information regarding the item being hovered over.”
AutoCAD has had tooltips for a long time, but very little ability to customize them. In the following article I will explain the new AutoCAD 2009 tooltips structure and explain how to make your own extended help tooltip.
Figure 1 - This is an example of the new command tooltips in AutoCAD 2009. (The content of the tooltip is derived from the CUI file, Name: Line, Description: Creates straight line segments, Command Display Name: LINE)
The new extended tooltips are a good way for cad managers to rollout new tools and information to users. These tooltips are displayed in the Ribbon, Menu Browser and on toolbars.
Figure 2 – This is an example of the new extended help tooltip that is displayed after hovering over the control for 2 seconds (by default 2 seconds and controlled in the Options dialog). The extended help tooltip content is stored in a .XAML (Extensible Application Markup Language; pronounced "zammel") file; the image is stored in any assigned directory and linked from the .XAML file.
The following procedure will help you create your own user extended tooltips. I will be using resources that ship in the 2009 release, but you can easily make your own by updating the file we create.
Step 1 – Creating the .XAML file that holds the tooltip information;
A. Create an empty file using Notepad (or your favorite editor), name it tooltips.xaml (you can save this file anywhere).
B. Copy and paste the following content into tooltips.xaml or Download tooltips.XAML.
<TextBlock Background="White" TextAlignment="Left">
This is a picture of the bay, <Bold>wouldn't we all rather be here!</Bold>
<Image Source="C:\Program Files\AutoCAD 2009\Sample\bay 6.jpg" Width="Auto" Height="Auto">
<TextBlock Background="Yellow" TextAlignment="Left">
This is a same image from the
<Run Text=" VBA " Foreground="Red" FontStyle="Italic"/> samples.
<Image Source="C:\Program Files\AutoCAD 2009\Sample\VBA\2d Projected Polylines.jpg" Width="Auto" Height="Auto">
Note: This XAML file is creating 2 custom tooltips using some images that ship with AutoCAD 2009.
Step 2 – Attaching the new extended tooltips to the command within AutoCAD;
A. Launch AutoCAD 2009
B. Type CUI in the command line to open the customized user interface
C. In the “Command List:” search for the command you want to attach the extended help to (for this example I am using “Line”) and select it.
Figure 3 – Is the CUI dialog with the new “nodes” that are used for the new tooltips. (Extended Help File is the one we need for this operation.)
D. Select the Edit Help File Node and click the ellipsis (…) button at the end of the row.
Figure 4 – Is showing the list of extended help options that are located in the tooltips.xaml
Note: If you hover over it you will get a preview of the extended help tip.
F. Select the “MYEH_CMD_0001” and ok out of the Select Help ID dialog.
G. Apply and OK out of the CUI.
H. Now hover over the Line command in a toolbar, Ribbon, or Menu Browser.
Result: SHAZAM! You now have a new extended help tooltip.
Thank you Randy! Yes I do wish the tropical image was my view out my window.