![]() |
BackstageView & CommandUpdate Mechanism |
Post Reply
|
| Author | |
MGebler
Groupie
Joined: 18 May 2006 Location: Germany Status: Offline Points: 64 |
Post Options
Thanks(0)
Quote Reply
Topic: BackstageView & CommandUpdate MechanismPosted: 24 February 2011 at 2:24pm |
|
Is it possible to use the 'MFC Updating Command Mechanism' (ON_UPDATE_COMMAND_UI) for the commands and tabs, which were added by the AddCommand and AddTab methods?
A quick look inside the CXTPRibbonBackstageView implementation shows up that this general feature is not supported. Even a hard coded version does not work: CXTPControl* p = pView->AddCommand(ID_FILE_SAVE); p->SetEnabled( FALSE ); Am I wrong or was this feature simple forgotten? Thanks |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 February 2011 at 8:37am |
|
Hi,
yes, Update handler and Enabled property is not implemented for Backstage buttons.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
MGebler
Groupie
Joined: 18 May 2006 Location: Germany Status: Offline Points: 64 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 February 2011 at 4:13am |
|
Are there any plans to implement this feature?
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 February 2011 at 5:55am |
|
yes, already done for 15.0.2
Thanks for these points
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
cpede
Senior Member
Joined: 13 August 2004 Location: Denmark Status: Offline Points: 683 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 March 2011 at 9:03am |
|
Hi Oleg,
Could you please provide a small code example. If I assign a button to a command id handled by the normal command routing, it is not working?
-cpede
|
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 29 March 2011 at 8:15am |
|
What not working ?
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
cpede
Senior Member
Joined: 13 August 2004 Location: Denmark Status: Offline Points: 683 |
Post Options
Thanks(0)
Quote Reply
Posted: 29 March 2011 at 8:27am |
|
If I add the ID of an existing control to a backstage button, it does not automatically use the command routing already existing. Enabling and disabling the control etc.
If I add a ON_UPDATE_COMMAND_UI handler to my backstage page for e.g. a button, it is not called.
-cpede
|
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
![]() |
|
MGebler
Groupie
Joined: 18 May 2006 Location: Germany Status: Offline Points: 64 |
Post Options
Thanks(0)
Quote Reply
Posted: 29 March 2011 at 8:28am |
|
If you implement the command handling with
BEGIN_MESSAGE_MAP(CBackstagePage, CXTPRibbonBackstagePage) ON_COMMAND_EX(IDC_BUTTON,OnCommand) ON_UPDATE_COMMAND_UI(IDC_BUTTON,OnUpdateCommand) END_MESSAGE_MAP() the OnCommand mechanism works fine but the update handler OnUpdateCommand is never called. With best regards Marcus |
|
![]() |
|
leeyn
Newbie
Joined: 18 March 2011 Status: Offline Points: 5 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 March 2011 at 5:40am |
great news.... ![]() |
|
![]() |
|
MGebler
Groupie
Joined: 18 May 2006 Location: Germany Status: Offline Points: 64 |
Post Options
Thanks(0)
Quote Reply
Posted: 21 April 2011 at 3:59am |
|
Another
problem in paradise. Although the CXTPRibbonBackstagePage inherits from CXTPResizePropertyPage the methods ‘OnSetActive’ and ‘OnKillActive’ are never called. The approach to use the the OnShowWindow method works only for the case that the page becomes inactive. So we patched the CXTPRibbonBackstageView::SetActiveTab method and handle the notification inside each backstage page. if (pNewContent) { /* *** */ pOldContent->SendMessage( WM_NOTIFY, PSN_KILLACTIVE, NULL ); /* *** */ pOldContent->ShowWindow(SW_HIDE); pOldContent->SetParent(GetSite()); } Is there a better solution? With best regards Marcus |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 21 April 2011 at 5:27am |
|
Thanks, we will add something like it also.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
cpede
Senior Member
Joined: 13 August 2004 Location: Denmark Status: Offline Points: 683 |
Post Options
Thanks(1)
Quote Reply
Posted: 14 September 2016 at 10:58am |
|
In v17.2.0 you now call both OnSetActive and OnKillActive.
But you forgot to implement the return value for OnKillActive correctly. If returning FALSE I would expect that the backstage page would not close. This could be a way to prevent the page from changing if e.g. something needs to be addresses before closing. Or is there another way to prevent the page from closing? -cpede
|
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
![]() |
|
olebed
Senior Member
Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
Quote Reply
Posted: 16 September 2016 at 2:11pm |
|
Hello cpede,
I have added appropriate changes
Thank you to bringing this to our attention. Regards, Oleksandr Lebed |
|
![]() |
|
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 |