Print Page | Close Window

[solved] Is there way to change expand button?

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=23319
Printed Date: 27 April 2024 at 12:48am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [solved] Is there way to change expand button?
Posted By: netman2
Subject: [solved] Is there way to change expand button?
Date 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




Replies:
Posted By: olebed
Date 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



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