May 11, 2024, 12:45:45 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


rebars,toolbars, and tooltips

Started by LarryMc, January 09, 2010, 04:05:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

Does anyone know how to make tooltips for a toolbar that has been assigned to a band in a rebar?
I tried using what I usually use for toolbars (below) and it doesn't work.
   CONTROLCMD main,998,@TBSETTIP,MN_WINDOW,"Create a new window"

Larry

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

sapero

January 09, 2010, 04:25:27 PM #1 Last Edit: January 09, 2010, 04:37:01 PM by sapero
Larry, try subclassing the rebar control, detect WM_NOTIFY message, check if *<NMHDR>lParam.code is TTN_GETDISPINFO{A|W}. If so, forward this message to your main window.

sub RebarSubclassProc(hwnd, msg, wParam, lParam),int /*fixme*/

  if (msg = WM_NOTIFY) /* & *<NMHDR>lParam.idFrom = toolbar_id */

     if ((*<NMHDR>lParam.code = TTN_GETDISPINFOA) | (*<NMHDR>lParam.code = TTN_GETDISPINFOW))
        return _SendMessage(GetParent(hwnd), WM_NOTIFY, wParam, lParam)
      endif
 endif
 return CallWindowProc(...)


// added missing endif

LarryMc

Thanks Sapero, I'll give it a try.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

Your help above worked great Sapero.

There's one little catch that has to be remembered.

You have to add the tooltip's text to the toolbar BEFORE you add the toolbar to the rebarband.
If you try to add tips to a toolbar after the toolbar is added to a rebar band then you get no tooltips.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library