Author: dquintana Date: Sun Mar 2 19:35:13 2014 New Revision: 62382
URL: http://svn.reactos.org/svn/reactos?rev=62382&view=rev Log: [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
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rsh... ============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Sun Mar 2 19:35:13 2014 @@ -113,27 +113,29 @@ 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<INT>(cdraw->nmcd.dwItemSpec); + isPopup = m_popupBar == this && m_popupItem == static_cast<INT>(cdraw->nmcd.dwItemSpec);
if (isHot || (m_hotItem < 0 && isPopup)) { - cdraw->nmcd.uItemState = CDIS_HOT; + cdraw->nmcd.uItemState |= CDIS_HOT; } - - switch (cdraw->nmcd.uItemState) + else { - case CDIS_HOT: - case CDIS_FOCUS: + cdraw->nmcd.uItemState &= ~CDIS_HOT; + } + + if (cdraw->nmcd.uItemState&CDIS_HOT) + { 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 @@ 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 @@ 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 @@ INT indexOpen = 0;
TBBUTTON tbb = { 0 }; - tbb.fsState = TBSTATE_ENABLED; + tbb.fsState = TBSTATE_ENABLED | TBSTATE_WRAP; tbb.fsStyle = 0;
STRRET sr = { STRRET_CSTR, { 0 } };