Print Page | Close Window

Tooltip in popup tree control

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=5563
Printed Date: 25 November 2024 at 2:51am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Tooltip in popup tree control
Posted By: mgampi
Subject: Tooltip in popup tree control
Date Posted: 20 November 2006 at 11:33am
Hi;
 
I have troubles in displaying a tooltip within a popup tree control.
See attached image.
 
Any ideas whats wrong?
 
Martin
 



Replies:
Posted By: Oleg
Date Posted: 20 November 2006 at 1:58pm
It is known CTreeCtrl problem.
 
here is code we use in CXTTreeCtrl to fix it:
 
BOOL CXTTreeBase::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
 NMHDR* pNMHDR = (NMHDR*)lParam;
 switch (pNMHDR->code)
 {
 case TTN_SHOW:
  {
   // get a pointer to the tooltip control.
   HWND hWnd = TreeView_GetToolTips(m_pTreeCtrl->m_hWnd);
   if (hWnd != NULL)
   {
    // make sure the tooltip is at the top of the "Z" order, otherwise
    // it will appear behind popup windows....
    ::SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
     SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
   }
  }
  break;
 }
 return m_pTreeCtrl->CTreeCtrl::OnNotify(wParam, lParam, pResult);
}


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: mgampi
Date Posted: 21 November 2006 at 2:57am
Hi Oleg;
 
This happens with the CXTTreeCtrl! I'm not using the CTreeCtrl. I create the control in this way:

CXTTreeCtrl::CreateEx(WS_EX_TOOLWINDOW | (pParent->GetExStyle() & WS_EX_LAYOUTRTL), WS_CHILD | WS_BORDER | WS_VSCROLL | TVS_DISABLEDRAGDROP | TVS_TRACKSELECT, CRect(0, 0, 0, 0), pParent, 0)

Am I missing any necessary style?
 
Martin


Posted By: mgampi
Date Posted: 21 November 2006 at 3:46am

Hello Oleg;

I took your reply as a hint and wrote my own OnNotify() function. After changing the flag for the second parameter of SetWindowPos to HWND_TOPMOST it works as expected. Here are my small changes in my treectrl class function OnNotify() (perhaps this changes should also go into your CXTReeCtrlBase class:

if (hWnd != NULL)

{

// make sure the tooltip is at the top of the "Z" order, otherwise

// it will appear behind popup windows....

::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);

}

Martin




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net