Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CTreeView ToolTips Collapse All
Subject Author Date
Jacquie Howard May 3, 2004 - 9:33 AM

Here’s another strange thing -


I have a CExtControlBar with a subclass of CTreeView inside it.  This is old code that I have integrated (apart from this, very successfully) with Prof-UIS.


All is fine whilst the bar is docked but when I float it, the tool tips that appear when hovering over items that aren’t fully displayed because the window isn’t wide enough, appear underneath the window instead of on top.


I can’t send you my working code - it is huge and needs lots of accompanying other stuff to run, but I will try and reproduce it in one of the sample projects if necessary.


 

Jacquie Howard May 3, 2004 - 9:38 AM

Actually, I just tried this with SDIDOCVIEW as it stands with the bar with the CTreeCtl and it does the same there.

Technical Support May 5, 2004 - 6:46 AM

Dear Jacquie,

You can encounter this problem when working with any window that supports tool tips. It can be easily fixed by bringing the tooltip window to top of other windows when the tool tip sends the WM_NOTIFY message with the TTN_SHOW code. The TTN_SHOW notification is handled in some Prof-UIS controls. You can handle it in the WindowProc virtual method. For example, we added the following WindowProc code to the CProfStudioTreeCtrl class of the ProfStudio sample application:

LRESULT CProfStudioTreeCtrl::WindowProc( UINT message,
         WPARAM wParam, 
         LPARAM lParam )
{
 if(  message == WM_NOTIFY
  && ((LPNMHDR)lParam) != NULL
  && ((LPNMHDR)lParam)->hwndFrom != NULL
  && ::IsWindow( ((LPNMHDR)lParam)->hwndFrom )
  && ((LPNMHDR)lParam)->code == TTN_SHOW
  )
 {
  CString strClassName;
  ::GetClassName(
   ((LPNMHDR)lParam)->hwndFrom,
   strClassName.GetBuffer( _MAX_PATH+1 ),
   _MAX_PATH
   );
  strClassName.ReleaseBuffer();
  strClassName.MakeLower();
  static TCHAR strTtClassPrefix[] = _T("tooltip");
  if( _tcsncmp(
    LPCTSTR(strClassName),
    strTtClassPrefix,
    (sizeof( strTtClassPrefix ) / sizeof(TCHAR)) - 1
    ) == 0
   )
   ::SetWindowPos(
    ((LPNMHDR)lParam)->hwndFrom, HWND_TOP, 0,0,0,0,
     SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE
    );
 }
 return CTreeCtrl::WindowProc( message, wParam, lParam );
}

All tree-control tool tips in ProfStudio work properly.

Jacquie Howard May 6, 2004 - 9:18 AM

Thanks, that worked perfectly.