Print Page | Close Window

Load From XML ?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=14293
Printed Date: 23 May 2024 at 3:40pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Load From XML ?
Posted By: kanitamildasan
Subject: Load From XML ?
Date Posted: 14 May 2009 at 1:41am
Hi,

We have to show/hide/remove/add command bar controls/menu items at load time.
Currently we are using the .rc file to modify and compile the app everytime we need to just hide/remove menuitem from the app.
Is XT provides us the option to load CommandBars from XML file with Visibility option ?
So that we can just modify the XML and ship the app rather than recompile it.

Thanks



-------------
Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2
Visual C++ 6.0 SP 6



Replies:
Posted By: kanitamildasan
Date Posted: 14 May 2009 at 5:33am
Hi,

CommandBars Designer provides option to export to XML file. But i dont know how to load the XML file (not the binary XCB file) at app load time.

Thanks



-------------
Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2
Visual C++ 6.0 SP 6


Posted By: kanitamildasan
Date Posted: 14 May 2009 at 5:47am
Hi,

I tried this code in the Designer Sample. But it didnt worked ? The XML file i used is just the export of Sample.xcb using CommandBarDesigner.

void CMainFrame::GenerateCommandBars()
{
    CXTPCommandBars* pCommandBars = GetCommandBars();
    pCommandBars->SetMenu(_T("Menu Bar"), 0);   
    
    CXTPPropExchangeXMLNode px(TRUE, 0, _T("DesignerFile"));

    if (px.LoadFromFile("F:\\Program Files\\Codejock Software\\MFC\\Xtreme ToolkitPro v12.1.1\\AllSamples\\DesignerSamples\\Sample.xml"))
    {
        pCommandBars->LoadDesignerBars(&px);
    }
}

Thanks




-------------
Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2
Visual C++ 6.0 SP 6


Posted By: kanitamildasan
Date Posted: 15 May 2009 at 12:49am
Hi, I am still looking for solution...

-------------
Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2
Visual C++ 6.0 SP 6


Posted By: Oleg
Date Posted: 15 May 2009 at 1:41am
Hi,
 
Actually its right code - you only need initialize OLE in  beginning of  CDesignerSampleApp::InitInstance()
 
add this line:
AfxOleInit();


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: kanitamildasan
Date Posted: 15 May 2009 at 2:23am
Thanks Oleg,

Now it works But how to change the Visible property of the control using XML or CommandBar Designer ?



-------------
Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2
Visual C++ 6.0 SP 6


Posted By: Oleg
Date Posted: 15 May 2009 at 3:53am

Hi,

Guess best way is to hide them in code using Actions. Enable actions in Designer and in code add
pCommandBars->GetActions()->GetAction(ControlID)->SetVisible(FALSE); - and it will hide all occurence of controls with Id = ControlID
Also in CommanBars run Menu->CommandBars->Resource Symbols ->Export ->(*.h) to export all controls names you have.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: kanitamildasan
Date Posted: 15 May 2009 at 8:29am
Thanks oleg, I will checkout...


-------------
Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2
Visual C++ 6.0 SP 6


Posted By: kanitamildasan
Date Posted: 18 May 2009 at 6:17am
Hi,

1) I still dont get the Actions features usefulness can you share an example situation where Actions is more appropriate than the old command ui update of MFC.


2)I have checked out the Action Sample and set the visible of "Status Bar" to FALSE using the checkbox. But the Commands page in the customization dialog still shows the "Status Bar" in it. Is that right behaviour ?




-------------
Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2
Visual C++ 6.0 SP 6


Posted By: Oleg
Date Posted: 20 May 2009 at 2:09am

Hi,

 
Thanks, guess indeed need to hide it in customize dialog. Wie will check it.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: kanitamildasan
Date Posted: 20 May 2009 at 4:02am
Hi, Thanks for considering point [2].





-------------
Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2
Visual C++ 6.0 SP 6



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