Print Page | Close Window

Missing fixes in Codejock MFC ToolKitPro 17.3.0

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=23209
Printed Date: 23 December 2024 at 3:33pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Missing fixes in Codejock MFC ToolKitPro 17.3.0
Posted By: Sergio
Subject: Missing fixes in Codejock MFC ToolKitPro 17.3.0
Date Posted: 23 November 2016 at 11:49am

Hello,
Please add these fixes to the next release :


Our Codejock MFC ToolKit Pro 17.2.0 fixes that still aren’t in 17.3.0

Source\Ribbon\Themes\XTPRibbonThemeOffice2007System.cpp

Before:

CXTPRibbonThemeOffice2007System::CXTPRibbonThemeOffice2007System(CXTPPaintManager *pPaintManager)
       : CXTPRibbonMarkupTheme(pPaintManager)
{
       LoadResource();
       if (XTPSystemVersion()->IsWinVistaOrGreater())
       {
              m_pPaintManager->m_bUseOfficeFont = TRUE;
              m_pPaintManager->m_strOfficeFont = _T("Segoe UI");
              m_pPaintManager->SetFontHeight(XTP_DPI_Y(12));
       }
}


After:
We perhaps need an additional variable in the pPaintManager to tell that the font shouldn’t be changed.

CXTPRibbonThemeOffice2007System::CXTPRibbonThemeOffice2007System(CXTPPaintManager *pPaintManager)
       : CXTPRibbonMarkupTheme(pPaintManager)
{
       LoadResource();
       // This fix is needed to avoid a whole interface font change when displaying a ribbon bar inside a MDI document
       // For the new UI, we will use CXTPRibbonOffice2013Theme instead of CXTPRibbonThemeOffice2007System
       //if (XTPSystemVersion()->IsWinVistaOrGreater())
       //{
       //     m_pPaintManager->m_bUseOfficeFont = TRUE;
       //     m_pPaintManager->m_strOfficeFont = _T("Segoe UI");
       //     m_pPaintManager->SetFontHeight(XTP_DPI_Y(12));
       //}
}


Source\SkinFramework\XTPSkinManagerSchema.cpp

Before:

void CXTPSkinManagerSchema::DrawNonClientRect(CDC* pDC, CRect rcFrame, CXTPSkinObjectFrame* pFrame)

{
       DWORD dwExStyle = pFrame->GetExStyle();
       DWORD dwStyle = pFrame->GetStyle();

       if (dwExStyle & WS_EX_WINDOWEDGE)
       {
              DrawEdge(pDC->GetSafeHdc(), &rcFrame, EDGE_RAISED, BF_RECT | BF_ADJUST);
       }
       else if (dwExStyle & WS_EX_STATICEDGE)
       {
              DrawEdge(pDC->GetSafeHdc(), &rcFrame, BDR_SUNKENOUTER, BF_RECT | BF_ADJUST);
       }
       else if ((dwStyle & WS_CAPTION) == WS_CAPTION
              || (dwStyle & DS_MODALFRAME)
              || (dwExStyle & WS_EX_DLGMODALFRAME))
       {



After:
OK. This was the fix you recommended us to do, and you have included it in the 17.3.0 release.

void CXTPSkinManagerSchema::DrawNonClientRect(CDC* pDC, CRect rcFrame, CXTPSkinObjectFrame* pFrame)
{
       DWORD dwExStyle = pFrame->GetExStyle();
       DWORD dwStyle = pFrame->GetStyle();

       if (dwExStyle & WS_EX_WINDOWEDGE)
       {
              DrawEdge(pDC->GetSafeHdc(), &rcFrame, EDGE_RAISED, BF_RECT | BF_ADJUST);
       }
       else if (dwExStyle & WS_EX_STATICEDGE)
       {
              DrawEdge(pDC->GetSafeHdc(), &rcFrame, BDR_SUNKENOUTER, BF_RECT | BF_ADJUST);
       }
       else if ((dwStyle & WS_CAPTION) == WS_CAPTION
              || (dwExStyle & WS_EX_DLGMODALFRAME))
       {


Source\SkinFramework\XTPSkinObjectTab.cpp

Before:

void CXTPSkinObjectTab::FillTabFace(CDC* pDC, CRect rcItem, int iItem,
       int iCount, BOOL bSelected, BOOL bFocused)
{
       if (GetStyle() & TCS_BUTTONS)
       {
              CXTPSkinManagerClass* pClassButton = GetSkinManager()->GetSkinClass(this, _T("BUTTON"));
              int nState = bSelected? PBS_PRESSED: PBS_NORMAL;
              pClassButton->DrawThemeBackground(pDC, BP_PUSHBUTTON, nState, rcItem);
              return;
       }

       if (bSelected)
       {
              rcItem.InflateRect(XTP_DPI_X(2), XTP_DPI_Y(2), XTP_DPI_X(2), XTP_DPI_Y(1));
       }

       CXTPSkinManagerClass* pClass = GetSkinClass();

       int nStateId = (m_nHotItem == iItem ? TIS_HOT
              : (bFocused ? TIS_FOCUSED
              : (bSelected ? TIS_SELECTED
              : TIS_NORMAL)));

       pClass->DrawThemeBackground(pDC, iItem == 0 ? TABP_TOPTABITEMLEFTEDGE :
              iItem == iCount - 1 && !bSelected && !bFocused ? TABP_TOPTABITEMRIGHTEDGE : TABP_TOPTABITEM,
              nStateId, &rcItem);
}


After:
Tab controls still don’t behave correctly on mouse hover in 17.3.0.  You have given us this fix for 17.2.0 and it’s better than what is currently in the 17.3.0.

void CXTPSkinObjectTab::FillTabFace(CDC* pDC, CRect rcItem, int iItem,
       int iCount, BOOL bSelected, BOOL bFocused)
{
       if (GetStyle() & TCS_BUTTONS)
       {
              CXTPSkinManagerClass* pClassButton = GetSkinManager()->GetSkinClass(this, _T("BUTTON"));
              int nState = bSelected? PBS_PRESSED: PBS_NORMAL;
              pClassButton->DrawThemeBackground(pDC, BP_PUSHBUTTON, nState, rcItem);
              return;
       }

       if (bSelected)
       {
              rcItem.InflateRect(2, 2, 2, 2);
       }

       CXTPSkinManagerClass* pClass = GetSkinClass();
       int nStateId = bSelected ? TIS_SELECTED: m_nHotItem == iItem ? TIS_HOT : TIS_NORMAL;
       pClass->DrawThemeBackground(pDC, iItem == 0 ? TABP_TOPTABITEMLEFTEDGE :
              iItem == iCount - 1 && !bSelected ? TABP_TOPTABITEMRIGHTEDGE : TABP_TOPTABITEM,
              nStateId, &rcItem);
}


Source\Styles\Office2013\XamlStyle\Frame\BorderLeft.xaml

Before:
       <Border x:Name='Border' Margin='0,0,0,0' BorderThickness='1,0,0,0' BorderBrush='#FF000000' Background='#FFFFFFFF' />

After:
You have a bug there, with this fix, borders are correctly drawn.
       <Border x:Name='Border' Margin='0,0,0,0' BorderThickness='0,0,1,0' BorderBrush='#FF000000' Background='#FFFFFFFF' />

Source\Styles\Office2013\XamlStyle\Frame\BorderRight.xaml

Before:
              <Border x:Name='Border' Margin='0,0,0,0' BorderThickness='0,0,1,0' BorderBrush='#FF000000' Background='#FFFFFFFF' />

After:
You have a bug there, with this fix, borders are correctly drawn.
       <Border x:Name='Border' Margin='0,0,0,0' BorderThickness='1,0,0,0' BorderBrush='#FF000000' Background='#FFFFFFFF' />

Thanks.
Regards,



-------------
Sergio



Replies:
Posted By: olebed
Date Posted: 30 November 2016 at 9:41am
Hello Sergio,

Your version of FillTabFace() method doesn't take into account focused state of tabs.
Current state of method is
void CXTPSkinObjectTab::FillTabFace(CDC* pDC, CRect rcItem, int iItem, 
    int iCount, BOOL bSelected, BOOL bFocused)
{
    if (GetStyle() & TCS_BUTTONS)
    {
        CXTPSkinManagerClass* pClassButton = GetSkinManager()->GetSkinClass(this, _T("BUTTON"));
        int nState = bSelected? PBS_PRESSED: PBS_NORMAL;
        pClassButton->DrawThemeBackground(pDC, BP_PUSHBUTTON, nState, rcItem);
        return;
    }

    if (bSelected)
    {
        rcItem.InflateRect(2, 2, 2, 2);        //should not be rescaled
    }

    CXTPSkinManagerClass* pClass = GetSkinClass();

    int nStateId = (bFocused ? TIS_FOCUSED
        : (bSelected ? (m_nHotItem == iItem) ? TIS_FOCUSED : TIS_SELECTED
        : (m_nHotItem == iItem ? TIS_HOT 
        : TIS_NORMAL)));

    int nPartId = iItem == 0 ? TABP_TOPTABITEMLEFTEDGE :
                (iItem == iCount - 1 && !bSelected && !bFocused) ? TABP_TOPTABITEMRIGHTEDGE : TABP_TOPTABITEM;

    pClass->DrawThemeBackground(pDC, nPartId, nStateId, &rcItem);
}



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