Print Page | Close Window

Bad collapsed group image display

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=22753
Printed Date: 02 May 2024 at 8:34am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Bad collapsed group image display
Posted By: rdhd
Subject: Bad collapsed group image display
Date Posted: 12 October 2015 at 1:05pm
Running CJ 17 Beta 3. Using the Office 2010/2007 ribbon themes when a group has an image associated with it and the group is collapsed, CJ is not drawing the frame around the image in the correct spot (or is drawing a frame that should not be drawn. This only occurs with small icons. If we have large icons for the group, CJ uses it and we don't see the display issue. The display issues doesn't show up in the Office 2013 White theme we use. I can show this in the sample. I skipped registering the large icons and then stopped in debug and deposited the file new ID into the control group popup created when I resized the frame so the view tab's window group was collapsed. Here is the image. Note the "frame" drawn just above (and intersecting) the group icon. Looks like either the icon is in the wrong place or the "frame" is (but why even draw the frame). Comparing our ribbon with some collapsed groups using a large icon and some a small, I see the top edge of the "frame" aligns with the top edge of our large collapsed group icons. So the small icon is probably just dropped too low to cover up this "frame" we see.




We could use a fix for this.



Replies:
Posted By: rdhd
Date Posted: 12 October 2015 at 1:06pm
Inserted two images but only one showed up ( the PNG) but both were in the post before I submitted. Trying again.


Posted By: cpede
Date Posted: 02 September 2016 at 4:08am
When using v17.20 the collapsed group images in the Ribbon bar are displayed scaled (using a DPI of 125%) even m_bAutoResizeIcons is set to false. The normal icons are displayed correctly non scaled.

This is clearly a bug, where this m_bAutoResizeIcons flag is not taken into account when groups are collapsed in the Ribbon bar.

-cpede


-------------
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)


Posted By: olebed
Date Posted: 06 September 2016 at 7:54am
Hi,
I found that these icons of collapsed groups  are drawn in  CXTPRibbonPaintManager::DrawControlGroupPopup (pure virtual which are implemented in  CXTPRibbonThemeResource and CXTPRibbonMarkupTheme).

There used only XTP_DPI macros
CSize sz(XTP_DPI(pImageIcon->GetExtent()));
no m_bAutoResizeIcons.

I think it should depend on pCommandBar->GetCommandBars()->GetCommandBarsOptions()->GetToolbarsIconsScalling(). It can be checked with IsDPIIconsScallingEnabled(), but now this is standalone function, which should be  member of paintManager. After these changes  calculation icons of collapsed groups is

    CSize sz(pImageIcon->GetExtent());

    if (m_pPaintManager->IsDPIIconsScallingEnabled(pControlGroupPopup))
        sz = XTP_DPI(sz);


I'm not sure of using 
m_bAutoResizeIcons there. I think it is task to  refactoring Ribbon/CommandBar for using icons set for different DPIs.

Regards,
 Oleksandr Lebed


Posted By: cpede
Date Posted: 06 September 2016 at 8:55am
Of cause the group icons should follow the m_bAutoResizeIcons flag.

So will this be corrected for v17.3.0?

-cpede


-------------
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)


Posted By: cpede
Date Posted: 26 September 2016 at 10:25am
Can anyone confirm that this will be fixed in v17.3?

-cpede


-------------
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)


Posted By: cpede
Date Posted: 31 October 2016 at 4:42am
Still not fixed in v17.3!

See Ribbon Sample, set Ribbon icons to not Auto Size Icons, and collaps the INSERT group and look at the Symbols group icon when collapsed.



-cpede


-------------
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)


Posted By: cpede
Date Posted: 09 February 2017 at 4:08pm
After the fix for the images on the tooltips, please also fix the problem with icons on the collapsed ribbon group tabs.

-cpede 


-------------
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)


Posted By: olebed
Date Posted: 09 June 2017 at 9:11am
Hello,

I'm glad to inform your that issues with scaling of group icons have fixed.
Added dependency from m_pPaintManager->m_bAutoResizeIcons and m_pPaintManager->IsDPIIconsScallingEnabled()  in  CXTPRibbonMarkupTheme::DrawControlGroupPopup()  and CXTPRibbonThemeResource::DrawControlGroupPopup

/*code moved to next post to prevent duplication.*/

Fix will be available soon in final v18.0

Regards,
 Oleksandr Lebed


Posted By: olebed
Date Posted: 14 June 2017 at 6:42am
Originally posted by rdhd rdhd wrote:

Running CJ 17 Beta 3. Using the Office 2010/2007 ribbon themes when a group has an image associated with it and the group is collapsed, CJ is not drawing the frame around the image in the correct spot (or is drawing a frame that should not be drawn. This only occurs with small icons. If we have large icons for the group, CJ uses it and we don't see the display issue. The display issues doesn't show up in the Office 2013 White theme we use. I can show this in the sample. I skipped registering the large icons and then stopped in debug and deposited the file new ID into the control group popup created when I resized the frame so the view tab's window group was collapsed. Here is the image. Note the "frame" drawn just above (and intersecting) the group icon. Looks like either the icon is in the wrong place or the "frame" is (but why even draw the frame). Comparing our ribbon with some collapsed groups using a large icon and some a small, I see the top edge of the "frame" aligns with the top edge of our large collapsed group icons. So the small icon is probably just dropped too low to cover up this "frame" we see.


We could use a fix for this.


Hello rdhd,

I found solution for this issue. Mistake was in the same method DrawControlGroupPopup() 
CSize CXTPRibbonThemeResource::DrawControlGroupPopup(CDC* pDC, CXTPControlPopup* pControlGroupPopup, BOOL bDraw)
{
    ASSERT(pDC);
    ASSERT(pControlGroupPopup);
    CXTPRibbonGroup *pRibbonGroup = pControlGroupPopup->GetRibbonGroup();

    if (!pRibbonGroup)
    {
    ....
    }

    if (bDraw)
    {
    ....
    }
....
if (bDraw) { CXTPImageManagerIcon* pImageIcon = pControlGroupPopup->GetImage(pControlGroupPopup->GetIconSize().cx); BOOL bDrawImage = (pImageIcon != NULL); CRect rcButton = pControlGroupPopup->GetRect(); if (bDrawImage)
        {
            CSize sz(m_pPaintManager->m_bAutoResizeIcons ? m_pPaintManager->GetAutoIconSize(TRUE) : pImageIcon->GetExtent());
            
            if (m_pPaintManager->IsDPIIconsScallingEnabled(pControlGroupPopup))
                sz = XTP_DPI(sz);
            
            CPoint pt = CPoint(rcButton.CenterPoint().x - sz.cx / 2, rcButton.top + XTP_DPI_Y(9));

if (sz.cx < XTP_DPI_X(20)) { CXTPResourceImage* pImageButton = LoadImage(FormatName(_T("RIBBONGROUPBUTTONICON"))); CSize szImageButton(pImageButton != NULL ? pImageButton->GetExtent() : sz);
//Increase ImageButton if it is smaller than icon const int nImageButtonMarginX = XTP_DPI_X(5) * 2; if ((szImageButton.cx - sz.cx) < nImageButtonMarginX) szImageButton.cx = sz.cx + nImageButtonMarginX; const int nImageButtonMarginY = XTP_DPI_Y(5) * 2; if ((szImageButton.cy - sz.cy) < nImageButtonMarginY) szImageButton.cy = sz.cy + nImageButtonMarginY;
CRect rc(CPoint(rcButton.CenterPoint().x - szImageButton.cx / 2, rcButton.top + XTP_DPI_Y(2)), szImageButton); if (pImageButton) pImageButton->DrawImage(pDC, rc, pImageButton->GetSource(0, 1), CXTPEmptyRect()); pt.x = rc.CenterPoint().x - sz.cx / 2; pt.y = rc.CenterPoint().y - sz.cy / 2; }

            m_pPaintManager->DrawImage(pDC, pt, sz, pImageIcon,
                pControlGroupPopup->GetSelected(), pControlGroupPopup->GetPressed(),
                pControlGroupPopup->GetEnabled(), FALSE, pControlGroupPopup->GetPopuped());
        }
....
}
Regards,
 Oleksandr Lebed


Posted By: rdhd
Date Posted: 15 June 2017 at 5:45pm
Hi Oleksandr,

That's good news. I assume we will have a fix in an upcoming release.

By the way, I used to get e-mails for replies. I just happened to log in today for another reason and saw the recent activity UI and recognized that it was a reply to this issue I posted. Not sure why I'm not getting e-mails.


Posted By: olebed
Date Posted: 16 June 2017 at 3:43am
Hello rdhd,

I think your e-mail is correct,  and can suppose that you press "Un-Watch this topic" in "Topic Options" in upper left corner of this page. (icon with red gear). To return back notification press "Watch this topic", however if you post here something then it should turns on notifications again.

Also I have fixed one another issue - ribbon group icons are drawn only with the smallest available size. It is unacceptable in HighDPI monitors. Changes in the same methods CXTPRibbonMarkupTheme::DrawControlGroupPopup()  and CXTPRibbonThemeResource::DrawControlGroupPopup(). I have changed code snippet in post above.
CXTPImageManagerIcon* pImageIcon = pControlGroupPopup->GetImage(pControlGroupPopup->GetIconSize().cx);

Regards,
 Oleksandr Lebed



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