![]() |
Bug report: Ribbon group resize problem |
Post Reply
|
| Author | |
Jimor Marlow
Groupie
Joined: 03 June 2007 Location: Russian Federation Status: Offline Points: 30 |
Post Options
Thanks(0)
Quote Reply
Topic: Bug report: Ribbon group resize problemPosted: 13 August 2007 at 3:40pm |
|
I'm afraid I've found the bug in ribbon group reduce logic for gallery and button.
You can see this in RibbonSample. Just add simple button before styles gallery control, f.e.: MainFrm.cpp, ln.598: BOOL CMainFrame::CreateRibbonBar() { ... CXTPRibbonGroup* pGroupStyles = pTabHome->AddGroup(ID_GROUP_STYLES); pGroupStyles->Add(xtpControlButton, ID_CHAR_ITALIC); // <- Resize bug when reducing pControlGallery = (CXTPControlGallery*)pGroupStyles->Add(new CXTPControlGallery(), ID_GALLERY_STYLES); ... } add any simple button, run app, and start to reduce width of main frame. When styles group start to reduce its width you'll get stuck in the endless loop, trying to reduce group size in the BOOL CXTPRibbonGroup::OnReduceSize(int nLevel){ ... do { bReduced = FALSE; for (int nLevel = 0; nLevel < 4; nLevel++) { for (int i = GetCount() - 1; i >= 0; i--) { CXTPRibbonGroup* pGroup = GetAt(i); if (!pGroup->IsVisible()) continue; if (pGroup->OnReduceSize(nLevel)) // ln.754, here the bug, // on nLevel=2, this procedure still signaled TRUE, // like it successfully reduced, instead of fail. { pWidth = pGroup->OnCalcDynamicSize(pDC); bReduced = TRUE; break; } } if (bReduced) break; } if (bReduced) { nResult = _CalcSmartLayoutToolBar(pWidth); if (nResult < nWidth) return; } } while (bReduced); } Fix it, please. I've forund workaround for current code forewhile: add button after gallery and SetBeginGroup(TRUE) for button (important condition!). In this case all works fine. f.e: // BOOL CMainFrame::CreateRibbonBar(), ln.~618 pGroupStyles->Add(xtpControlButtonPopup, ID_STYLES_CHANGE); pGroupStyles->Add(xtpControlButton, ID_CHAR_ITALIC)->SetBeginGroup(TRUE); // workaround for resize bug CXTPRibbonGroup* pGroupFind = pTabHome->AddGroup(ID_GROUP_FIND); |
|
![]() |
|
Jimor Marlow
Groupie
Joined: 03 June 2007 Location: Russian Federation Status: Offline Points: 30 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 August 2007 at 3:44pm |
|
FYI: Xtreme ToolkitPro v11.1.3
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 14 August 2007 at 1:19am |
|
Hello,
Thanks, fixed now.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
sulla138
Newbie
Joined: 09 January 2007 Location: United States Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 14 August 2007 at 1:49pm |
|
Hi,
We're having the same issue. How can I get your fix? thanks, Mike |
|
![]() |
|
Jimor Marlow
Groupie
Joined: 03 June 2007 Location: Russian Federation Status: Offline Points: 30 |
Post Options
Thanks(0)
Quote Reply
Posted: 14 August 2007 at 6:37pm |
|
I think we should wait for fixed release. But forewhile you can use workaround I’ve wrote above:
Move all button after galley, and specify the first button as start of new group (btn->SetBeginGroup(TRUE)). My sample:
It's work fine. |
|
![]() |
|
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 |