Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Saving placement of panes and command bar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Saving placement of panes and command bar

 Post Reply Post Reply
Author
Message
simus View Drop Down
Groupie
Groupie


Joined: 08 July 2005
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote simus Quote  Post ReplyReply Direct Link To This Post Topic: Saving placement of panes and command bar
    Posted: 12 December 2005 at 7:42am

Hi,

I made functions to load and save the pane layout and command bars

I have a problem with the command bars, sometimes it is ok sometimes not. For instance the placement is sometime loaded only after the 2nd try. Or a same toolbar item that is at pos 1 in a saved file and at pos 10 in a 2nd saved file, after loading sevaral times 1st and 2nd file I have the toolbar item at pos 1 AND 10.

Does anyone see something wrong in the following?

void CMainFrame::SavePlacementToFile(CString filePath){
  // Save the layout
  CXTPPropExchangeXMLNode px(FALSE, 0, _T("Settings"));
  CXTPPropExchangeSection pxLayout(px.GetSection(_T("Layout")));
  m_layout->DoPropExchange(&pxLayout);

  //Save the command bars
  XTP_COMMANDBARS_PROPEXCHANGE_PARAM param;
  param.bSerializeControls=TRUE;
  param.bSaveOnlyCustomized=TRUE;
  param.bSerializeImages=TRUE;
  param.pCommandBars = GetCommandBars();

  CXTPPropExchangeSection pxCommandBars(px.GetSection(_T("CommandBars")));
  GetCommandBars()->DoPropExchange(&pxComma ndBars, &param);
  px.SaveToFile(filePath);
}


void CMainFrame::LoadPlacementFromFile(CString filePath){
  CXTPPropExchangeXMLNode px(TRUE, 0, _T("Settings"));
  if ( px.LoadFromFile(filePath) ){
   // Load the pane layout
   CXTPPropExchangeSection pxLayout(px.GetSection(_T("Layout")));
   m_layout->DoPropExchange(&pxLayout) ;
   m_paneManager.SetLayout(m_layout);

   //Load the command bars
   XTP_COMMANDBARS_PROPEXCHANGE_PARAM param;
   param.bSerializeControls=TRUE;
   param.bSaveOnlyCustomized=TRUE;
   param.bSerializeImages=TRUE;
   param.pCommandBars = GetCommandBars();

   CXTPPropExchangeSection pxCommandBars(px.GetSection(_T("CommandBars")));
    GetCommandBars()->DoPropExchange(&pxComma ndBars, &param);
   GetCommandBars()->RedrawCommandBars();
  }
}

 

Thanks a lot!

Back to Top
simus View Drop Down
Groupie
Groupie


Joined: 08 July 2005
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote simus Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2005 at 3:02am

Hi again,

Attached a simple VC project that shows the problem.

The scenario is :

  1. Use View->Save to file and create "BlankPlacement.xml" file
  2. Use customization to add a new toolbar Custom 1 and move some buttons
  3. Close and restart the layout are correctly saved here
  4. Now use the View->Load from file to load "BlankPlacement.xml", the Custom 1 is still there and the moved buttons are not correct

Please help on we really need this cool feature

Thanks2005-12-13_030222_LoadSavePlacementWsp.zip

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 14 December 2005 at 5:36am
Answered in issuetrack...
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.047 seconds.