Print Page | Close Window

Inconsistent Tooltips for Themed Property Grid

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=23174
Printed Date: 29 February 2024 at 1:05am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Inconsistent Tooltips for Themed Property Grid
Posted By: cpede
Subject: Inconsistent Tooltips for Themed Property Grid
Date Posted: 31 October 2016 at 5:39am
The Tooltip Theme for the items does not seem to follow the general Theme for the Property Grid. Using the Office 2013 Theme shows two different tooltip "look" for the section headers, and for the items?



-cpede


-------------
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)



Replies:
Posted By: astoyan
Date Posted: 31 October 2016 at 9:39pm
Hi cpede, we'll definitely take of the issue and will let you know once it's resolved.
Regards,
  Alexander


Posted By: vkozlov
Date Posted: 09 December 2016 at 9:33am
Hi cpede,
Actually in the second case you see the whole value of grid item because the value is partially hidden. It is drawn exactly like it would be drawn if the place was enough.


Posted By: cpede
Date Posted: 09 December 2016 at 2:32pm
Except it uses the "old fashion" yellow background color, which the themed tooltips are not using anymore.

-cpede


-------------
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)


Posted By: cpede
Date Posted: 02 August 2017 at 5:45am
Aghhh, you did not fix this in v1801.

Very easy to reproduce in the Property Grid Sample.

It seems, that the tool tips for the items in the property editor is NOT following the theme.

-cpede


-------------
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)


Posted By: cpede
Date Posted: 22 November 2017 at 3:53am
Still not fixed in v18.2.0.

-cpede


-------------
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)


Posted By: cpede
Date Posted: 18 January 2021 at 8:28am
Still not fixed in v19.3.0.

Come on....

-cpede


-------------
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)


Posted By: Pesci7
Date Posted: 24 May 2023 at 12:40pm
I had the same problem and since I was very annoyed I took a look at the code and surprisingly found that theme tooltip support was already in place (CXTPPropertyGridToolTip).

What was missing was drawing tooltips using themes. I then took the code from CXTPGridControl which has the tooltips that work correctly (CXTPGridTip) and copied and adapted the code from the OnPaint method.

For simplicity I report below all the OnPaint code even if the changes are few

void CXTPPropertyGridToolTip::OnPaint()
{
    CPaintDC dc(this);
    CXTPClientRect rc(this);

    dc.SetBkMode(TRANSPARENT);

    BOOL bToolipDrawn = FALSE;
    CWnd* pToolTip = m_pGrid->GetPropertyGrid()->GetToolTipContext()->CreateToolTip(m_pGrid);
    if (NULL != pToolTip)
    {
        pToolTip->SetWindowPos(&CWnd::wndTop, 0, 0, rc.Width(), rc.Height(),
                               SWP_HIDEWINDOW | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER
                                   | SWP_NOREDRAW | SWP_NOMOVE | SWP_NOCOPYBITS);
        bToolipDrawn =
            (TRUE
             == pToolTip->SendMessage(WM_PRINTCLIENT, reinterpret_cast<WPARAM>(dc.GetSafeHdc()),
                                      PRF_CLIENT | PRF_ERASEBKGND | PRF_CHILDREN | PRF_OWNED));
        pToolTip->DestroyWindow();
        delete pToolTip;
    }

    if (!bToolipDrawn)
    {
        m_pGrid->GetPropertyGrid()->GetToolTipContext()->DrawBackground(&dc, rc);
    }

    if ((m_pGrid->GetExStyle() & WS_EX_RTLREADING)
        || (m_pGrid->GetExStyle() & WS_EX_LAYOUTRTL))
    {
        dc.SetTextAlign(TA_RTLREADING);
    }

    CString strText;
    GetWindowText(strText);

    CXTPFontDC font(&dc, &m_xtpFont);
    CRect rcText(rc);
    rcText.left += XTP_DPI_X(4);

    dc.DrawText(strText, rcText, DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX);
}



Not extensively tested but it seems ok to me.


-------------
Product: Xtreme ToolkitPro (22.1.0)
Platform: Windows 11 (x64)
Language: Visual Studio 2022 (C++)



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