Search

AFX_TAB_TEXT_MARGIN not exported when linking dynamically with MFC by CodeBloke

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 613594
Opened: 10/14/2010 7:51:01 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
It would be nice to able to modify the increase the tab margin to avoid some tab label issues.

If the fontRegular is switched to 12 point some small tab labels aren't drawn correctly, e.g. 'Cab', it appears to be a problem with capital C. Once you get to 'Cable' or 'Code' it sorts itself out.
Details (expand)

Visual Studio/Silverlight/Tooling version

Visual Studio 2010

What category (if any) best represents this feedback?

Compatibility

Steps to reproduce

Create a tabbed MFC app, call SetMenuFont to change the font size to the default font height (i.e. not -1). Save a doc as something like 'Ca' and switch to another tab.


CWindowDC dc(NULL);

NONCLIENTMETRICS info = {0};
info.cbSize = sizeof( NONCLIENTMETRICS );
if ( ::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, info.cbSize, &info, 0) )
{
    LOGFONT lf;
    memset(&lf, 0, sizeof(LOGFONT));

    lf.lfCharSet = (BYTE) GetTextCharsetInfo(dc.GetSafeHdc(), NULL, 0);

    lf.lfHeight = info.lfMenuFont.lfHeight;
    lf.lfWeight = info.lfMenuFont.lfWeight;
    lf.lfItalic = info.lfMenuFont.lfItalic;

    //------------------
    // Adjust font size:
    //------------------
    int nFontHeight = lf.lfHeight < 0 ? -lf.lfHeight : lf.lfHeight;
    if (nFontHeight < 11)
        nFontHeight = 11;

    lf.lfHeight = (lf.lfHeight < 0) ? -nFontHeight : nFontHeight;

    lstrcpy(lf.lfFaceName, info.lfMenuFont.lfFaceName);

    afxGlobalData.SetMenuFont( &lf, TRUE );
}

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

The tab label is drawn as 'C...'.

DrawText is adding the ellipses because it can't draw in the given rect.

Expected results

The tab label should be 'Ca'
File Attachments
File Name Submitted By Submitted On File Size  
NewMFC2.zip (restricted) 10/15/2010 -
Sign in to post a comment.
Posted by Microsoft on 10/28/2010 at 11:17 AM
Hello Dave,

Thanks for the report. This issue has been fixed in MFC for the next major release of Visual Studio.

Pat Brenner
Visual C++ Libraries Development
Posted by Microsoft on 10/18/2010 at 1:45 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by CodeBloke on 10/15/2010 at 2:30 AM
File attached. Steps (on Win 7 - x86)

1. Build project
2. Run EXE
3. Save first doc as: Cab
4. Create new doc

You should see first tab has been shortened to 'C...'

Note: It doesn't happen with all tab styles, this project has been set to STYLE_3D_VS2005.
Posted by Microsoft on 10/14/2010 at 7:22 PM
Thanks for reporting this issue. In order to fix the issue, we must first reproduce the issue in our labs. We are unable to reproduce the issue with the steps you provided.

Please give us a demo project to demonstrate this issue so that we can conduct further research.

It would be greatly appreciated if you could provide us with that information as quickly as possible. If we do not hear back from you within 7 days, we will close this issue.

Thanks again for your efforts and we look forward to hearing from you.

Microsoft Visual Studio Connect Support Team

Posted by Microsoft on 10/14/2010 at 6:46 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.