If you attended the recent Tech Ed in San Diego, you would have had a chance to see some of the new whiz-bang debugger features that Whidbey will ship with. One feature that is very near to me (because I wrote it) is the new, much improved and useful datatips -- something we refer to around here as “Enhanced Datatips”. If you're not sure what I'm talking about these are the little tooltip windows that popup over top of your program's variables when you hover your mouse over them while debugging.
For Whidbey these little doo-dads have been replaced by a much more convenient and functional form:
In the interest of time, I didn't bother trying to get a datatip comparison between old and new using the same underlying code. If you haven't seen these work, they work very much like the old datatips -- hover the mouse over what you want to see and it appears. I'd like to provide some details as to how I went about designing this new widget. This information was taken almost verbatim directly from an internal Wiki here at Microsoft, so the flow may seem a bit odd and I decided not to un-CamelCase many of the terms.
Original Datatips
Datatips are a feature of the Visual Studio Debugger and have been in existence since Visual C++ 1.0. They were originally designed to provide quick and immediate feedback of the state of variables within a program, without requiring any more user interaction than moving and hovering the mouse. This feature came to become a staple of the product that most developers cannot live without.
The design and implementation of Datatips have not changed in any dramatic way since their introduction. Though they can be immensely useful, they do have their share of issues. Among the most problematic issues:
In general, the design of the EnhancedDatatips came about from a desire to keep the spirit of the old DataTip model, while providing substantial improvements in functionality. They should not to be considered a floating watch window, but rather an alternate way of viewing data in the debugger. It's user-interface purposely deviates from that of existing debugger watch windows providing a new and complimentary data-inspection model that our users have never experienced.
The Debugger should provide information as quickly and easily as possible, without requiring much UserInteraction. This is why the original DataTip concept was so powerful. All the user had to do is hover the MouseCursor over a variable to see what it's value was.
DataTips should display what is desired and only cover as much ScreenRealEstate as necessary.
Imagine you were viewing an instance of the following structure:
struct mystruct { char string[80]; int x; int y; }
Using a tree-based datatip, in order to see individual characters inside mystruct.string, you'd have a window open that might look like this:
| | |+ s = {x=10 y=20 string=0x0012faf0 "hello world!" } | | | | | + + string = 0x0012faf0 "hello world!" | | | | | | | + [0] = 'h' | | | + [1] = 'e' | | | + [1] = 'l' | | | + [1] = 'l' | | | + [1] = 'o' | | | + : | | | + : | | | - [80] = '' | | + - x = 10 | | + - y = 20 | | |
Clearly there is a ton of wasted ScreenRealEstate.
The EnhancedDatatips are not meant as a replacement for the existing watch windows. However, it is clear through usability studies that users can navigate a hierarchy tree much more quickly than they can the existing watch window tree. However, tying the datatips to the rest of the UI provides an even richer experience for the user.
This integration includes the ability to Add a Watch from anywhere within a cascaded tip. This way a user can quickly add an item they they would like to watch over the course of several steps. In addition, values can be edited in-place -- right in the datatip. These updated values are reflected throughout the rest of the debugger UI.