[SDK] cicuif.h: Fix CUIFMenuItem::DrawBitmapProc (#6404)

Supporting Language Bar...
JIRA issue: CORE-19363
Implement CUIFMenuItem::DrawBitmapProc
method.
This commit is contained in:
Katayama Hirofumi MZ 2024-01-24 14:41:46 +09:00 committed by GitHub
parent f170276fd2
commit 21e759735e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5940,10 +5940,38 @@ inline void CUIFMenuItem::DrawArrow(HDC hDC, INT xLeft, INT yTop)
::SelectObject(hDC, hFontOld);
}
/// @unimplemented
inline void CUIFMenuItem::DrawBitmapProc(HDC hDC, INT xLeft, INT yTop)
{
//FIXME
if (!m_pScheme || !m_hbmColor)
return;
BITMAP bm;
::GetObject(m_hbmColor, sizeof(bm), &bm);
INT width = m_pMenu->m_cxyMargin, height = m_rc.bottom - m_rc.top;
if (width > bm.bmWidth)
{
width = bm.bmWidth;
xLeft += (width - bm.bmWidth) / 2;
}
if (height > bm.bmHeight)
{
height = bm.bmHeight;
yTop += (height - bm.bmHeight) / 2;
}
RECT rc = { xLeft, yTop, xLeft + width, yTop + height };
if (IsRTL())
m_pScheme->m_bMirroring = TRUE;
if (m_pMenu->m_pSelectedItem != this || m_bMenuItemDisabled)
m_pScheme->DrawFrameCtrlBitmap(hDC, &rc, m_hbmColor, m_hbmMask, 0);
else
m_pScheme->DrawFrameCtrlBitmap(hDC, &rc, m_hbmColor, m_hbmMask, UIF_DRAW_PRESSED);
if (IsRTL())
m_pScheme->m_bMirroring = FALSE;
}
inline void CUIFMenuItem::DrawCheck(HDC hDC, INT xLeft, INT yTop)