Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Missing fixes in Codejock MFC ToolKitPro 17.3.0
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Missing fixes in Codejock MFC ToolKitPro 17.3.0

 Post Reply Post Reply
Author
Message
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Topic: Missing fixes in Codejock MFC ToolKitPro 17.3.0
    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
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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);
}
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.156 seconds.