Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Help field & scrollbar/tooltip
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Help field & scrollbar/tooltip

 Post Reply Post Reply
Author
Message
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Topic: Help field & scrollbar/tooltip
    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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 31 March 2006 at 7:47am

Hello,

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

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2006 at 4:45am
Hello,

But it don't show multiline-tooltip-

greetings from austria
    jimmy

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Posted: 06 April 2006 at 2:29am
Thank you,

Now it work.

greetings from austria
    Jimmy

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.