https://git.reactos.org/?p=reactos.git;a=commitdiff;h=21e759735ea386077540bffd44b193b4b3745d81

commit 21e759735ea386077540bffd44b193b4b3745d81
Author:     Katayama Hirofumi MZ <katayama.hirofumi...@gmail.com>
AuthorDate: Wed Jan 24 14:41:46 2024 +0900
Commit:     GitHub <nore...@github.com>
CommitDate: Wed Jan 24 14:41:46 2024 +0900

    [SDK] cicuif.h: Fix CUIFMenuItem::DrawBitmapProc (#6404)
    
    Supporting Language Bar...
    JIRA issue: CORE-19363
    Implement CUIFMenuItem::DrawBitmapProc
    method.
---
 sdk/include/reactos/cicero/cicuif.h | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/sdk/include/reactos/cicero/cicuif.h 
b/sdk/include/reactos/cicero/cicuif.h
index ba366c6f674..46a63d8462d 100644
--- a/sdk/include/reactos/cicero/cicuif.h
+++ b/sdk/include/reactos/cicero/cicuif.h
@@ -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)

Reply via email to