Print Page | Close Window

Persistant Theme

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=6531
Printed Date: 12 November 2025 at 9:47am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Persistant Theme
Posted By: denczek
Subject: Persistant Theme
Date 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);
 }



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