Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - [solved] Is there way to change expand button?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[solved] Is there way to change expand button?

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


Joined: 19 April 2016
Location: Seoul
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote netman2 Quote  Post ReplyReply Direct Link To This Post Topic: [solved] Is there way to change expand button?
    Posted: 13 April 2017 at 10:00pm
Hello, I'm now making some property grid.

I've used SetTheme(xtpGridThemeVisualStudio2015);

but it's not changing expand/collapse icon. It's showing +/- icon.

I want to change +/- to explorer icons.


Is there methods to change it or others?

I tried following but not working :
CXTPWinThemeWrapper().SetWindowTheme(m_wndPropertyGrid.GetSafeHwnd(), L"EXPLORER", NULL); // enable

Thanks

Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 14 April 2017 at 9:14am
Hello netman2,

This have been already implemented in v17.3
void CXTPPropertyGridVisualStudio2015Theme::DrawExpandButton(CDC& dc, CXTPPropertyGridItem* pItem, CRect rcCaption)
{
    if (!pItem->IsExpandable())
        return;

    CRect rcSign(CPoint(XTP_DPI_X(XTP_PGI_EXPAND_BORDER) / 2 - XTP_DPI_X(5), rcCaption.CenterPoint().y - XTP_DPI_Y(4)), 
        XTP_DPI(CSize(9, 9)));

    if (pItem->GetIndent() > 0)
        rcSign.OffsetRect((pItem->GetIndent() - (pItem->IsCategory() ? 0 : 1)) * XTP_DPI_X(XTP_PGI_EXPAND_BORDER), 0);

    CPoint pt(rcSign.right - XTP_DPI_X(6), rcSign.top);

    if(pItem->IsExpanded())
    {
        XTPDrawHelpers()->DrawExpandTriangle(&dc, pt, TRUE, m_pMetrics->m_clrFore);
    }
    else
    {
        XTPDrawHelpers()->DrawExpandTriangle(&dc, pt, FALSE, m_pMetrics->m_clrFore, m_pMetrics->m_clrBack);
    }
}

Regards,
 Oleksandr Lebed
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.125 seconds.