https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fa2715fb6bc99a90821a6…
commit fa2715fb6bc99a90821a609d95031d9cb2455954
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sat Jan 13 16:02:36 2024 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Jan 13 16:02:36 2024 +0900
[SDK] cicuif.h: Add CUIFToolbarMenuButton (#6336)
Supporting TIPs...
JIRA issue: CORE-19360
- Add CUIFToolbarMenuButton class.
- Add CUIFToolbarButtonElement class.
---
sdk/include/reactos/cicero/cicuif.h | 123 ++++++++++++++++++++++++++++++++++++
1 file changed, 123 insertions(+)
diff --git a/sdk/include/reactos/cicero/cicuif.h b/sdk/include/reactos/cicero/cicuif.h
index 23f0bac68e8..27111958d69 100644
--- a/sdk/include/reactos/cicero/cicuif.h
+++ b/sdk/include/reactos/cicero/cicuif.h
@@ -23,8 +23,11 @@ class CUIFTheme;
class CUIFWindow;
class CUIFToolTip;
class CUIFShadow;
+ class CUIFToolbarButton;
class CUIFButton;
class CUIFButton2;
+ class CUIFToolbarMenuButton;
+ class CUIFToolbarButtonElement;
class CUIFGripper;
class CUIFObjectArray;
class CUIFColorTable;
@@ -754,6 +757,50 @@ public:
/////////////////////////////////////////////////////////////////////////////
+class CUIFToolbarMenuButton : public CUIFButton2
+{
+public:
+ CUIFToolbarButton *m_pToolbarButton;
+
+ CUIFToolbarMenuButton(CUIFToolbarButton *pParent, DWORD dwUnknown3, LPCRECT prc,
DWORD style);
+ ~CUIFToolbarMenuButton() override;
+
+ STDMETHOD_(void, OnLButtonUp)(LONG x, LONG y) override;
+ STDMETHOD_(BOOL, OnSetCursor)(UINT uMsg, LONG x, LONG y) override;
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+class CUIFToolbarButtonElement : public CUIFButton2
+{
+public:
+ CUIFToolbarButton *m_pToolbarButton;
+
+ CUIFToolbarButtonElement(CUIFToolbarButton *pParent, DWORD dwUnknown3, LPCRECT prc,
DWORD style);
+
+ STDMETHOD_(LPCWSTR, GetToolTip)() override;
+ STDMETHOD_(void, OnLButtonUp)(LONG x, LONG y) override;
+ STDMETHOD_(void, OnRButtonUp)(LONG x, LONG y) override;
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+// FIXME
+class CUIFToolbarButton : public CUIFObject
+{
+public:
+ CUIFToolbarButtonElement *m_pToolbarButtonElement;
+ CUIFToolbarMenuButton *m_pToolbarMenuButton;
+ DWORD m_dwButtonFlags;
+ LPCWSTR m_pszUnknownText;
+
+ STDMETHOD_(void, OnUnknownMouse0)() { }
+ STDMETHOD_(void, OnUnknownMouse1)(LONG x, LONG y) { }
+ STDMETHOD_(void, OnUnknownMouse2)(LONG x, LONG y) { }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
// m_style flags for CUIFGripper
enum
{
@@ -4226,3 +4273,79 @@ CUIFGripper::SetStyle(DWORD style)
else
SetActiveTheme(L"REBAR", RP_GRIPPER, 0);
}
+
+/////////////////////////////////////////////////////////////////////////////
+
+inline
+CUIFToolbarMenuButton::CUIFToolbarMenuButton(
+ CUIFToolbarButton *pParent,
+ DWORD dwUnknown3,
+ LPCRECT prc,
+ DWORD style) : CUIFButton2(pParent, dwUnknown3, prc, style)
+{
+ m_pToolbarButton = pParent;
+
+ HFONT hFont = ::CreateFont(8, 8, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE,
SYMBOL_CHARSET,
+ OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
+ DEFAULT_PITCH | FF_DONTCARE, TEXT("Marlett"));
+ SetFont(hFont);
+ SetText(L"u");
+}
+
+inline
+CUIFToolbarMenuButton::~CUIFToolbarMenuButton()
+{
+ ::DeleteObject(m_hFont);
+ SetFont(NULL);
+}
+
+inline STDMETHODIMP_(void)
+CUIFToolbarMenuButton::OnLButtonUp(LONG x, LONG y)
+{
+ CUIFButton::OnLButtonUp(x, y);
+ m_pToolbarButton->OnUnknownMouse2(x, y);
+}
+
+inline STDMETHODIMP_(BOOL)
+CUIFToolbarMenuButton::OnSetCursor(UINT uMsg, LONG x, LONG y)
+{
+ m_pToolbarButton->OnSetCursor(uMsg, x, y);
+ return FALSE;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+inline
+CUIFToolbarButtonElement::CUIFToolbarButtonElement(
+ CUIFToolbarButton *pParent,
+ DWORD dwUnknown3,
+ LPCRECT prc,
+ DWORD style) : CUIFButton2(pParent, dwUnknown3, prc, style)
+{
+ m_pToolbarButton = pParent;
+}
+
+inline STDMETHODIMP_(LPCWSTR)
+CUIFToolbarButtonElement::GetToolTip()
+{
+ if (m_pToolbarButton)
+ return m_pToolbarButton->GetToolTip();
+ return NULL;
+}
+
+inline STDMETHODIMP_(void)
+CUIFToolbarButtonElement::OnLButtonUp(LONG x, LONG y)
+{
+ CUIFButton::OnLButtonUp(x, y);
+ if ((m_pToolbarButton->m_dwButtonFlags & 0x30000) == 0x20000)
+ m_pToolbarButton->OnUnknownMouse2(x, y);
+ else
+ m_pToolbarButton->OnUnknownMouse1(x, y);
+}
+
+inline STDMETHODIMP_(void)
+CUIFToolbarButtonElement::OnRButtonUp(LONG x, LONG y)
+{
+ if ((m_pToolbarButton->m_dwButtonFlags & 0x30000) != 0x20000)
+ m_pToolbarButton->OnUnknownMouse0();
+}