Print Page | Close Window

Hot track item

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=3936
Printed Date: 28 April 2024 at 10:40pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Hot track item
Posted By: douglashogan
Subject: Hot track item
Date Posted: 03 April 2006 at 3:39pm

Hi

How is it possible to hot track with an underline in the report control? I want to hot track the first column of the rows.

 



-------------
Regards
Douglas Hogan



Replies:
Posted By: sserge
Date Posted: 06 April 2006 at 3:13pm
Hi,

There are no an easy setting for this, but you can do it in a custom way in 2 following steps:

1) Add a code to GetItemMetrics() method to draw a report cell underlined where a mouse currently placed. It could be like a following:

void CMessageRecord::GetItemMetrics(...)
{
...
    if (pView && pDrawArgs->pColumn && pDrawArgs->pControl && pDrawArgs->pColumn->GetIndex() == 5)
    {
        // Get the current mouse location and convert it to client coordinates.
        DWORD pos = GetMessagePos();
        CPoint ptCur(LOWORD(pos), HIWORD(pos));
        pDrawArgs->pControl->ScreenToClient(&ptCur);

        if (pDrawArgs->rcItem.PtInRect(ptCur))
        {
            static CFont m_fontUnderlined;
           
            if (!m_fontUnderlined.GetSafeHandle())
            {
                LOGFONT lf;
                pDrawArgs->pControl->GetPaintManager()->m_fontText. GetLogFont(&lf);
                lf.lfUnderline = TRUE;
               
                m_fontUnderlined.CreateFontIndirect(&lf);
            }
           
            pItemMetrics->pFont = &m_fontUnderlined;
        }
    }
...


2) Add report control redrawing on mouse move inside a Report Control:

void CYourReport::OnReportMouseMove(...)
{
    GetReportCtrl().RedrawControl();
}


--
WBR,
Serge



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