Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Strange ribbon layout when groups height increased
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Strange ribbon layout when groups height increased

 Post Reply Post Reply
Author
Message
Tsenoh View Drop Down
Groupie
Groupie
Avatar

Joined: 08 November 2006
Status: Offline
Points: 69
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tsenoh Quote  Post ReplyReply Direct Link To This Post Topic: Strange ribbon layout when groups height increased
    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
Back to Top
Tsenoh View Drop Down
Groupie
Groupie
Avatar

Joined: 08 November 2006
Status: Offline
Points: 69
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tsenoh Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Tsenoh View Drop Down
Groupie
Groupie
Avatar

Joined: 08 November 2006
Status: Offline
Points: 69
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tsenoh Quote  Post ReplyReply Direct Link To This Post 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


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.