Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Load From XML ?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Load From XML ?

 Post Reply Post Reply
Author
Message
kanitamildasan View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 February 2006
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote kanitamildasan Quote  Post ReplyReply Direct Link To This Post Topic: Load From XML ?
    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
Back to Top
kanitamildasan View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 February 2006
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote kanitamildasan Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
kanitamildasan View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 February 2006
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote kanitamildasan Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
kanitamildasan View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 February 2006
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote kanitamildasan Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
kanitamildasan View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 February 2006
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote kanitamildasan Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
kanitamildasan View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 February 2006
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote kanitamildasan Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
kanitamildasan View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 February 2006
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote kanitamildasan Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
kanitamildasan View Drop Down
Senior Member
Senior Member
Avatar

Joined: 01 February 2006
Status: Offline
Points: 102
Post Options Post Options   Thanks (0) Thanks(0)   Quote kanitamildasan Quote  Post ReplyReply Direct Link To This Post 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
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.109 seconds.