Author: dquintana
Date: Mon Mar 3 11:14:04 2014
New Revision: 62412
URL:
http://svn.reactos.org/svn/reactos?rev=62412&view=rev
Log:
[RSHELL]
* Move the copying back where it belongs. CMake may generate the dependencies the wrong
way around (explorer-new should depend on rshell), but at least the copying works as
expected, even if I always have to "build solution".
* Allow toggling between TBSTYLE_EX_VERTICAL and the manual TBSTATE_WRAP setting by
(un)definiting TBSTYLE_EX_VERTICAL.
CORE-7881
Modified:
branches/shell-experiments/base/shell/explorer-new/CMakeLists.txt
branches/shell-experiments/base/shell/filebrowser/CMakeLists.txt
branches/shell-experiments/base/shell/rshell/CMakeLists.txt
branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
branches/shell-experiments/base/shell/rshell/CMenuToolbars.h
Modified: branches/shell-experiments/base/shell/explorer-new/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/ex…
==============================================================================
--- branches/shell-experiments/base/shell/explorer-new/CMakeLists.txt [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/explorer-new/CMakeLists.txt [iso-8859-1] Mon Mar
3 11:14:04 2014
@@ -39,9 +39,3 @@
ntdll)
add_pch(explorer_new precomp.h SOURCE)
add_cd_file(TARGET explorer_new DESTINATION reactos FOR all)
-
-add_custom_command(TARGET explorer_new POST_BUILD
- COMMAND "${CMAKE_COMMAND}" -E copy
- "$<TARGET_FILE:rshell>"
- "$<TARGET_FILE_DIR:explorer_new>/$<TARGET_FILE_NAME:rshell>"
- COMMENT "Copying $<TARGET_FILE_NAME:rshell> to output")
Modified: branches/shell-experiments/base/shell/filebrowser/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/fi…
==============================================================================
--- branches/shell-experiments/base/shell/filebrowser/CMakeLists.txt [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/filebrowser/CMakeLists.txt [iso-8859-1] Mon Mar
3 11:14:04 2014
@@ -11,15 +11,4 @@
shell32
msvcrt
kernel32)
-
-add_custom_command(TARGET filebrowser POST_BUILD
- COMMAND "${CMAKE_COMMAND}" -E copy
- "$<TARGET_FILE:rshell>"
- "$<TARGET_FILE_DIR:filebrowser>/$<TARGET_FILE_NAME:rshell>"
- COMMENT "Copying $<TARGET_FILE_NAME:rshell> to output")
-
-add_custom_command(TARGET filebrowser POST_BUILD
- COMMAND "${CMAKE_COMMAND}" -E copy
- "$<TARGET_FILE:browseui>"
- "$<TARGET_FILE_DIR:filebrowser>/$<TARGET_FILE_NAME:browseui>"
- COMMENT "Copying $<TARGET_FILE_NAME:browseui> to output")
+
Modified: branches/shell-experiments/base/shell/rshell/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMakeLists.txt [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMakeLists.txt [iso-8859-1] Mon Mar 3
11:14:04 2014
@@ -43,3 +43,9 @@
ntdll)
add_cd_file(TARGET rshell DESTINATION reactos FOR all)
+
+add_custom_command(TARGET rshell POST_BUILD
+ COMMAND "${CMAKE_COMMAND}" -E copy
+ "$<TARGET_FILE:rshell>"
+ "$<TARGET_FILE_DIR:explorer_new>/$<TARGET_FILE_NAME:rshell>"
+ COMMENT "Copying to output directory")
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Mon Mar 3
11:14:04 2014
@@ -34,7 +34,8 @@
_Out_ void **ppv
);
-#define TBSTYLE_EX_VERTICAL 4
+// FIXME: Enable if/when wine comctl supports this flag properly
+//#define TBSTYLE_EX_VERTICAL 4
#define TIMERID_HOTTRACK 1
#define SUBCLASS_ID_MENUBAND 1
@@ -259,8 +260,10 @@
{
tbStyles |= CCS_VERT;
+#ifdef TBSTYLE_EX_VERTICAL
// FIXME: Use when it works in ros (?)
- //tbExStyles |= TBSTYLE_EX_VERTICAL | WS_EX_TOOLWINDOW;
+ tbExStyles |= TBSTYLE_EX_VERTICAL | WS_EX_TOOLWINDOW;
+#endif
}
RECT rc;
@@ -644,11 +647,15 @@
return S_FALSE;
}
-HRESULT CMenuToolbarBase::AddButton(DWORD commandId, LPCWSTR caption, BOOL hasSubMenu,
INT iconId, DWORD_PTR buttonData)
+HRESULT CMenuToolbarBase::AddButton(DWORD commandId, LPCWSTR caption, BOOL hasSubMenu,
INT iconId, DWORD_PTR buttonData, BOOL last)
{
TBBUTTON tbb = { 0 };
- tbb.fsState = TBSTATE_ENABLED | TBSTATE_WRAP;
+ tbb.fsState = TBSTATE_ENABLED;
+#ifndef TBSTYLE_EX_VERTICAL
+ if (!last)
+ tbb.fsState |= TBSTATE_WRAP;
+#endif
tbb.fsStyle = 0;
if (hasSubMenu)
@@ -665,11 +672,15 @@
return S_OK;
}
-HRESULT CMenuToolbarBase::AddSeparator()
+HRESULT CMenuToolbarBase::AddSeparator(BOOL last)
{
TBBUTTON tbb = { 0 };
- tbb.fsState = TBSTATE_ENABLED | TBSTATE_WRAP;
+ tbb.fsState = TBSTATE_ENABLED;
+#ifndef TBSTYLE_EX_VERTICAL
+ if (!last)
+ tbb.fsState |= TBSTATE_WRAP;
+#endif
tbb.fsStyle = BTNS_SEP;
tbb.iBitmap = 0;
@@ -683,7 +694,7 @@
TBBUTTON tbb = { 0 };
PCWSTR MenuString = L"(Empty)";
- tbb.fsState = TBSTATE_WRAP; // disabled
+ tbb.fsState = 0;
tbb.fsStyle = 0;
tbb.iString = (INT_PTR) MenuString;
tbb.iBitmap = -1;
@@ -773,11 +784,13 @@
for (i = 0; i < ic; i++)
{
+ BOOL last = i + 1 == ic;
+
MENUITEMINFOW info;
info.cbSize = sizeof(info);
info.dwTypeData = NULL;
- info.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING | MIIM_SUBMENU;
+ info.fMask = MIIM_FTYPE | MIIM_STRING;
GetMenuItemInfoW(m_hmenu, i, TRUE, &info);
@@ -786,7 +799,7 @@
info.cch++;
info.dwTypeData = (PWSTR) HeapAlloc(GetProcessHeap(), 0, (info.cch + 1) *
sizeof(WCHAR));
- info.fMask = MIIM_STRING;
+ info.fMask = MIIM_STRING | MIIM_SUBMENU | MIIM_ID;
GetMenuItemInfoW(m_hmenu, i, TRUE, &info);
SMINFO * sminfo = new SMINFO();
@@ -797,13 +810,13 @@
if (FAILED(hr))
return hr;
- AddButton(info.wID, info.dwTypeData, info.hSubMenu != NULL, sminfo->iIcon,
reinterpret_cast<DWORD_PTR>(sminfo));
+ AddButton(info.wID, info.dwTypeData, info.hSubMenu != NULL, sminfo->iIcon,
reinterpret_cast<DWORD_PTR>(sminfo), last);
HeapFree(GetProcessHeap(), 0, info.dwTypeData);
}
else
{
- AddSeparator();
+ AddSeparator(last);
}
}
@@ -881,7 +894,8 @@
LPITEMIDLIST item =
static_cast<LPITEMIDLIST>(CoTaskMemAlloc(sizeof(ITEMIDLIST)));
ULONG fetched;
- while ((hr = eidl->Next(1, &item, &fetched)) == S_OK)
+ hr = eidl->Next(1, &item, &fetched);
+ while (SUCCEEDED(hr) && fetched > 0)
{
INT index = 0;
INT indexOpen = 0;
@@ -904,7 +918,10 @@
DWORD_PTR dwData = reinterpret_cast<DWORD_PTR>(ILClone(item));
// FIXME: remove before deleting the toolbar or it will leak
- AddButton(++i, MenuString, attrs & SFGAO_FOLDER, index, dwData);
+ // Fetch next item already, so we know if the current one is the last
+ hr = eidl->Next(1, &item, &fetched);
+
+ AddButton(++i, MenuString, attrs & SFGAO_FOLDER, index, dwData, SUCCEEDED(hr)
&& fetched > 0);
CoTaskMemFree(MenuString);
}
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] Mon Mar 3
11:14:04 2014
@@ -87,8 +87,8 @@
LRESULT CALLBACK SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
- HRESULT AddButton(DWORD commandId, LPCWSTR caption, BOOL hasSubMenu, INT iconId,
DWORD_PTR buttonData);
- HRESULT AddSeparator();
+ HRESULT AddButton(DWORD commandId, LPCWSTR caption, BOOL hasSubMenu, INT iconId,
DWORD_PTR buttonData, BOOL last);
+ HRESULT AddSeparator(BOOL last);
HRESULT AddPlaceholder();
HRESULT UpdateImageLists();