Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Inconsistent Tooltips for Themed Property Grid
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Inconsistent Tooltips for Themed Property Grid

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


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Topic: Inconsistent Tooltips for Themed Property Grid
    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 (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
astoyan View Drop Down
Admin Group
Admin Group
Avatar

Joined: 24 August 2013
Status: Offline
Points: 304
Post Options Post Options   Thanks (0) Thanks(0)   Quote astoyan Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
vkozlov View Drop Down
Admin Group
Admin Group


Joined: 01 December 2016
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote vkozlov Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post 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 (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post 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 (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 22 November 2017 at 3:53am
Still not fixed in v18.2.0.

-cpede
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 18 January 2021 at 8:28am
Still not fixed in v19.3.0.

Come on....

-cpede
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
Pesci7 View Drop Down
Groupie
Groupie
Avatar

Joined: 27 January 2021
Location: Italy
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote Pesci7 Quote  Post ReplyReply Direct Link To This Post 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++)
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.