[SDK] cicuif.h: Fix CUIFMenuItem::InitMenuExtent (#6407)

Supporting Language Bar...
JIRA issue: CORE-19363
Implement CUIFMenuItem::InitMenuExtent
method.
This commit is contained in:
Katayama Hirofumi MZ 2024-01-24 17:51:59 +09:00 committed by GitHub
parent 3056f253e4
commit 76c898ca8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5979,11 +5979,44 @@ inline BOOL CUIFMenuItem::Init(UINT nMenuItemID, LPCWSTR pszText)
return TRUE;
}
/// @unimplemented
inline STDMETHODIMP_(void)
CUIFMenuItem::InitMenuExtent()
{
//FIXME
if (!m_pszMenuItemLeft)
{
if (m_hbmColor)
{
BITMAP bm;
::GetObject(m_hbmColor, sizeof(bm), &bm);
m_MenuLeftExtent.cx = bm.bmWidth + 2;
m_MenuLeftExtent.cy = bm.bmHeight + 4;
}
else
{
m_MenuLeftExtent.cx = m_MenuLeftExtent.cy = 0;
}
return;
}
HDC hDC = ::GetDC(*m_pWindow);
HGDIOBJ hFontOld = ::SelectObject(hDC, m_hFont);
::GetTextExtentPoint32W(hDC, m_pszMenuItemLeft, m_cchMenuItemLeft, &m_MenuLeftExtent);
m_MenuLeftExtent.cx += 16;
m_MenuLeftExtent.cy += 8;
if (m_pszMenuItemRight)
{
::GetTextExtentPoint32W(hDC, m_pszMenuItemRight, m_cchMenuItemRight, &m_MenuRightExtent);
m_MenuRightExtent.cy += 8;
}
::SelectObject(hDC, hFontOld);
if (m_pSubMenu)
m_MenuLeftExtent.cx += m_MenuLeftExtent.cy + 2;
if (m_pMenu->m_style & UIF_MENU_USE_OFF10)
m_MenuLeftExtent.cx += 24;
::ReleaseDC(*m_pWindow, hDC);
}
inline BOOL CUIFMenuItem::IsCheck()