mirror of
https://github.com/reactos/reactos.git
synced 2024-11-27 05:23:33 +08:00
[MSUTB][SDK] Add CModalMenu (#6451)
Supporting Language Bar... JIRA issue: CORE-19363 - Fix the return value type of CUIFObject::Initialize method. - Implement CModalMenu class.
This commit is contained in:
parent
2bc44bf95c
commit
c9c5b3d3ae
@ -769,7 +769,7 @@ public:
|
||||
|
||||
STDMETHOD_(BSTR, GetAccName)() override;
|
||||
STDMETHOD_(INT, GetAccRole)() override;
|
||||
STDMETHOD_(void, Initialize)() override;
|
||||
STDMETHOD_(BOOL, Initialize)() override;
|
||||
STDMETHOD_(void, OnCreate)(HWND hWnd) override;
|
||||
STDMETHOD_(void, OnDestroy)(HWND hWnd) override;
|
||||
STDMETHOD_(HRESULT, OnGetObject)(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) override;
|
||||
@ -782,11 +782,11 @@ public:
|
||||
class CUTBMenuItem : public CTipbarAccItem, public CUIFMenuItem
|
||||
{
|
||||
protected:
|
||||
CUTBMenuWnd *m_pMenuWnd;
|
||||
CUTBMenuWnd *m_pMenuUI;
|
||||
friend class CUTBMenuWnd;
|
||||
|
||||
public:
|
||||
CUTBMenuItem(CUTBMenuWnd *pMenuWnd);
|
||||
CUTBMenuItem(CUTBMenuWnd *pMenuUI);
|
||||
~CUTBMenuItem() override;
|
||||
|
||||
CUIFMenuItem* GetMenuItem()
|
||||
@ -804,6 +804,23 @@ public:
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
class CModalMenu
|
||||
{
|
||||
public:
|
||||
DWORD m_dwUnknown26;
|
||||
CUTBMenuWnd *m_pMenuUI;
|
||||
|
||||
public:
|
||||
CModalMenu() { }
|
||||
virtual ~CModalMenu() { }
|
||||
|
||||
CUTBMenuItem *InsertItem(CUTBMenuWnd *pMenuUI, SIZE_T uBytes, INT nStringID);
|
||||
void PostKey(BOOL bUp, WPARAM wParam, LPARAM lParam);
|
||||
void CancelMenu();
|
||||
};
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
class CUTBLBarMenuItem;
|
||||
|
||||
class CUTBLBarMenu : public CCicLibMenu
|
||||
@ -1994,7 +2011,7 @@ STDMETHODIMP_(INT) CUTBMenuWnd::GetAccRole()
|
||||
return 9;
|
||||
}
|
||||
|
||||
STDMETHODIMP_(void) CUTBMenuWnd::Initialize()
|
||||
STDMETHODIMP_(BOOL) CUTBMenuWnd::Initialize()
|
||||
{
|
||||
CTipbarAccessible *pAccessible = new(cicNoThrow) CTipbarAccessible(GetAccItem());
|
||||
if (pAccessible)
|
||||
@ -2086,10 +2103,10 @@ STDMETHODIMP_(void) CUTBMenuWnd::OnTimer(WPARAM wParam)
|
||||
* CUTBMenuItem
|
||||
*/
|
||||
|
||||
CUTBMenuItem::CUTBMenuItem(CUTBMenuWnd *pMenuWnd)
|
||||
: CUIFMenuItem(pMenuWnd ? pMenuWnd->GetMenu() : NULL)
|
||||
CUTBMenuItem::CUTBMenuItem(CUTBMenuWnd *pMenuUI)
|
||||
: CUIFMenuItem(pMenuUI ? pMenuUI->GetMenu() : NULL)
|
||||
{
|
||||
m_pMenuWnd = pMenuWnd;
|
||||
m_pMenuUI = pMenuUI;
|
||||
}
|
||||
|
||||
CUTBMenuItem::~CUTBMenuItem()
|
||||
@ -2108,10 +2125,10 @@ CUTBMenuItem::~CUTBMenuItem()
|
||||
|
||||
STDMETHODIMP_(BOOL) CUTBMenuItem::DoAccDefaultAction()
|
||||
{
|
||||
if (!m_pMenuWnd)
|
||||
if (!m_pMenuUI)
|
||||
return FALSE;
|
||||
|
||||
m_pMenuWnd->StartDoAccDefaultActionTimer(this);
|
||||
m_pMenuUI->StartDoAccDefaultActionTimer(this);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -2134,8 +2151,8 @@ STDMETHODIMP_(BSTR) CUTBMenuItem::GetAccDefaultAction()
|
||||
STDMETHODIMP_(void) CUTBMenuItem::GetAccLocation(LPRECT lprc)
|
||||
{
|
||||
GetRect(lprc);
|
||||
::ClientToScreen(m_pMenuWnd->m_hWnd, (LPPOINT)lprc);
|
||||
::ClientToScreen(m_pMenuWnd->m_hWnd, (LPPOINT)&lprc->right);
|
||||
::ClientToScreen(m_pMenuUI->m_hWnd, (LPPOINT)lprc);
|
||||
::ClientToScreen(m_pMenuUI->m_hWnd, (LPPOINT)&lprc->right);
|
||||
}
|
||||
|
||||
STDMETHODIMP_(BSTR) CUTBMenuItem::GetAccName()
|
||||
@ -2151,6 +2168,42 @@ STDMETHODIMP_(INT) CUTBMenuItem::GetAccRole()
|
||||
return 12;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CModalMenu
|
||||
*/
|
||||
|
||||
CUTBMenuItem *
|
||||
CModalMenu::InsertItem(CUTBMenuWnd *pMenuUI, SIZE_T uBytes, INT nStringID)
|
||||
{
|
||||
CUTBMenuItem *pMenuItem = new(cicNoThrow) CUTBMenuItem(pMenuUI);
|
||||
if (!pMenuItem)
|
||||
return NULL;
|
||||
|
||||
WCHAR szText[256];
|
||||
::LoadStringW(g_hInst, nStringID, szText, _countof(szText));
|
||||
|
||||
if (pMenuItem->Initialize() &&
|
||||
pMenuItem->Init(uBytes, szText) &&
|
||||
pMenuUI->InsertItem(pMenuItem))
|
||||
{
|
||||
return pMenuItem;
|
||||
}
|
||||
|
||||
delete pMenuItem;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CModalMenu::PostKey(BOOL bUp, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
m_pMenuUI->PostKey(bUp, wParam, lParam);
|
||||
}
|
||||
|
||||
void CModalMenu::CancelMenu()
|
||||
{
|
||||
if (m_pMenuUI)
|
||||
m_pMenuUI->CancelMenu();
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CTrayIconItem
|
||||
*/
|
||||
@ -2976,7 +3029,7 @@ STDMETHODIMP CLBarInatItem::OnMenuSelect(INT nCommandId)
|
||||
#if 0 // FIXME: g_pTipbarWnd
|
||||
g_pTipbarWnd->RestoreLastFocus(0, (g_pTipbarWnd->m_dwTipbarWndFlags & 2) != 0);
|
||||
#endif
|
||||
HWND hwndFore = GetForegroundWindow();
|
||||
HWND hwndFore = ::GetForegroundWindow();
|
||||
if (m_dwThreadId == ::GetWindowThreadProcessId(hwndFore, NULL))
|
||||
{
|
||||
BOOL FontSig = GetFontSig(hwndFore, hKL);
|
||||
|
@ -236,7 +236,7 @@ public:
|
||||
void StartTimer(WPARAM wParam);
|
||||
void EndTimer();
|
||||
|
||||
STDMETHOD_(void, Initialize)() { }
|
||||
STDMETHOD_(BOOL, Initialize)() { return TRUE; }
|
||||
STDMETHOD_(void, OnPaint)(HDC hDC);
|
||||
STDMETHOD_(void, OnTimer)() { }
|
||||
STDMETHOD_(void, OnLButtonDown)(LONG x, LONG y) { }
|
||||
@ -568,7 +568,7 @@ public:
|
||||
static CUIFWindow* GetThis(HWND hWnd);
|
||||
static void SetThis(HWND hWnd, LONG_PTR dwNewLong);
|
||||
|
||||
STDMETHOD_(void, Initialize)() override;
|
||||
STDMETHOD_(BOOL, Initialize)() override;
|
||||
STDMETHOD_(void, Show)(BOOL bVisible) override;
|
||||
STDMETHOD_(void, SetRect)(LPCRECT prc) override;
|
||||
STDMETHOD_(void, PaintObject)(HDC hDC, LPCRECT prc) override;
|
||||
@ -697,7 +697,7 @@ public:
|
||||
void AdjustWindowPos();
|
||||
void OnOwnerWndMoved(BOOL bDoSize);
|
||||
|
||||
STDMETHOD_(void, Initialize)() override;
|
||||
STDMETHOD_(BOOL, Initialize)() override;
|
||||
STDMETHOD_(DWORD, GetWndStyleEx)() override;
|
||||
STDMETHOD_(void, OnPaint)(HDC hDC) override;
|
||||
STDMETHOD_(LRESULT, OnWindowPosChanging)(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) override;
|
||||
@ -1064,7 +1064,7 @@ public:
|
||||
CUIFBalloonWindow(HINSTANCE hInst, DWORD style);
|
||||
~CUIFBalloonWindow() override;
|
||||
|
||||
STDMETHOD_(void, Initialize)() override;
|
||||
STDMETHOD_(BOOL, Initialize)() override;
|
||||
STDMETHOD_(LPCTSTR, GetClassName)() override { return TEXT("MSIME_PopupMessage"); }
|
||||
STDMETHOD_(LPCTSTR, GetWndTitle)() override { return TEXT("MSIME_PopupMessage"); }
|
||||
STDMETHOD_(void, OnCreate)(HWND hWnd) override;
|
||||
@ -2561,7 +2561,7 @@ inline CUIFWindow::~CUIFWindow()
|
||||
}
|
||||
}
|
||||
|
||||
inline STDMETHODIMP_(void)
|
||||
inline STDMETHODIMP_(BOOL)
|
||||
CUIFWindow::Initialize()
|
||||
{
|
||||
LPCTSTR pszClass = GetClassName();
|
||||
@ -3366,11 +3366,11 @@ inline void CUIFShadow::OnOwnerWndMoved(BOOL bDoSize)
|
||||
}
|
||||
}
|
||||
|
||||
inline STDMETHODIMP_(void)
|
||||
inline STDMETHODIMP_(BOOL)
|
||||
CUIFShadow::Initialize()
|
||||
{
|
||||
InitSettings();
|
||||
CUIFWindow::Initialize();
|
||||
return CUIFWindow::Initialize();
|
||||
}
|
||||
|
||||
inline STDMETHODIMP_(DWORD)
|
||||
@ -5060,7 +5060,7 @@ CUIFBalloonWindow::~CUIFBalloonWindow()
|
||||
}
|
||||
}
|
||||
|
||||
inline STDMETHODIMP_(void)
|
||||
inline STDMETHODIMP_(BOOL)
|
||||
CUIFBalloonWindow::Initialize()
|
||||
{
|
||||
CUIFWindow::Initialize();
|
||||
@ -5074,6 +5074,8 @@ CUIFBalloonWindow::Initialize()
|
||||
AddButton(IDYES);
|
||||
AddButton(IDNO);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
inline STDMETHODIMP_(void)
|
||||
|
Loading…
Reference in New Issue
Block a user