Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Saving Toolbars and Dockable Panes to XML file
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Saving Toolbars and Dockable Panes to XML file

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


Joined: 02 November 2006
Location: Germany
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote eclipse Quote  Post ReplyReply Direct Link To This Post Topic: Saving Toolbars and Dockable Panes to XML file
    Posted: 02 November 2006 at 9:46am
Hi,

I'm currently doing a project for a company. We decided it would be best to use the Xtreme toolkit pro for a project.  The application manages different project files. Toolbar positions as well as dockable pane visibilities. I need to be able to store the docking state in a separate file preferably an xml file.  Is this easily possible if so could anyone give me a hint where to look?
So far I found ways to save the state to the registry or an ini file. I have found the Pane example that allows saving the pane state to a xml file. Iwould need both saving pane positions and toolbar positions to a xml file or if this is not possible to a ini file of my choice.

Thanks,
Ingo
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: 02 November 2006 at 11:37am
Hello,
Check Samples\UserInterface\GUI_Whidbey  - Toolbars/Panes and Toolbox are stored to xml file.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
eclipse View Drop Down
Newbie
Newbie


Joined: 02 November 2006
Location: Germany
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote eclipse Quote  Post ReplyReply Direct Link To This Post Posted: 03 November 2006 at 3:13am
Thank you, that is what i was looking for.
Back to Top
eclipse View Drop Down
Newbie
Newbie


Joined: 02 November 2006
Location: Germany
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote eclipse Quote  Post ReplyReply Direct Link To This Post Posted: 03 November 2006 at 9:50am
Can you tell me if there is a way to save the Window placement using the same streaming machanism as for the control bars? So far I could only find Mehtods storing the data to the registry (LoadPlacement, SavePlacement). The WindowPos example uses SaveWindowPos(this), but the documentation does not tell where it stores the position.
I would like to store it in an xml file but dont know how. Any hints are appreciated.

Regards,
Ingo
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: 03 November 2006 at 10:51am

Hi,

 
See in help PX_Blob method and CXTPPropExchange class
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
eclipse View Drop Down
Newbie
Newbie


Joined: 02 November 2006
Location: Germany
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote eclipse Quote  Post ReplyReply Direct Link To This Post Posted: 06 November 2006 at 7:10am
Ok, thank you. Serializing the window placement seems to work but there is another question. To make it short: How can I access the GuiState node for reading in the following xml file:

<Application>
  <OtherData>
  </OtherData>

  <GuiState>
  ...
  </GuiState>
</Application>

Where OtherData is completeley unrelated to the XTremeToolkit Pro. So far i have tried using:

CXTPPropExchangeXMLNode px(TRUE, NULL, VM_XML_NODE);
pxRootNode.LoadFromFile( sFile.c_str() ) );
CXTPPropExchangeXMLNode pxGuiNode(TRUE, pxRootNode.GetSectionNode(), _T("GuiState"));

hoping to get access to the GUI node. This fails because it seems to create a new empty node.  The documentation is not very helpfull in this case. Examples like the following won't help me because they seem to imply the xml stores the data in its root node.

CXTPPropExchangeXMLNode px(TRUE, 0, _T("Settings"));
if (px.LoadFromFile(m_strIniFileName))
{
    m_wndTaskPanel.GetGroups()->DoPropExchange(&px);
}

Regards,
Ingo
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: 06 November 2006 at 7:18am
 Here sample:
 
CXTPPropExchangeXMLNode px(TRUE, NULL, _T("Application"));
pxRootNode.LoadFromFile( sFile.c_str() ) );
CXTPPropExchangeSection secGuiState(pxRootNode.GetSection(_T("GuiState")));
 
 // read/write to GuiState
  PX_DWord(&secGuiState, _T("Version"), m_dwVersion, 0);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
eclipse View Drop Down
Newbie
Newbie


Joined: 02 November 2006
Location: Germany
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote eclipse Quote  Post ReplyReply Direct Link To This Post Posted: 07 November 2006 at 5:36pm
OK, thank you. It's working now.
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.