[solved] Second text line (ev note) rendered wrong |
Post Reply |
Author | |
Marco1
Senior Member Joined: 16 January 2004 Location: Germany Status: Offline Points: 251 |
Post Options
Thanks(0)
Posted: 09 August 2017 at 11:05am |
After updating to latest v18.0.1 we have in the calendar:
Tested in your calendar demo sample. The second line (event note) should not be rendered if it doesn't fit in the event cell. Really annoying with a lot of events. This happens in Office 2007 and 2010 themes. Please fix this and posting of a short patch here would be very kind! Thanx! |
|
Marco1
Senior Member Joined: 16 January 2004 Location: Germany Status: Offline Points: 251 |
Post Options
Thanks(0)
|
This is still NOT fixed in 18.5.0 and still annoying. Can you pls create a fix! Or do I have to open a support request? |
|
agontarenko
Admin Group Joined: 25 March 2016 Status: Offline Points: 289 |
Post Options
Thanks(0)
|
Hello, I'm glad to inform you that the issue has been addressed and fixed. The fix will be available in the next beta or final release. As hotfix you should be replace function as below: CSize CXTPCalendarThemeOffice2007::DrawText_Auto2SL3ML(CDC* pDC, LPCTSTR pcszText1, LPCTSTR pcszText2, LPCTSTR pcszText3, CThemeFontColorSet* pFontColor1, CThemeFontColorSet* pFontColor2, CThemeFontColorSet* pFontColor3, CRect& rcRect, LPCTSTR pcszText1Separator, UINT uWordBreakMode) { CXTPFontDC autoFont(pDC, pFontColor1->Font()); CSize szSubject = pDC->GetTextExtent(pcszText1); autoFont.SetFont(pFontColor2->Font()); CSize szLocation = pDC->GetTextExtent(pcszText2); autoFont.SetFont(pFontColor3->Font()); CSize szBody = pDC->GetTextExtent(pcszText3); if ((szSubject.cy + szLocation.cy + XTP_DPI_Y(1)) > rcRect.Height()) { CString strText1 = pcszText1; if (_tcslen(pcszText2) > 0) { strText1 += pcszText1Separator; } return DrawLine2_CenterLR(pDC, strText1, pcszText2, pFontColor1, pFontColor2, rcRect, DT_VCENTER | DT_LEFT, DT_VCENTER | DT_LEFT); } UINT uFormat = DT_NOPREFIX | DT_LEFT | DT_TOP | DT_EDITCONTROL | uWordBreakMode; CRect rcText(rcRect); int nHeight = 0; if (pcszText1 && _tcslen(pcszText1)) { rcText.top = min(rcText.top, rcRect.bottom); if (rcRect.bottom - rcText.top >= szSubject.cy) { autoFont.SetFontColor(pFontColor1->Font(), pFontColor1->Color()); int nSubjectHeight = pDC->DrawText(pcszText1, &rcText, uFormat); rcText.top += nSubjectHeight + szSubject.cy / 4; nHeight += nSubjectHeight + szSubject.cy / 4; } } if (pcszText2 && _tcslen(pcszText2)) { rcText.top = min(rcText.top, rcRect.bottom); if (rcRect.bottom - rcText.top >= szLocation.cy) { autoFont.SetFontColor(pFontColor2->Font(), pFontColor2->Color()); int nLocationHeight = pDC->DrawText(pcszText2, &rcText, uFormat); rcText.top += nLocationHeight + szLocation.cy / 4; nHeight += nLocationHeight + szLocation.cy / 4; } } if (pcszText3 && _tcslen(pcszText3)) { rcText.top = min(rcText.top, rcRect.bottom); if (rcRect.bottom - rcText.top >= szBody.cy) { autoFont.SetFontColor(pFontColor3->Font(), pFontColor3->Color()); int nBodyHeight = pDC->DrawText(pcszText3, &rcText, uFormat); rcText.top += nBodyHeight + szBody.cy / 4; nHeight += nBodyHeight + szBody.cy / 4; } } return CSize(rcRect.Width(), nHeight); } Regards, Artem Gontarenko
|
|
Marco1
Senior Member Joined: 16 January 2004 Location: Germany Status: Offline Points: 251 |
Post Options
Thanks(0)
|
Hi Arte, thanks a lot, your hotfix is working fine and solved the problem! Best regards, Marco |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |