Print Page | Close Window

CXTPTabControl not skinned

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=18453
Printed Date: 10 May 2024 at 5:44am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPTabControl not skinned
Posted By: FSauer
Subject: CXTPTabControl not skinned
Date Posted: 26 May 2011 at 8:14am
Hi Oleg,

I subclassed my CXTPTabControl from STATIC and set SS_NOTIFY style, but the tabcontrol isn't skinned with the matalic effect.
I skin my app in CMainFrame::OnCreate like below:
    XTPSkinManager()->LoadSkin(NULL, _T("Normalitunes.ini"));
    XTPPaintManager()->SetTheme(xtpThemeNativeWinXP);
    XTPPaintManager()->m_bFlatMenuBar = TRUE;
    XTPSkinManager()->SetApplyOptions
        (xtpSkinApplyMetrics|xtpSkinApplyFrame|xtpSkinApplyColors/*|xtpSkinApplyMenus*/);

What did I wrong?



Regards
FS



Replies:
Posted By: Oleg
Date Posted: 27 May 2011 at 4:01am
Hi

Try set xtpTabAppearancePropertyPage appearance to tab control.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: FSauer
Date Posted: 30 May 2011 at 10:35am
Hi Oleg,

I already set xtpTabAppearancePropertyPageFlat appearance to my tab control.
Just now, I set xtpTabAppearancePropertyPage appearance to my control, but this dont work, too.

Here is my code. Do you have an idea what could be wrong?

        CXTPClientRect rc(TabCtrl);
        TabCtrl->AdjustRect(FALSE, &rc);

        TabCtrl->ModifyStyle(0, WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_TABSTOP);
        TabCtrl->ModifyStyleEx(0, WS_EX_CONTROLPARENT);
        TabCtrl->SetAppearance(xtpTabAppearancePropertyPageFlat );
        TabCtrl->SetAllowReorder(FALSE);
        TabCtrl->GetPaintManager()->m_bHotTracking = FALSE;
        TabCtrl->GetPaintManager()->m_bBoldSelected = TRUE;
        TabCtrl->GetPaintManager()->m_bStaticFrame = FALSE;
        TabCtrl->GetPaintManager()->SetLayout(xtpTabLayoutAutoSize);
        TabCtrl->GetPaintManager()->SetPosition(xtpTabPositionTop);
        TabCtrl->GetPaintManager()->m_rcControlMargin = CRect(0,0,0,0);
        TabCtrl->GetPaintManager()->m_rcClientMargin = CRect(0,0,0,0);
        TabCtrl->GetPaintManager()->m_rcButtonMargin = CRect(5,4,5,0);
        TabCtrl->GetPaintManager()->RefreshMetrics();

        TabCtrl->FindNavigateButton(xtpTabNavigateButtonLeft)->
                SetFlags((XTPTabNavigateButtonFlags)0);
        TabCtrl->FindNavigateButton(xtpTabNavigateButtonRight)->
                SetFlags((XTPTabNavigateButtonFlags)0);
        TabCtrl->GetPaintManager()->m_bDrawFocusRect=FALSE;
        TabCtrl->Reposition();



Posted By: Oleg
Date Posted: 30 May 2011 at 1:35pm
its still xtpTabAppearancePropertyPageFlat .

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: FSauer
Date Posted: 30 May 2011 at 4:02pm
Hi Oleg,

also TabCtrl->SetAppearance(xtpTabAppearancePropertyPage );
dont set the metalic theme like the menubar or the statusbar. xtpTabAppearancePropertyPage and  xtpTabAppearancePropertyPageFlat seems to be different only by the flat state.

Have I misunderstood something?


Posted By: FSauer
Date Posted: 30 May 2011 at 4:03pm
tabcontrol should be skinned with the matalic effect like menubar or statusbar


Posted By: FSauer
Date Posted: 06 June 2011 at 8:10am
Hi Oleg,

I dont know what still wrong? I set xtpTabAppearancePropertyPage appearance to tab control, but the tab doesn't has the matalic effect!

Can you help me with this, please!

CXTPClientRect rc(TabCtrl);
TabCtrl->AdjustRect(FALSE, &rc);
TabCtrl->SetAppearance(xtpTabAppearancePropertyPage);

Best Regards

FS


Posted By: Oleg
Date Posted: 06 June 2011 at 11:24am
Hi,

Tab content is separate window ?
Try add call m_wndTabControl.EnableTabThemeTexture(hWndChild, TRUE);


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: FSauer
Date Posted: 06 June 2011 at 12:44pm
Hi Oleg,

now the tab-buttons are skinned, but the background not yet:


The childwindow is derivated from CXTResizePropertyPage.


    CXTPTabControl* TabCtrl = (CXTPTabControl*)pTab;
    if(TabCtrl)
    {
        CXTPClientRect rc(TabCtrl);
        TabCtrl->AdjustRect(FALSE, &rc);

        TabCtrl->ModifyStyle(0, WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_TABSTOP);
        TabCtrl->ModifyStyleEx(0, WS_EX_CONTROLPARENT);
        TabCtrl->SetAppearance(xtpTabAppearancePropertyPage);
        TabCtrl->SetAllowReorder(FALSE);
        TabCtrl->GetPaintManager()->SetColor(xtpTabColorWinXP);
        TabCtrl->EnableTabThemeTexture(TabCtrl->GetSafeHwnd(), TRUE);
        TabCtrl->GetPaintManager()->m_bHotTracking = FALSE;
        TabCtrl->GetPaintManager()->m_bBoldSelected = TRUE;
        TabCtrl->GetPaintManager()->m_bStaticFrame = FALSE;
        TabCtrl->GetPaintManager()->SetLayout(xtpTabLayoutAutoSize);
        TabCtrl->GetPaintManager()->SetPosition(xtpTabPositionTop);
        TabCtrl->GetPaintManager()->m_rcControlMargin = CRect(0,0,0,0);
        TabCtrl->GetPaintManager()->m_rcClientMargin = CRect(0,0,0,0);
        TabCtrl->GetPaintManager()->m_rcButtonMargin = CRect(5,4,5,0);
        TabCtrl->GetPaintManager()->RefreshMetrics();
        TabCtrl->FindNavigateButton(xtpTabNavigateButtonLeft)->SetFlags((XTPTabNavigateButtonFlags)0);
        TabCtrl->FindNavigateButton(xtpTabNavigateButtonRight)->SetFlags((XTPTabNavigateButtonFlags)0);
    //    TabCtrl->GetPaintManager()->m_clientFrame = (XTPTabClientFrame)1;
        TabCtrl->GetPaintManager()->m_bDrawFocusRect=FALSE;
        TabCtrl->Reposition();
    }



Could you please help me?


Posted By: Oleg
Date Posted: 07 June 2011 at 1:52am
Call EnableTabThemeTexture for Child window, not TabControl.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: FSauer
Date Posted: 07 June 2011 at 3:20am
Hi Oleg,

that has no effect on my childwindow (m_pageContacts derivated from CXTResizePropertyPage) background color!
        TabCtrl->SetAppearance(xtpTabAppearancePropertyPage);
        TabCtrl->GetPaintManager()->SetColor(xtpTabColorWinXP);
        TabCtrl->EnableTabThemeTexture(m_pageContacts.GetSafeHwnd(), TRUE);


Do you have an further idea what could be wrong? Is in childwindow something to set?


Posted By: Oleg
Date Posted: 07 June 2011 at 3:58am
Tested with our TabbedToolbar sample, and seems this one should finally work:

m_wndTabControl.SetAppearance(xtpTabAppearancePropertyPage);
m_wndTabControl.SetColor(xtpTabColorWinXP);

XTPSkinManager()->EnableThemeDialogTexture(m_pageTheme, ETDT_ENABLETAB);
XTPSkinManager()->EnableThemeDialogTexture(m_pageTabControl, ETDT_ENABLETAB);



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: FSauer
Date Posted: 07 June 2011 at 4:49am
Hi Oleg,

thank you very much!
Now it works. Tongue





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