Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - I want to change CXTPPropertyPageControlNavigator
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

I want to change CXTPPropertyPageControlNavigator

 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: I want to change CXTPPropertyPageControlNavigator
    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.
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 (1) Thanks(1)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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
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.