Solved

tooltips in a menu

Posted on 2000-03-10
6
548 Views
Last Modified: 2013-11-20
Can anyone give me tips on how to start adding toltips to a menu? We don't have a status bar to put the normal menu help text. It is either that or having a dynamic multiline disabled menu at the bottom of the menu that the info can be displayed in.
Any help on the above will be appreciated.
0
Comment
Question by:ShaunWilde
6 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 2605573
What you can do is catch the WM_ENTERIDLE message. You can be sure that the user isn't doing anything at that time. Create a timer from that message to delay a bit. When you receive the timer message, show your tooltip window. There may be a problem because if the menu loses focus, the menu will disappear. It is very important not to create a tooltip window in this case. Create the tooltip ahead of time.

In fact, you can have MFC help you quite a bit here. You can reuse the architecture to help you with the message string. Create a frame descandant window with the ID of AFX_IDW_STATUS_BAR, but don't make it visible. This window will receive all of the status messages through WM_SETTEXT. This window can forward all of the messages to the tooltip. So that when you show the tooltip window, it will already have the text in it.
0
 
LVL 8

Accepted Solution

by:
gelbert earned 100 total points
ID: 2605589
There is no standard way to add tooltip to menu item as far as I know.

If you add dynamic multiline disabled menu at the bottom of the menu that the info can be displayed in then you would be limited in size of your tooltip.

Only way which I can think is to implement menu yourself (CWnd derived class, custom drawing). Then you would have to watch mouse position(WM_MOUSEMOVE) and popup tooltip(CWnd derived class)
0
 
LVL 9

Author Comment

by:ShaunWilde
ID: 2611598
Hi - is it possible for your to both expand a bit - my application is a dialog only app however the menu I am trying to add tooltips is a context menu that is generated from the tray icon.

As far as getting the tip text I was under the impression I could do LoadString (menuid) as the prompt and the tip share the same resource id.

I have a feeling that gelberts way may have the more self contained (ie a CPopupToolTipMenu) approach that I was looking for.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 9

Author Comment

by:ShaunWilde
ID: 2640124
I could not get this to work - probably my own fault - however I am now going to pursue gelbert's approach.
0
 
LVL 9

Author Comment

by:ShaunWilde
ID: 2696317
This approach had merit and seems the best course of action - I have seen similar down in a class library that had windows that looked and acted like a menu (the new office type) and I amended this to do what I wanted.
0
 

Expert Comment

by:chopa
ID: 7519640
Hi,
You can use for that tooltips available here: www.tooltips.net, and they can be displayed for menu items as well. I hope you will like it.

Cheers!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
bobThere java chalenge 45 94
Shell script to login to remote m/c and execute commands 10 78
zeroFront challenge 7 114
mapAB Challlenge 35 160
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question