![]() |
Persistant Theme |
Post Reply
|
| Author | |
denczek
Newbie
Joined: 06 August 2004 Status: Offline Points: 27 |
Post Options
Thanks(0)
Quote Reply
Topic: Persistant ThemePosted: 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); } |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |