![]() |
Shortcut Keys.... |
Post Reply ![]() |
Author | ||
ddlittle ![]() Senior Member ![]() Joined: 19 February 2004 Location: United States Status: Offline Points: 132 |
![]() ![]() ![]() ![]() ![]() Posted: 23 November 2009 at 11:00am |
|
I added a CXTPCustomizeKeyboardPage to my customize toolbars and it seems to work fine. The next step is to make the changes persistant, but this code doesn't seem to save anything:
which means that nothing happens when I call this in CMainFrame::OnCreate():
I couldn't find any samples containing SaveShortcuts, but I did notice that Load/SaveCommandBars() contains a call to matching shortcut functions, but my user-defined hotkeys remain non-persistent.
Any ideas?
Thanks!
- David
|
||
![]() |
||
Smucker ![]() Senior Member ![]() ![]() Joined: 02 February 2008 Status: Offline Points: 156 |
![]() ![]() ![]() ![]() ![]() |
|
I save my command bars, shortcuts, customize options, and docking panes to an XML file. This works for me:
void CMainFrame::ExchangeLayout(CXTPPropExchange* pPX, BOOL bSerializeControls /*= TRUE*/) { XTP_COMMANDBARS_PROPEXCHANGE_PARAM param; param.bSerializeControls = bSerializeControls; param.bSerializeOptions = TRUE; CXTPPropExchangeSection pxCommandBars(pPX->GetSection(_T("CommandBars"))); GetCommandBars()->DoPropExchange(&pxCommandBars, ¶m); CXTPPropExchangeSection secShortcuts(pPX->GetSection(_T("Shortcuts"))); GetCommandBars()->GetShortcutManager()->DoPropExchange(&secShortcuts); CXTPPropExchangeSection pxDockingPane(pPX->GetSection(_T("DockingPane"))); m_paneManager.DoPropExchange(&pxDockingPane); } In CMainFrame::OnCreate(): CXTPPropExchangeXMLNode px(TRUE, 0, _T("Settings")); // To serialize to XML file if (px.LoadFromFile(::g_XmlIniFile)) { CXTPPropExchangeSection pxNormalLayout(px.GetSection(_T("NormalLayout"))); ExchangeLayout(&pxNormalLayout); } in CMainFrame::OnClose(): CXTPPropExchangeXMLNode px(FALSE, 0, _T("Settings")); // To serialize to XML file if (px.OnBeforeExchange()) { CXTPPropExchangeSection pxNormalLayout(px.GetSection(_T("NormalLayout"))); ExchangeLayout(&pxNormalLayout); px.SaveToFile(::g_XmlIniFile); } Hope this helps. |
||
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)
Platform: Windows 200x/XP/Vista/Win7 (32/64 bit) Language: Visual C++ 9.0 (Studio 2008) |
||
![]() |
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 |