Print Page | Close Window

Update ALL 2007-themed controls

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=13364
Printed Date: 09 June 2024 at 9:46pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Update ALL 2007-themed controls
Posted By: znakeeye
Subject: Update ALL 2007-themed controls
Date Posted: 09 February 2009 at 10:03am

XTP 12.1.1.

This has been bugging me for a long time.
 
Q: After switching Office 2007-theme, exactly what do you need to do to make all controls get the new colors? Please provide some pseudo code :)
 
I remember I called some "Redraw all children" function, but that didn't work for certain panes etc. Then I removed all code, and it worked... until I switched to Vista and upgrade from XTP 11.2.2...


-------------
PokerMemento - http://www.pokermemento.com/



Replies:
Posted By: znakeeye
Date Posted: 18 February 2009 at 6:27am

I know one of the samples does this, but it's not a complete solution. Any ideas on how to do this optimally?



-------------
PokerMemento - http://www.pokermemento.com/


Posted By: Oleg
Date Posted: 19 February 2009 at 2:56am
Hi,
Automatically change theme you can do only with SkinFramework. Without you have manually replace classes to CXTP versions and change themes.


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


Posted By: znakeeye
Date Posted: 19 February 2009 at 9:07am
I'm talking about the ribbon-colors here. Not using the SkinFramework for that...

-------------
PokerMemento - http://www.pokermemento.com/


Posted By: Oleg
Date Posted: 19 February 2009 at 12:00pm

Hi,

You have to change controls to CXTP version then.


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


Posted By: znakeeye
Date Posted: 22 February 2009 at 4:39pm
You're not following me here. All my controls are CXTP. I have an SDI-ribbon application with all four Office 2007-colors (like in your sample). The problem is that my pane managers and its panes (CXTPReportControl etc) are not updated when I change the color theme (Blue, Aqua, Black or Silver).

-------------
PokerMemento - http://www.pokermemento.com/


Posted By: Oleg
Date Posted: 23 February 2009 at 3:27am
Hi,
 
Most easy way to update colors is to set 2007 theme again for each control.


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


Posted By: znakeeye
Date Posted: 11 March 2009 at 7:14pm
I got it working for all controls, except CXTPReportControl. I have to click on them to get the updated look! Why?
 
void CMainFrame::OnOptionsStyle(UINT ID)
{
    ...
    XTPOffice2007Images()->SetHandle(hModule, strIniFile));
 
    GetCommandBars()->GetPaintManager()->RefreshMetrics();
    GetCommandBars()->RecalcFrameLayout();
   
    m_paneManager.GetPaintManager()->RefreshMetrics();
 
    // Tab control is correctly updated!
    m_wndTab.GetPaintManager()->SetColor(xtpTabColorOffice2007);
    m_wndTab.Invalidate();
 
    // Report control is not updated until clicked!
     if (m_paneReport.GetSafeHwnd())
    {
        m_paneReport.GetPaintManager()->SetColumnStyle(xtpReportColumnOffice2007);
        m_paneReport.Invalidate();

    }
    m_paneManager.RedrawPanes();
    SendMessage(WM_NCPAINT);
   
    RedrawWindow(0, 0, RDW_ALLCHILDREN | RDW_INVALIDATE);
}
 
 
XTP 13. Vista Pro.


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: Oleg
Date Posted: 12 March 2009 at 1:53am
Call
m_paneReport.RedrawControl(); instedad Invalidate.


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


Posted By: znakeeye
Date Posted: 13 March 2009 at 7:32am
Works. Thanks! :)

-------------
PokerMemento - http://www.pokermemento.com/



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