Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Persistant Theme
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Persistant Theme

 Post Reply Post Reply
Author
Message
denczek View Drop Down
Newbie
Newbie


Joined: 06 August 2004
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote denczek Quote  Post ReplyReply Direct Link To This Post Topic: Persistant Theme
    Posted: 28 February 2007 at 2:18pm
We have added code to our project to use various themes based on the sample applications. 
 
When the application starts, we would like to be able to restore the theme last used by the user when the application was previously shut down. 
 
In order to save and restore the command bars (docking panes), we use the CXTPPropExchangeXMLNode class as such:
 
To Load: 
 
 CXTPPropExchangeXMLNode px(TRUE, 0, _T("Settings"));   // To serialize to XML file
 if(px.LoadFromFile(m_strIniFileName))
 {
  CXTPPropExchangeSection pxNormalLayout(px.GetSection(_T("NormalLayout")));
  ExchangeLayout(&pxNormalLayout);
  m_pFullScreenLayout = DYNAMIC_DOWNCAST(CXTPPropExchangeXMLNode, px.GetSection(_T("FullScreenLayout")));
  ASSERT(m_pFullScreenLayout);
 }
 
 
To Save:
 
 CXTPPropExchangeXMLNode px(FALSE, 0, _T("Settings"));
 if (px.OnBeforeExchange())
 {
  CXTPPropExchangeSection pxNormalLayout(px.GetSection(_T("NormalLayout")));
  ExchangeLayout(&pxNormalLayout);
  px.PutSection(m_pFullScreenLayout);
  px.SaveToFile(m_strIniFileName);
 }
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.035 seconds.