[SOLVED]Backstage 2016 Style Left Aligned Controls |
Post Reply |
Author | |
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
Posted: 16 October 2020 at 2:08am |
There is a bug when using the full page xtpRibbonBackstageOffice2016Style style.
When adding controls directly to the Ribbon, like the Minimize and Maximize Ribbon buttons, they are typically right aligned using e.g. pControlMinimize->SetFlags(xtpFlagRightAlign); But if you omit this, and want the control to be left aligned, it is not hidden when opening the backstage in full mode. It can easily be seen in the Ribbon sample, by removing the following line:
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
Any solution for this one?
Easy to reproduce in your samples.
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
dbrookes
Groupie Joined: 30 August 2019 Location: Australia Status: Offline Points: 70 |
Post Options
Thanks(0)
|
As far as I can tell controls on the left side of ribbon tabs don't get given the xtpFlagRibbonTabBackground flag that controls on the right side of the ribbon tabs get. That flag does note that its for controls on the right side of the ribbon tabs. From CXTPRibbonBar Reposition:
Therefore in CXTPRibbonBackstageView Popup these left side controls that don't have that flag are not hidden and added to m_listControlsToBeVisible to be made visible again later. You might be able to override something in CXTPRibbonBar or CXTPRibbonBackstageView to work around this. Regards, Daniel.
|
|
dbrookes
Groupie Joined: 30 August 2019 Location: Australia Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Actually thinking about it it may be possible to do something like this in the idle update handler for the command.
|
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
Thanks for enlighten me, and pointing to the code causing the problem.
I really don't understand the code in bold. It seems that the are using the flag dynamically? I understand that if the user don't specify the xtpFlagRibbonTabBackground flag for right-aligned controls, they don't experience the Office way of showing the backstage, hiding the right-aligned control. So this is a kind of automatic feature, hiding all right-aligned controls in the ribbon to make it compatible. But if the user manually add the xtpFlagRibbonTabBackground flag, why is it necessary to remove it, and showing left-aligned controls? When do you want to show a left-aligned control when the backstage is active? I think this code can be removed, solving my problem. Alternatively overwriting the virtual CalcDockingLayout method, calling the default implementation and re-assign the xtpFlagRibbonTabBackground flag to the left-aligned controls. |
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
dbrookes
Groupie Joined: 30 August 2019 Location: Australia Status: Offline Points: 70 |
Post Options
Thanks(0)
|
I think your right that xtpFlagRibbonTabBackground is a dynamic flag. Adding it yourself to the control doesn't really do anything useful as it will just be kept or removed the next time the ribbon recalculates its layout. I think this bug of it not hiding on left side controls when the backstage is visible is just an oversight. The old Office themes still showed the tab background part of the ribbon bar when the backstage was opened, so this case probably just got missed. An alternative, if you're going to patch it, you could adjust the rcControl and m_rcTabControl check to also check if the control is left of the tab control.
|
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
I removed the highlighted lines and everything works perfectly. I think you are right; most of this code, checking for non-right-aligned controls, can be skipped entirely for full page backstage modes aka. Office 2013/2016.
So, if anyone from CodeJock is listening in, please make the correction.
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
agontarenko
Admin Group Joined: 25 March 2016 Status: Offline Points: 291 |
Post Options
Thanks(0)
|
Hello, I'm glad to inform you that the issue has been addressed and fixed. The fix will be available in the next beta or final release. Regards, Artem Gontarenko
|
|
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 |