CHwmDataTip - tool and data tips for CFormView and CDialog classes

Download the source

I wanted to display "tool tips" for non-control items, such as edit boxes, static text displays, etc. Unfortunately the VC/MFC CToolTipCtrl class didn't do what I wanted, although it came part of the way. I searched around on the Web, and when I installed VC6 I finally found most of the solution.

Microsoft Systems Journal, April 1998 issue., had an article entitled "Tiptoe Through the ToolTips With Our All-Encompassing ToolTip Programmer's Guide" by Roger Jack. This article contained most of the information I needed. I did some experimenting and then created a wrapper class to ease future implementation

If you only need tool tips - for control objects such as buttons or toolbars - then you can probably use the Microsoft CToolTipCtrl directly and won't need this wrapper.

There are three classes. All three classes are implemented in the CHwmDataTip.cpp and CHwmDataTip.h source files.

CHwmDataTip - is descended from CToolTipCtrl. Although it uses CToolTipCtrl for most of its processing, it also uses the CWnd functions to enable tool tips. With this combination of techniques you can easily implement tool or data tips for non-frame windows, such as CFormView or CDialog. The class is specific for each parent window; you would have different instances (usually embedded as a member variable) for each window where you want to have tips.

CHwmDataTipInfo - contains information about each tip area in the parent. CHwmDataTip contains a list of CHwmDataTipInfo elements. The actual data or tool tip text and active areas are controlled by this structure.

CHwmDataTipCollection - is an optional class that is meant to be "global". By connecting CHwmDataTip to CHwmDataTipCollection you can "globally control" each seperate view's tips from a single object.

The source code is liberally commented. CHwmDataTip.cpp contains directions and source snips for cookbook implementation.

Last updated: October 17, 1998



Comments

  • Problem with link

    Posted by ron@listech.com.au on 12/13/2005 10:46pm

    Unable to activate download 'source' - link does not seem to be working at all

    Reply
  • Tool Tips

    Posted by Legacy on 11/28/2003 12:00am

    Originally posted by: Mike Burgermeister

    Does any know where I could find a complete list of "Tool Tips" in VB 6?

    Thanks.

    Reply
  • ToolTips and Tab Order; HTML Help

    Posted by Legacy on 12/30/1998 12:00am

    Originally posted by: Frank LaPiana

    I've discovered an interesting bug.

    If the tab order for parent window isn't "sequential", then tool/data tips do not always display, even though the tip area is defined. For instance, if you have a tab order of 1 10 12 2 3 7 8, then the tips may not appear for the areas 2 3 7 8. If you re-order the tab sequence to 1 2 3... then the tips work correctly.

    The bug appears to be in the base tool tip control.

    I've also extended CHwmDataTip to automatically handle "HTML Help". This provides a single location for both types of help - tips and full text.

    Reply
  • Wrong MSJ Issue (4/1997, not 4/1998)

    Posted by Legacy on 12/28/1998 12:00am

    Originally posted by: Uwe Keim

    the article "Tiptoe Through the ToolTips With Our All-Encompassing ToolTip Programmer's Guide" was in the April issue 1997, not 1998!

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: November 20, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT Are you wanting to target two or more platforms such as iOS, Android, and/or Windows? You are not alone. 90% of enterprises today are targeting two or more platforms. Attend this eSeminar to discover how mobile app developers can rely on one IDE to create applications across platforms and approaches (web, native, and/or hybrid), saving time, money, and effort and introducing apps to market faster. You'll learn the trade-offs for gaining long …

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds