Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Bug - Clipped caption text
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Bug - Clipped caption text

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

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: Bug - Clipped caption text
    Posted: 30 August 2017 at 3:15am
Hi;

I'm using the skin framework for my application, but it clips the caption in title bar of the application.
See Screenshot!



How can I fix this?

TIA
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2017 at 10:16am
I think if you are using the CommandBar with EnableFrameTheme, then you should exclude that window from the SkinFramework with a RemoveWindow call. Let the CommandBars do all the drawing in that case (again, I think this will work, not 100% sure).
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2017 at 11:12am
Hi;

I already remove the main window from SkinFramework...
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 01 September 2017 at 3:01pm
Still no comment from CJ?
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
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 (1) Thanks(1)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 02 January 2018 at 5:27am
Hello,

It is can be result of bug in methods CXTPSkinManagerApiHook::OnHookSystemParametersInfoA/W
BOOL WINAPI CXTPSkinManagerApiHook::OnHookSystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
{
    XTP_SKINFRAMEWORK_MANAGE_STATE();

    CXTPSkinManagerApiFunction* pFunction = EnterHookedCall(xtpSkinApiSystemParametersInfoA);
    if (NULL == pFunction)
    {
        return FALSE;
    }

    typedef BOOL(WINAPI* LPFNSYSTEMPARAMETERSINFO)(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);
    BOOL bResult = ((LPFNSYSTEMPARAMETERSINFO)pFunction->m_pfnOrig)(uiAction, uiParam, pvParam, fWinIni);

    XTP_GUARD_SHARED_(CXTPSkinManager, XTPSkinManager(), pSkinManager)
    {
        if (!pSkinManager->IsEnabled() || pSkinManager->GetMetrics()->m_bRefreshMetrics)
            return bResult;

        if (!pSkinManager->HasApplyOptions(xtpSkinApplyMetrics | xtpSkinApplyColors | xtpSkinApplyFrame))
            return bResult;

        if (uiAction == SPI_GETICONTITLELOGFONT && uiParam == sizeof(LOGFONTA))
        {
#ifndef _UNICODE
            LOGFONTA* pLogFont = reinterpret_cast<LOGFONTA*>(pvParam);
            ASSERT(NULL != pLogFont);
#else
            LOGFONTW logFont;
            LOGFONTW* pLogFont = &logFont;
#endif

            XTP_GUARD_SHARED_(CXTPSkinManagerSchema, XTPSkinManager()->GetSchema(), pSchema)
            {
                UINT nSysMetrics = pSchema->GetClassCode(_T("SYSMETRICS"));

                pSchema->GetFontProperty(nSysMetrics, 0, 0, TMT_ICONTITLEFONT, *pLogFont);

#ifdef _UNICODE
                LOGFONTA* pLogFontA = reinterpret_cast<LOGFONTA*>(pvParam);
                ASSERT(NULL != pLogFontA);

                memcpy(pLogFontA, pLogFont, offsetof(LOGFONTA, lfFaceName));
                WCSTOMBS_S(pLogFontA->lfFaceName, pLogFont->lfFaceName, _countof(pLogFontA->lfFaceName));
#endif
            }
        }

        if (uiAction == SPI_GETNONCLIENTMETRICS && uiParam == sizeof(NONCLIENTMETRICSA))
        {
            XTP_GUARD_SHARED_(CXTPSkinManagerSchema, XTPSkinManager()->GetSchema(), pSchema)
            {
                UINT nSysMetrics = pSchema->GetClassCode(_T("SYSMETRICS"));

                LOGFONT lfMenuFont, lfStatusFont, lfCaptionFont, lfSmCaptionFont;
                pSchema->GetFontProperty(nSysMetrics, 0, 0, TMT_MENUFONT, lfMenuFont);
                pSchema->GetFontProperty(nSysMetrics, 0, 0, TMT_STATUSFONT, lfStatusFont);
                pSchema->GetFontProperty(nSysMetrics, 0, 0, TMT_CAPTIONFONT, lfCaptionFont);
                pSchema->GetFontProperty(nSysMetrics, 0, 0, TMT_SMALLCAPTIONFONT, lfSmCaptionFont);

                NONCLIENTMETRICSA* pncm = reinterpret_cast<NONCLIENTMETRICSA*>(pvParam);
                ASSERT(NULL != pncm);

#ifndef _UNICODE
                memcpy(&pncm->lfMenuFont, &lfMenuFont, sizeof(LOGFONTA));
                memcpy(&pncm->lfStatusFont, &lfStatusFont, sizeof(LOGFONTA));
                memcpy(&pncm->lfCaptionFont, &lfCaptionFont, sizeof(LOGFONTA));
                memcpy(&pncm->lfSmCaptionFont, &lfSmCaptionFont, sizeof(LOGFONTA));

#else
                memcpy(&pncm->lfMenuFont, &lfMenuFont, offsetof(LOGFONTA, lfFaceName));
                WCSTOMBS_S(pncm->lfMenuFont.lfFaceName, lfMenuFont.lfFaceName, _countof(pncm->lfMenuFont.lfFaceName));

                memcpy(&pncm->lfStatusFont, &lfStatusFont, offsetof(LOGFONTA, lfFaceName));
                WCSTOMBS_S(pncm->lfStatusFont.lfFaceName, lfStatusFont.lfFaceName, _countof(pncm->lfStatusFont.lfFaceName));

                memcpy(&pncm->lfCaptionFont, &lfCaptionFont, offsetof(LOGFONTA, lfFaceName));
                WCSTOMBS_S(pncm->lfCaptionFont.lfFaceName, lfCaptionFont.lfFaceName, _countof(pncm->lfCaptionFont.lfFaceName));

                memcpy(&pncm->lfSmCaptionFont, &lfSmCaptionFont, offsetof(LOGFONTA, lfFaceName));
                WCSTOMBS_S(pncm->lfSmCaptionFont.lfFaceName, lfSmCaptionFont.lfFaceName, _countof(pncm->lfSmCaptionFont.lfFaceName));
#endif
            }
        }
    }

    return bResult;
}

BOOL WINAPI CXTPSkinManagerApiHook::OnHookSystemParametersInfoW(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
{
    XTP_SKINFRAMEWORK_MANAGE_STATE();

    CXTPSkinManagerApiFunction* pFunction = EnterHookedCall(xtpSkinApiSystemParametersInfoW);
    if (NULL == pFunction)
    {
        return FALSE;
    }

    typedef BOOL(WINAPI* LPFNSYSTEMPARAMETERSINFO)(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);
    BOOL bResult = ((LPFNSYSTEMPARAMETERSINFO)pFunction->m_pfnOrig)(uiAction, uiParam, pvParam, fWinIni);

    XTP_GUARD_SHARED_(CXTPSkinManager, XTPSkinManager(), pSkinManager)
    {
        if (!pSkinManager->IsEnabled() || pSkinManager->GetMetrics()->m_bRefreshMetrics)
            return bResult;

        if (!pSkinManager->HasApplyOptions(xtpSkinApplyMetrics | xtpSkinApplyColors | xtpSkinApplyFrame))
            return bResult;

        if (uiAction == SPI_GETICONTITLELOGFONT && uiParam == sizeof(LOGFONTW))
        {
#ifdef _UNICODE
            LOGFONTW* pLogFont = reinterpret_cast<LOGFONTW*>(pvParam);
            ASSERT(NULL != pLogFont);
#else
            LOGFONTA logFont;
            LOGFONTA* pLogFont = &logFont;
#endif

            XTP_GUARD_SHARED_(CXTPSkinManagerSchema, XTPSkinManager()->GetSchema(), pSchema)
            {
                UINT nSysMetrics = pSchema->GetClassCode(_T("SYSMETRICS"));

                pSchema->GetFontProperty(nSysMetrics, 0, 0, TMT_ICONTITLEFONT, *pLogFont);

#ifndef _UNICODE
                LOGFONTW* pLogFontW = reinterpret_cast<LOGFONTW*>(pvParam);
                ASSERT(NULL != pLogFontW);

                memcpy(pLogFontW, pLogFont, offsetof(LOGFONT, lfFaceName));
                MBSTOWCS_S(pLogFontW->lfFaceName, pLogFont->lfFaceName, _countof(pLogFontW->lfFaceName));
#endif
            }
        }

        if (uiAction == SPI_GETNONCLIENTMETRICS && uiParam == sizeof(NONCLIENTMETRICSW))
        {
            XTP_GUARD_SHARED_(CXTPSkinManagerSchema, XTPSkinManager()->GetSchema(), pSchema)
            {
                UINT nSysMetrics = pSchema->GetClassCode(_T("SYSMETRICS"));

                LOGFONT lfMenuFont, lfStatusFont, lfCaptionFont, lfSmCaptionFont;
                pSchema->GetFontProperty(nSysMetrics, 0, 0, TMT_MENUFONT, lfMenuFont);
                pSchema->GetFontProperty(nSysMetrics, 0, 0, TMT_STATUSFONT, lfStatusFont);
                pSchema->GetFontProperty(nSysMetrics, 0, 0, TMT_CAPTIONFONT, lfCaptionFont);
                pSchema->GetFontProperty(nSysMetrics, 0, 0, TMT_SMALLCAPTIONFONT, lfSmCaptionFont);

                NONCLIENTMETRICSW* pncm = reinterpret_cast<NONCLIENTMETRICSW*>(pvParam);
                ASSERT(NULL != pncm);

#ifdef _UNICODE
                memcpy(&pncm->lfMenuFont, &lfMenuFont, sizeof(LOGFONTW));
                memcpy(&pncm->lfStatusFont, &lfStatusFont, sizeof(LOGFONTW));
                memcpy(&pncm->lfCaptionFont, &lfCaptionFont, sizeof(LOGFONTW));
                memcpy(&pncm->lfSmCaptionFont, &lfSmCaptionFont, sizeof(LOGFONTW));

#else
                memcpy(&pncm->lfMenuFont, &lfMenuFont, offsetof(LOGFONTW, lfFaceName));
                MBSTOWCS_S(pncm->lfMenuFont.lfFaceName, lfMenuFont.lfFaceName, _countof(pncm->lfMenuFont.lfFaceName));

                memcpy(&pncm->lfStatusFont, &lfStatusFont, offsetof(LOGFONTW, lfFaceName));
                MBSTOWCS_S(pncm->lfStatusFont.lfFaceName, lfStatusFont.lfFaceName, _countof(pncm->lfStatusFont.lfFaceName));

                memcpy(&pncm->lfCaptionFont, &lfCaptionFont, offsetof(LOGFONTW, lfFaceName));
                MBSTOWCS_S(pncm->lfCaptionFont.lfFaceName, lfCaptionFont.lfFaceName, _countof(pncm->lfCaptionFont.lfFaceName));

                memcpy(&pncm->lfSmCaptionFont, &lfSmCaptionFont, offsetof(LOGFONTW, lfFaceName));
                MBSTOWCS_S(pncm->lfSmCaptionFont.lfFaceName, lfSmCaptionFont.lfFaceName, _countof(pncm->lfSmCaptionFont.lfFaceName));
#endif
            }
        }
    }

    return bResult;
}

Regards,
 Oleksandr Lebed
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 03 January 2018 at 6:03am
Thanks,

I'll try it and report my results later...
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 03 January 2018 at 6:42am
Just tested it and it's ok now! Thumbs Up
I hope this will go soon into 18.3 release. We don't want to maintain XTP code changes and bug fixes.

Many thanks Oleksandr!
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
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: 03 January 2018 at 9:15am
Hello Martin,

Thank you for confirmation.
We are working on v18.3, I hope it will be released this month.

Regards,
Oleksandr Lebed
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2018 at 2:25pm
Hello;
Have to re-open this post, because when window is maximized the caption is still clipped (see the descender of letters 'y' and 'g') :



Please fix it.

TIA
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 02 August 2018 at 3:05am
Hi;

Still no solution? Cry
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2018 at 8:23am
Hi;

Tested it with v18.5. When window is not maximized it's ok, but maximized window has still clipped text.
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2019 at 3:19pm
Hi;

Using v19.0, I still see the clipped titlebar text in maximized windows.
This is more than two years since I reported this issue. I created a support ticket in May 2017 but it is still not answered. This is not the support we expect to get as long term customers.

And once again a screenshot that shows the behaviour (but for what?):


Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 06 November 2019 at 4:06am
Hello Martin,

I've created test project with codejock 19.0 wizard in visual studio 2017.
In wizard I added ribbon and skin, was removed quick access toolbar and visual style.
Also in test project was added line
m_pRibbonBar->EnableFrameTheme();
I created project something like your https://www.mgs.co.at/cms/images/test/Engine7.jpg
and I checked all our skins. I can't to reproduce this problem.

Can you reproduce this bug with project that created with codejock wizard and your skin?

Regards,
Artem Gontarenko
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 06 November 2019 at 4:17am
I'll try to create a small sample.
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 06 November 2019 at 6:00am
Also I've checked on Windows 8.1 - same result
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 06 November 2019 at 9:36am
But in our case it's the same result in all skinned applications we created.
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 06 November 2019 at 10:12am
You get clipped text in samples which was generated by codejock visual studio wizard and skins like Windows8/Windows10/Office 2007/Office 2010. And you do not use you skin. Right?
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2019 at 6:30am
What do you mean with 'And you do not use skin?'
The application contains a ribbon bar and is skinned with one of the office 2010 themes. It makes no difference which theme is used (black, white, blue), all of them show the same behaviour.
We can reporduce it with VS2008, VS2010, VS2017 on all machines in house (Windows 7, Windows 8.1, Windows 10 and corresponding Windows Server versions), but due to lack of time, we haven't tried your sample applications yet.
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2019 at 6:58am
Applications without a ribbon do not show this behaviour!
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 19 November 2019 at 7:14am
Hello Martin,

Do you created and used in application your skin or our skin?

Regards,
Artem Gontarenko
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 19 November 2019 at 7:16am
Your skin
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
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.219 seconds.