From c3b293c4b2640acd05ba9ab5c50af0702a3eec3d Mon Sep 17 00:00:00 2001 From: David Quintana Date: Sun, 2 Mar 2014 19:35:13 +0000 Subject: [PATCH] [RSHELL] * CMenuToolbarBase: Use TBSTATE_BREAK on every button instead of TBSTYLE_EX_VERTICAL. This allows the vertical alignment to work on ros, although the separators are neither sized nor drawn correctly, and the arrow alignment is wrong. NOTE: It's still not functional. Second level submenus don't show up, and clicking on items does nothing. CORE-7881 svn path=/branches/shell-experiments/; revision=62382 --- base/shell/rshell/CMenuToolbars.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/base/shell/rshell/CMenuToolbars.cpp b/base/shell/rshell/CMenuToolbars.cpp index ee4e23b7b01..967e9a83c77 100644 --- a/base/shell/rshell/CMenuToolbars.cpp +++ b/base/shell/rshell/CMenuToolbars.cpp @@ -113,27 +113,29 @@ HRESULT CMenuToolbarBase::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM rc = cdraw->nmcd.rc; hdc = cdraw->nmcd.hdc; - isHot = m_hotBar == this && m_hotItem == (INT) cdraw->nmcd.dwItemSpec; - isPopup = m_popupBar == this && m_popupItem == (INT) cdraw->nmcd.dwItemSpec; + isHot = m_hotBar == this && m_hotItem == static_cast(cdraw->nmcd.dwItemSpec); + isPopup = m_popupBar == this && m_popupItem == static_cast(cdraw->nmcd.dwItemSpec); if (isHot || (m_hotItem < 0 && isPopup)) { - cdraw->nmcd.uItemState = CDIS_HOT; + cdraw->nmcd.uItemState |= CDIS_HOT; + } + else + { + cdraw->nmcd.uItemState &= ~CDIS_HOT; } - switch (cdraw->nmcd.uItemState) + if (cdraw->nmcd.uItemState&CDIS_HOT) { - case CDIS_HOT: - case CDIS_FOCUS: FillRect(hdc, &rc, hotBrush); SetTextColor(hdc, clrTextHighlight); cdraw->clrText = clrTextHighlight; - break; - default: + } + else + { FillRect(hdc, &rc, bgBrush); SetTextColor(hdc, clrText); cdraw->clrText = clrText; - break; } cdraw->iListGap += 4; @@ -257,7 +259,9 @@ HRESULT CMenuToolbarBase::CreateToolbar(HWND hwndParent, DWORD dwFlags) if (dwFlags & SMINIT_VERTICAL) { tbStyles |= CCS_VERT; - tbExStyles |= TBSTYLE_EX_VERTICAL | WS_EX_TOOLWINDOW; + + // FIXME: Use when it works in ros (?) + //tbExStyles |= TBSTYLE_EX_VERTICAL | WS_EX_TOOLWINDOW; } RECT rc; @@ -700,7 +704,7 @@ HRESULT CMenuStaticToolbar::FillToolbar() TBBUTTON tbb = { 0 }; PWSTR MenuString = NULL; - tbb.fsState = TBSTATE_ENABLED; + tbb.fsState = TBSTATE_ENABLED | TBSTATE_WRAP; tbb.fsStyle = 0; info.cbSize = sizeof(info); @@ -833,7 +837,7 @@ HRESULT CMenuSFToolbar::FillToolbar() INT indexOpen = 0; TBBUTTON tbb = { 0 }; - tbb.fsState = TBSTATE_ENABLED; + tbb.fsState = TBSTATE_ENABLED | TBSTATE_WRAP; tbb.fsStyle = 0; STRRET sr = { STRRET_CSTR, { 0 } };