![]() |
Managing Menus in Designer Apps |
Post Reply ![]() |
Author | |
voripteth ![]() Newbie ![]() ![]() Joined: 24 March 2009 Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() Posted: 24 March 2009 at 2:46pm |
I have a MDI app that is using Designer to load command bars and menus. I'm trying to get the app to work like a traditional windows app with an abbreviated menu when no documents are open. The DesignerSample has been my guide in creating the resources but unfortunately that example use the same menu when no documents are open.
ActionsSample looked promising since it can hide/disable menus and toolbars at the same time. The code looks pretty straightforward but it isn't working as I expected. I can't seem to find any documentation on Control Actions so I must be missing something. I added code to CMainFrame::LoadFrame in the DesignerSample code: ... LoadCommandBars(lpProfile); // new code CXTPCommandBars* pCommandBars = GetCommandBars(); CXTPControlActions* pActions = pCommandBars->GetActions(); CXTPControlAction* pAction = pActions->FindAction(ID_FILE_SAVE); if (pAction) pAction->SetVisible (FALSE); // Hide Edit menu When this code executes pAction is always NULL. ID_FILE_SAVE is there in the toolbar and menu. Looking into pActions with the debugger I see that m_arrActions has no items in it. What needs to be done to get the Actions array populated? If there is a better way to getting the two sets of command bars for document/no document please let me know. Thanks! |
|
Product: ToolkitPro (MFC) v13.0.0
Platform: Windows XP(32bit)-SP 3 Language: VC++ 2008 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Are you sure you enabled Actions in Designer ?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
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 |