Print Page | Close Window

I want to change CXTPPropertyPageControlNavigator

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=23317
Printed Date: 18 April 2024 at 12:03am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: I want to change CXTPPropertyPageControlNavigator
Posted By: netman2
Subject: I want to change CXTPPropertyPageControlNavigator
Date Posted: 12 April 2017 at 9:00pm
I want to use explorer theme in CXTPPropertyPageTreeNavigator.

It's derived from CTreeCtrl.

And of course CTreeCtrl doesn't have SetExplorerTheme function.

So, I want to change CTreeCtrl -> CXTPTreeCtrl or Just add theme.

Is there way to add an explorer theme in CXTPPropertyPageTreeNavigator ?

Please Help me.

Thanks.



Replies:
Posted By: olebed
Date Posted: 13 April 2017 at 2:45am
Hello Netman2,

I can advise to using CXTPWinThemeWrapper for setting expore style. I have modyfied our sample 
Samples\Controls\PropertySheet\PropertySheetDlg.cpp
class CCategoriesTreeNavigator : public CXTPPropertyPageTreeNavigator
{
public:
    CCategoriesTreeNavigator()
        : CXTPPropertyPageTreeNavigator(TVS_SHOWSELALWAYS | TVS_HASBUTTONS /*| TVS_HASLINES*/ | TVS_LINESATROOT)
    {
        
    }
    
    BOOL CreateTree()
    {
        if (XTPSystemVersion()->IsWinVistaOrGreater())
        {
            CXTPWinThemeWrapper().SetWindowTheme(GetSafeHwnd(), L"EXPLORER", NULL); // enable
            //CXTPWinThemeWrapper().SetWindowTheme(GetSafeHwnd(), L"", NULL);    // disable
        }

        ASSERT(m_pSheet->GetPageCount() == 2);
        if (m_pSheet->GetPageCount() != 2)
            return FALSE;
        
        HTREEITEM hItemGeneral = InsertItem(_T("General"));
        HTREEITEM hItemOptions = InsertItem(_T("Options"));
        
        for (int i = 0; i < m_pSheet->GetPageCount(); i++)
        {
            CXTPPropertyPage* pPage = m_pSheet->GetPage(i);
            
            CString strCaption = pPage->GetCaption();
            
            HTREEITEM hItem = InsertItem(strCaption, -1, -1, i == 0 ? hItemGeneral : hItemOptions);
            SetItemData(hItem, (DWORD_PTR)pPage);
            pPage->m_dwData = (DWORD_PTR)hItem;
        }
        
        return TRUE;
    }
};

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