Chapter 21 -- Tooltips Are Cool

Chapter 21

Tooltips are little pop-up windows that provide brief context-sensitive help. The great thing about tooltips is that they require almost no effort from the user. To get help for a screen element that has a tooltip, the user just moves the mouse cursor to that object and then does nothing. After a brief delay, the tooltip appears. To remove the tooltip, the user either moves the mouse from the object or does nothing at all, and the tooltip is removed after about a 10-second delay. What could be easier? Tooltips are definitely cool.

Tooltips were originally developed to address the problem of making toolbars more usable. The problem with toolbars is that while they are useful, it is often difficult for users to figure out and remember what a toolbar button does just by looking at the icon—often, the meaning of the icon isn't especially obvious. While using a combination of icon and text is possible (and is the method of choice for utilities), always displaying text on a toolbar is an ineffective use of space. Tooltips provide the best of both worlds—a combination of icon and text, but you see the text only when you want to.

To fully appreciate the power of tooltips, consider the alternative. Before tooltips were invented, Microsoft Windows programs provided context-sensitive information to the user through the status bar. Of course, this method is still used to give help for menus, but it suffers from at least two significant problems. The first problem is that it requires the user to move his eyes from the top of the window where the toolbar is to the bottom of the window to view the status bar, requiring significant effort and making this approach distracting. The second problem is that the changes in the text on the status bar are so subtle that beginning users (who need the most help) often don't notice that help is being offered on the status bar. And making the status bar text more obvious would also prove distracting during the user's normal activity.

While tooltips were originally designed as context-sensitive help for toolbars, they are such a powerful mechanism that their use has been expanded to the following applications:

  • Title tips Used to display truncated items within lists and tree controls.
  • Scroll bar tips Used to display the scroll bar location. A good example is the document scroll bar tips in Microsoft Word 97, which show the page number and page content's heading as you move the scroll bar.
  • Data tips Used to display more information in a document window. A good example is the Microsoft Visual C++ debugger data tips, used to interactively display variable values as you move the mouse cursor over the source code.

There will eventually be other applications as well. In fact, you could no doubt devise a way to use tooltips for just about everything in your interface, but the world would probably be a better place if you didn't.

Tooltips are best used when they accomplish any of the following goals:

  • Making your software more visible by providing helpful information to the user
  • Eliminating the necessity for dialog boxes by making data more accessible
  • Saving screen space, allowing you to create better screen layouts
  • Requiring less effort from the user

You should avoid using tooltips that don't accomplish goals like these. One of the reasons tooltips are effective is that they appear fairly infrequently. If tooltips appear in your program every time the user moves the mouse, most likely the user will regard them as an annoyance. Tooltips definitely lose their value if there are too many of them.

TIP
Tooltips lose their value if there are too many of them.

Title tips are an excellent mechanism for creating better screen layouts and eliminating work for the user. Suppose you are using a tree view as a primary mechanism for accessing information, as with Windows Explorer or the Visual C++ Workspace window. If you make the tree window too narrow, the tree is difficult to use because the user has to do a lot of scrolling to see the choices. If you make the tree too wide, it takes up too much space on the screen, requiring more work to view a document once it's been selected. Title tips offer an excellent compromise and let you make the tree view a size that works well most of the time. When the user needs to see information that is too long for the available space, he can use the title tip rather than having to scroll.

click to view at full size.

Scroll bar tips help overcome the problem with using scroll bars in large lists and documents. Suppose you have a dictionary list that contains 100,000 items. Without scroll bar tips, using the scroll bar to navigate such a list is ineffective because the user has no idea where he is in the list until he releases the scroll bar thumb. If the user doesn't end up where he wants to be, he has to take another shot in the dark. While it is possible to update the screen while the user scrolls, this approach only works well if the updating is responsive, which is typically not the case with large lists and documents. Scroll bar tips solve this problem elegantly by providing the user with feedback, but in a way that can be updated responsively.

click to view at full size.

Data tips help make your document interactive by truly implementing the "information at your fingertips" concept. If the user wants more information about an object in a document, he simply moves the mouse over the object. Of course, the text you display in the data tip depends upon the specific information in the document, so it is hard to characterize in general. Unlike the other types of tooltips, data tips must be configurable so that the user can select what information he wants to see and how the information is displayed. If the information displayed in a data tip is complex, you should not automatically remove the data tip after 10 seconds, since the user might need more time to view the information. Anyone who has used the data tip variable watch feature in the Visual C++ debugger never wants to go back to the old approach of having to select data and view a dialog box. Data tips are much easier to use.

click to view at full size.

And now for the bad news: there is currently no direct support for scroll bar tips or data tips in the Windows API or in MFC. If you want to add such functionality to your program, you are on your own for now. One note of caution: I have often seen tooltips described as a yellow pop-up window. Of course, this isn't true, since the color of the tooltip text and background are system colors that can be set by the user. If you write custom tooltip code, be sure to use the GetSysColor API function with the COLOR_INFOBK and COLOR_INFOTEXT indices.



Developing User Interfaces for Microsoft Windows
Developing User Interfaces for Microsoft Windows
ISBN: 0735605866
EAN: 2147483647
Year: 2005
Pages: 334

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net