Multiple-line tooltip 'Win95 style'
dobrin@itls.com Tuesday, August 20, 1996 Environment : VC++4.2 on Windows NT3.51 and Win95. I want to add tooltips to different buttons in a dialog box. CToolTipCtrl supports just a one-line text. Win95 displays, in various apps, after pressing the "?" button in the upper right-hand corner of a window, and selecting an item, a window with formatted text on multiple lines. Is there a shorter way around this problem, without getting involved with CRichEditCtrl ? Thank you in advance, Dan Dobrin Dan Dobrin Intertrans Logistics Solutions Ltd. Richmond Hill, CANADA e-mail : dan.dobrin@itls.com phone : (905) 771-8088, ext.251
Mats Mеnhav -- manhav@connectum.skurup.se Sunday, August 25, 1996 -- [ From: Mats Manhav * EMC.Ver #2.5.02 ] -- Dan, The multiline "tooltip" you are referring to are not really tooltips at all. It is instead a pop-up window displayed byt the help engine. The text displayed is taken from a help file. Look at documentation on Context sensitive help to get to know more about it. Mats -------- REPLY, Original message follows -------- > Date: Tuesday, 20-Aug-96 11:35 AM > > From: dobrin@itls.com \ Internet: (dobrin@itls.com) > To: MFCList \ Internet: (mfc-l@netcom.com) > > Subject: Multiple-line tooltip "Win95 style" > > Environment : VC++4.2 on Windows NT3.51 and Win95. > > I want to add tooltips to different buttons in a dialog box. > CToolTipCtrl supports just a one-line text. > > Win95 displays, in various apps, after pressing the "?" button in the > upper right-hand corner of a window, and selecting an item, a window > with formatted text on multiple lines. > > Is there a shorter way around this problem, without getting involved > with CRichEditCtrl ? > > Thank you in advance, > > Dan Dobrin > Dan Dobrin > Intertrans Logistics Solutions Ltd. > Richmond Hill, CANADA > e-mail : dan.dobrin@itls.com > phone : (905) 771-8088, ext.251 > -------- REPLY, End of original message -------- -- ========================================================================== Mats Mеnhav (Mats Manhav for 7-bit people) email:manhav@connectum.skurup.se WWW: http://connectum.skurup.se/~manhav FAX: (int) 46 (0) 414 243 05 Phone: (int) 46 (0) 414 243 05 ==========================================================================
beriksen@cda.com Monday, August 26, 1996 [Mini-digest: 4 responses] Your first problem is going to be that CWnd-derived objects support tool tips, but CDialog-derived objects do not. But what you're talking about is not tool-tip related at all - it's part of the help system. To do what you're talking about, you'll need to do something on WM_ONKEYDOWN for each object, to get 'f1' key support, and you'll have to do something really crazy (like putting your own context help dialog framework together) to get the context help arrow to come up when the user presses ctrl+f1 and then clicks on an item. Brian Eriksen beriksen@cda.com ______________________________ Reply Separator _________________________________ Subject: Multiple-line tooltip "Win95 style" Author: mfc-l@netcom.com at Internet_Mail Date: 8/24/96 6:20 PM Environment : VC++4.2 on Windows NT3.51 and Win95. I want to add tooltips to different buttons in a dialog box. CToolTipCtrl supports just a one-line text. Win95 displays, in various apps, after pressing the "?" button in the upper right-hand corner of a window, and selecting an item, a window with formatted text on multiple lines. Is there a shorter way around this problem, without getting involved with CRichEditCtrl ? Thank you in advance, Dan Dobrin Dan Dobrin Intertrans Logistics Solutions Ltd. Richmond Hill, CANADA e-mail : dan.dobrin@itls.com phone : (905) 771-8088, ext.251 -----From: Roger Onslow/Newcastle/Computer Systems Australia/AU This has nothing to do with eith tool tips of rich edit controls It is a function of the (new) WinHelp engine You can set it up do that produces context sensitve help in this way However, I do not have the details as to how (just know from reading that you can). So, if you want to research this yourself, look at the Win32 API docco on help (in particular context sensitive help and context menu). Roger -----From: "Brad Wilson"Those are displayed by the help system. Create a help file wherein each topic is the small piece of text you're interested in, then call CWinApp::WinHelp, with an nCmd of HELP_CONTEXTPOPUP. -- Brad Wilson Objectivist Philosopher, Software Engineer, Web Designer crucial@pobox.com http://www.thebrads.com/bradw Objectvst@Undernet "I'm sick of all you hypocrites, holding me at bay I don't need your sympathy to get me through the day" -----From: Antonio Jorge Marques Pires Try this: " 11.25. How do I add =91What=92s this=92 menus to my application - like W= in95 hip apps have? Here=92s some steps to get you started-> 1. Put the following menu into a resource script: IDR_WHAT_IS_THIS_MENU MENU DISCARDABLE BEGIN BEGIN POPUP "a" BEGIN MENUITEM "What's this?", ID_WHAT_IS_THIS END END END 2. Add to your dialog a right-click handler (OnRButtonDown) with menu IDR_WHAT_IS_THIS_MENU. You need to store the point of the last click in some variable - for example CPoint m_cLastRClickPoint; and store here the client coordinates of the last right click. 4. Put the following code into your dialog class (or probably the parent class of all your dialogs): BEGIN_MESSAGE_MAP(CMyDialog, CDialog) //{{AFX_MSG_MAP(CMyDialog) // whatever //}} ON_COMMAND(ID_WHAT_IS_THIS, OnWhatIsThis) END_MESSAGE_MAP() void CMyDialog::OnWhatIsThis() { CWnd* pControl =3D ChildWindowFromPoint (m_cLastRClickPoint); // if the click wasn't on one of the controls - open help for dialog if (pControl =3D=3D NULL || pControl->m_hWnd =3D=3D m_hWnd) WinHelp (HID_BASE_RESOURCE + m_nIDHelp,=20 HELP_CONTEXTPOPUP); else WinHelp (HID_BASE_CONTROL + pControl->GetDlgCtrlID(), HELP_CONTEXTPOPUP); } - and finally add the following lines to the makehelp.bat file: echo. >>hlp\wr.hm echo // Controls (IDC_*) >>hlp\wr.hm makehm IDC_,HIDC_,0x50000 resource.h >>hlp\wr.hm =09 This wires everything to your help system. Poul A. Costinsky(PoulACost@msn.com).
| Вернуться в корень Архива |