![]() |
Load From XML ? |
Post Reply ![]() |
Author | |
kanitamildasan ![]() Senior Member ![]() ![]() Joined: 01 February 2006 Status: Offline Points: 102 |
![]() ![]() ![]() ![]() ![]() 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 |
|
![]() |
|
kanitamildasan ![]() Senior Member ![]() ![]() Joined: 01 February 2006 Status: Offline Points: 102 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
kanitamildasan ![]() Senior Member ![]() ![]() Joined: 01 February 2006 Status: Offline Points: 102 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
kanitamildasan ![]() Senior Member ![]() ![]() Joined: 01 February 2006 Status: Offline Points: 102 |
![]() ![]() ![]() ![]() ![]() |
Hi, I am still looking for solution...
![]() |
|
Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2 Visual C++ 6.0 SP 6 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
kanitamildasan ![]() Senior Member ![]() ![]() Joined: 01 February 2006 Status: Offline Points: 102 |
![]() ![]() ![]() ![]() ![]() |
Thanks Oleg,
Now it works ![]() |
|
Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2 Visual C++ 6.0 SP 6 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
kanitamildasan ![]() Senior Member ![]() ![]() Joined: 01 February 2006 Status: Offline Points: 102 |
![]() ![]() ![]() ![]() ![]() |
Thanks oleg, I will checkout...
|
|
Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2 Visual C++ 6.0 SP 6 |
|
![]() |
|
kanitamildasan ![]() Senior Member ![]() ![]() Joined: 01 February 2006 Status: Offline Points: 102 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi, Thanks, guess indeed need to hide it in customize dialog. Wie will check it.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
kanitamildasan ![]() Senior Member ![]() ![]() Joined: 01 February 2006 Status: Offline Points: 102 |
![]() ![]() ![]() ![]() ![]() |
Hi, Thanks for considering point [2].
|
|
Xtreme ToolkitPro 12.1.1
Win XP (32bit) - SP2 Visual C++ 6.0 SP 6 |
|
![]() |
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 |