Print Page | Close Window

Help field & scrollbar/tooltip

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=3917
Printed Date: 16 November 2024 at 7:09am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Help field & scrollbar/tooltip
Posted By: jimmy
Subject: Help field & scrollbar/tooltip
Date Posted: 31 March 2006 at 5:04am
Hello,

i use V9.81.
Is there a way to add a scrollbar to the help field.
Or how can i add a tooltip to the help field, if
the text is to large.
Also show tooltip with multiline.

    Jimmy




Replies:
Posted By: Oleg
Date Posted: 31 March 2006 at 7:47am

Hello,

You can override CXTPPropertyGrid and catch MFC's OnToolHitTest...



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


Posted By: jimmy
Date Posted: 03 April 2006 at 4:45am
Hello,

But it don't show multiline-tooltip-

greetings from austria
    jimmy



Posted By: Oleg
Date Posted: 03 April 2006 at 8:08am

Hello,

code:

class CPropertyGrid : public CXTPPropertyGrid
{
public:
 CPropertyGrid()
 {
  m_pToolTipContext = new CXTPToolTipContext;
  m_pToolTipContext->SetMaxTipWidth(200);

  m_pToolTipContext->ShowTitleAndDescription(TR UE);
  //m_pToolTipContext->SetStyle(xtpToolTipBallo on);

}
 
 ~CPropertyGrid()
 {
  CMDTARGET_RELEASE(m_pToolTipContext);   ; ;
 }

 BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult)
 {
  if (m_pToolTipContext)
  {
   m_pToolTipContext->FilterToolTipMessage (this, message, wParam, lParam);
  }
  
  return CWnd::OnWndMsg(message, wParam, lParam, pResult);
 }

 INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const
 {
  
  ASSERT_VALID(this);
  ASSERT(::IsWindow(m_hWnd));
  
  // check child windows first by calling CControlBar
  INT_PTR nHit = CWnd::OnToolHitTest(point, pTI);
  if (nHit != -1)
   return nHit;
  
  if (!IsHelpVisible() || !GetSelectedItem())
   return -1;

  int nID = GetSelectedItem()->GetID();

  CXTPClientRect rc(m_hWnd);
  CRect rcHelp(rc.left, rc.bottom - m_nHelpHeight, rc.right, rc.bottom);

  if (rcHelp.PtInRect(point))
  {
   CXTPToolTipContext::FillInToolInfo(pTI, m_hWnd, rcHelp,
    nID, GetSelectedItem()->GetDescription(), GetSelectedItem()->GetCaption(), GetSelectedItem()->GetDescription());

   return nID;
  }
 
  return -1;
 }

protected:
 CXTPToolTipContext* m_pToolTipContext;
};

 

usage:

CPropertyGrid m_wndPropertyGrid;

 

 

 



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


Posted By: jimmy
Date Posted: 06 April 2006 at 2:29am
Thank you,

Now it work.

greetings from austria
    Jimmy




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