Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Can ToolTip display more than 15 Lines?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Can ToolTip display more than 15 Lines?

 Post Reply Post Reply
Author
Message
nguyena1 View Drop Down
Groupie
Groupie


Joined: 28 November 2005
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote nguyena1 Quote  Post ReplyReply Direct Link To This Post Topic: Can ToolTip display more than 15 Lines?
    Posted: 31 January 2006 at 10:29am

Hey there, I'm trying to have my tooltip as a popup status indicator for our project and can't get it to display more than 15 lines?  The width and heigth are dynamically created correctly, just blank after 15 lines.  Any reason why or something to get around this?

void COXToolTipCtrlCustom::DisplayToolTip(CPoint& pt, BOOL bExtended /*= FALSE*/)
{
    CSize szPopup;
 ASSERT(::IsWindow(m_hWnd));
 int nWidth;  //autowidth of popup
 int nHeight;
    if (!m_bActivated || !m_pCurrentToolTip)
        return;

    m_bExtended = bExtended;

    //CString str = GetTooltipText(m_pCurrentToolTip);
    CString str = _T("1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n1 7asdfad\n18\n19\n20");
 if (str.IsEmpty())
        return;
 
    m_wndPopupControl.SetTheme(new CXTPPopupPaintManager());
 m_wndPopupControl.RedrawControl();
 
 //Calculate the width and height of the box dynamically
    CRect rect = GetBoundsRect(str, m_pCurrentToolTip->nWidth);
    rect = CalculateInfoBoxRect(pt, m_pCurrentToolTip, rect);
 
    nWidth = rect.right - rect.left;
 nHeight = rect.bottom - rect.top;
 m_wndPopupControl.AddItem(new CXTPPopupItem(
  CRect(0, 0, nWidth, nHeight), NULL, RGB(255,255,225), 0));
 szPopup = CSize(nWidth, nHeight);

 CXTPPopupItem* pItemText = (CXTPPopupItem*)m_wndPopupControl.AddItem(
  new CXTPPopupItem(CRect(3, 2, 200, 200), _T(str)));

 pItemText->SetHyperLink(FALSE);
 
 m_wndPopupControl.SetPopupAnimation((XTPPopupAnimation )0);
 m_wndPopupControl.SetShowDelay(0);
 m_wndPopupControl.SetAnimateDelay(100);
 m_wndPopupControl.SetTransparency((BYTE)theApp.m_nTool TipTransparency);
 m_wndPopupControl.SetPopupSize(szPopup);
 m_wndPopupControl.AllowMove(0);
 m_wndPopupControl.Show(this);
}

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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 January 2006 at 1:46pm

Hi

Obviously, you need to change height of the item

CRect(3, 2, 200, 200), -> CRect(3, 2, 200, 300)

 

 

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
nguyena1 View Drop Down
Groupie
Groupie


Joined: 28 November 2005
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote nguyena1 Quote  Post ReplyReply Direct Link To This Post Posted: 31 January 2006 at 3:20pm
Thanks!
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.063 seconds.