Print Page | Close Window

Strange ribbon layout when groups height increased

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=5852
Printed Date: 01 October 2024 at 8:27pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Strange ribbon layout when groups height increased
Posted By: Tsenoh
Subject: Strange ribbon layout when groups height increased
Date Posted: 20 December 2006 at 12:51pm
Hi!

I have following problem:


I needed a larger Toolbar in order to place my ListBox on the first Tab. As the result, the other controls are oddly positioned. The vertical space  between two buttons is not always the same, and seams to be bigger if the controls are lower on the Toolbar.

Is this a bug? Have you seen this before?

It looks like the calculation problem. I will try to find the problem myself, and if I do, I will let you know.

Greets,

Bojan Hrnkas



Replies:
Posted By: Tsenoh
Date Posted: 20 December 2006 at 1:03pm
Btw, is it possible to force buttons that have style xtpButtonIconAndCaptionBelow to be placed in two or more rows if there is enough space?

Thanks!

Bojan


Posted By: Tsenoh
Date Posted: 20 December 2006 at 1:42pm
Found it!
It is in
CXTPRibbonGroup::CenterColumn, file XTPRibbonGroups.cpp, line 773.

Code:
        pControl->rcControl.OffsetRect(0, nOffset);
        nOffset += nOffset;

With each iteration, the offset is doubling, instead of increasing by the original offset. I would suggest something like this:

    int nOffsetStep = (nGroupHeight - nHeight) / (nItems + 1);
    int nOffset = nOffsetStep;
        .
        .
        .        
        pControl->rcControl.OffsetRect(0, nOffset);
        nOffset += nOffsetStep;

Sincerely,

Bojan Hrnkas





Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net