mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 20:18:22 +00:00
[SDK] cicuif.h: Fix CUIFMenuItem::InitMenuExtent (#6407)
Supporting Language Bar... JIRA issue: CORE-19363 Implement CUIFMenuItem::InitMenuExtent method.
This commit is contained in:
parent
3056f253e4
commit
76c898ca8e
1 changed files with 35 additions and 2 deletions
|
@ -5979,11 +5979,44 @@ inline BOOL CUIFMenuItem::Init(UINT nMenuItemID, LPCWSTR pszText)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @unimplemented
|
|
||||||
inline STDMETHODIMP_(void)
|
inline STDMETHODIMP_(void)
|
||||||
CUIFMenuItem::InitMenuExtent()
|
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()
|
inline BOOL CUIFMenuItem::IsCheck()
|
||||||
|
|
Loading…
Reference in a new issue