IonicWind Software

IWBasic => GUI Central => Topic started by: LarryMc on January 09, 2010, 04:05:16 PM

Title: rebars,toolbars, and tooltips
Post by: LarryMc on January 09, 2010, 04:05:16 PM
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

Title: Re: rebars,toolbars, and tooltips
Post by: sapero on January 09, 2010, 04:25:27 PM
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
Title: Re: rebars,toolbars, and tooltips
Post by: LarryMc on January 09, 2010, 04:34:16 PM
Thanks Sapero, I'll give it a try.

Larry
Title: Re: rebars,toolbars, and tooltips
Post by: LarryMc on January 09, 2010, 10:03:49 PM
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