I have been chasing an issue with a collapsed group display being wrong when I click on the group and the popup displays. This is rare for us and I finally found the difference for groups that display fine and those where the display is wrong. It turns out the issue shows up when we have the XCTPRibbonGroup::m_bControlsGrouping flag set.
In order for this problem to show up, large buttons using the style iconAndCaptionBelow are in the group.
I found this method: CXTPRibbonGroup::_CalcSpecialDynamicSize
and this code in the method:
int nOffset = (nResultHeight + XTP_DPI_Y(1) - nBaseHeight * nRowCount) / (nRowCount + 1); int nTotalOffset = nOffset;
Following that is a loop where nTotalOffset is incremented by an offset based on a control wrap flag. In my case, there is no wrap flag set. I don't think that matters. The problem I have is that nOffset determined by that line where it is declared becomes a rather large value. The the CONTROLINFO rcControl member is offset, the display result is everything is shifted down. Either the buttons are outside the popup rectangle, or the buttons overlap the group caption text centered at the bottom of the popup.
If I change to:
int nOffset = 0;
The display is fine. If I monitor the CXTPControl::SetRect, on groups that don't controls grouping set, when I click those collapsed groups, the top row of buttons in the popup all have a value of 4 for "top". In my case, DPI adjusted to 200%, that value is being set to 43.
If I change the button style to icon, the popup window is still very tall and the buttons are centered in the window. Again, initializing nOffset to zero fixes that issue too.
Is this a bug in CodeJock? Or is there something else I should be looking at? Image where m_bCnotrolsGroups is true:
Image where m_bControlGrouping is false. Same ribbon just a different group:
We set grouping on the "Configurations" group because we have a combo box in it and that solved some layout issues in the group.
When I add all the controls to the group I see this:
If I stop and set the offset to zero I see this:
If I turn off m_bControlsGrouping I get a good look:
So, I have not yet figured it all out. When that combo box is in the group, the popup height isn't correct and I haven't found out yet why.
|