Print Page | Close Window

[solved] icon in Pane title with VS 2015 themes

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=23504
Printed Date: 19 January 2018 at 4:45am


Topic: [solved] icon in Pane title with VS 2015 themes
Posted By: Vycheslav
Subject: [solved] icon in Pane title with VS 2015 themes
Date Posted: 27 November 2017 at 5:09am
AX CodeJock 18.2.0 versions (or other before) Visual Studio 6 or Visual Studio 2017

Pane title with icon (Visual Studio 2015 Light)


Pane title with icon (Microsoft Office 2016 DarkGray)


This is themes bug or my mistake?



Replies:
Posted By: rdhd
Date Posted: 28 November 2017 at 1:41pm
After pulling 18.0.1 we found some dialogs we had that used a ribbon had a similar looking bug. The tab region where we had a single tab displayed black in the entire area to the right of the tab. We were calling EnableFrameTheme(FALSE). I change to send in TRUE and it "fixed" the issue. But of course, the entire look of the dialog changed to boot.


Posted By: Vycheslav
Date Posted: 29 November 2017 at 3:30am
This dialog placed on the floating pane (DockingPane Object). See the icon on title bar. Title text putting under icon with all Visual Studio 2015 themes and putting correcttly with other themes. Property ...Options.ThemedFloatingFrames set to True.


Posted By: olebed
Date Posted: 05 December 2017 at 11:17pm
Hello Vycheslav,

Thank you for information. I have solved this issue. Fix will be available in next release.
Problem was in drawing order in method CXTPDockingPaneVisualStudio2015Theme::DrawTitleBar
The same issue in VS2012 theme (CXTPDockingPaneVisualStudio2012Theme::DrawTitleBar)
// old version
void CXTPDockingPaneVisualStudio2015Theme::DrawTitleBar(CDC *pDC, CXTPDockingPaneBase *pPane, CRect rcCaption, BOOL bVertical)
{
......

    pDC->SetTextColor(pColorSet->m_clrText);
    int nWidth = DrawCaptionText(pDC, pPane->GetTitle(), rcCaption, bVertical, TRUE);

    if (NULL == hCustomBrush)
    {
        CRect rcGripper(rcCaption);

        if (bVertical)
        {
            rcGripper.top += nWidth + XTP_DPI_Y(5);
            rcGripper.left += ((rcCaption.Width() - XTP_DPI_X(5)) / 2);
        }
        else
        {
            rcGripper.top += ((rcCaption.Height() - XTP_DPI_Y(5)) / 2);
            rcGripper.left += nWidth + XTP_DPI_X(5);
        }

        DrawGripper(pDC, rcGripper, pColorSet->m_clrGripper, bVertical);
    }

    DrawCaptionIcon(pDC, pPane, rcCaption, bVertical);
    DrawCaptionButtons(pDC, pPane->GetCaptionButtons(), rcCaption, pColorSet->m_clrText, XTP_DPI_X(16), 0, bVertical);
}

// fixed version
void CXTPDockingPaneVisualStudio2015Theme::DrawTitleBar(CDC *pDC, CXTPDockingPaneBase *pPane, CRect rcCaption, BOOL bVertical)
{
......

    DrawCaptionIcon(pDC, pPane, rcCaption, bVertical);
    
    pDC->SetTextColor(pColorSet->m_clrText);
    int nWidth = DrawCaptionText(pDC, pPane->GetTitle(), rcCaption, bVertical, TRUE);

    DrawCaptionButtons(pDC, pPane->GetCaptionButtons(), rcCaption, pColorSet->m_clrText, XTP_DPI_X(16), 0, bVertical);
    
    if (NULL == hCustomBrush)
    {
        CRect rcGripper(rcCaption);

        if (bVertical)
        {
            rcGripper.top += nWidth + XTP_DPI_Y(5);
            rcGripper.left += ((rcCaption.Width() - XTP_DPI_X(5)) / 2);
        }
        else
        {
            rcGripper.top += ((rcCaption.Height() - XTP_DPI_Y(5)) / 2);
            rcGripper.left += nWidth + XTP_DPI_X(5);
        }

        DrawGripper(pDC, rcGripper, pColorSet->m_clrGripper, bVertical);
    }
}

Regards,
 Oleksandr Lebed



Print Page | Close Window