mirror of
https://github.com/reactos/reactos.git
synced 2025-07-24 21:23:50 +00:00
[SHELL32]
* Improve the view menu handler a bit. Now the view menu properly marks the current view as expected. svn path=/branches/shell-experiments/; revision=63811
This commit is contained in:
parent
d13da089e5
commit
a4bc6818ab
1 changed files with 11 additions and 19 deletions
|
@ -1095,15 +1095,13 @@ void CDefView::MergeViewMenu(HMENU hSubMenu)
|
||||||
if (!hSubMenu)
|
if (!hSubMenu)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
__debugbreak();
|
// FIXME: I believe windows has all of the items initially in the menu,
|
||||||
|
// and actively calls DeleteMenu on the items that should not be disaplyed.
|
||||||
|
|
||||||
DWORD item;
|
MENUITEMINFOW mii = { 0 };
|
||||||
item |= SHCheckMenuItem(hSubMenu, FCIDM_SHVIEW_BIGICON, FALSE);
|
mii.cbSize = sizeof(mii);
|
||||||
item |= SHCheckMenuItem(hSubMenu, FCIDM_SHVIEW_SMALLICON, FALSE);
|
mii.fMask = MIIM_ID | MIIM_STATE;
|
||||||
item |= SHCheckMenuItem(hSubMenu, FCIDM_SHVIEW_LISTVIEW, FALSE);
|
if (::GetMenuItemInfoW(hSubMenu, FCIDM_SHVIEW_BIGICON, FALSE, &mii) == 0)
|
||||||
item |= SHCheckMenuItem(hSubMenu, FCIDM_SHVIEW_REPORTVIEW, FALSE);
|
|
||||||
|
|
||||||
if (item == -1)
|
|
||||||
{
|
{
|
||||||
HMENU menubase = ::LoadMenuW(shell32_hInstance, L"MENU_001");
|
HMENU menubase = ::LoadMenuW(shell32_hInstance, L"MENU_001");
|
||||||
|
|
||||||
|
@ -1112,9 +1110,9 @@ void CDefView::MergeViewMenu(HMENU hSubMenu)
|
||||||
INT count = ::GetMenuItemCount(menubase);
|
INT count = ::GetMenuItemCount(menubase);
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
MENUITEMINFOW mii = { 0 };
|
|
||||||
WCHAR label[128];
|
WCHAR label[128];
|
||||||
|
|
||||||
|
ZeroMemory(&mii, sizeof(mii));
|
||||||
mii.cbSize = sizeof(mii);
|
mii.cbSize = sizeof(mii);
|
||||||
mii.fMask = MIIM_STATE | MIIM_ID | MIIM_SUBMENU | MIIM_CHECKMARKS | MIIM_DATA | MIIM_STRING | MIIM_BITMAP | MIIM_FTYPE;
|
mii.fMask = MIIM_STATE | MIIM_ID | MIIM_SUBMENU | MIIM_CHECKMARKS | MIIM_DATA | MIIM_STRING | MIIM_BITMAP | MIIM_FTYPE;
|
||||||
mii.dwTypeData = label;
|
mii.dwTypeData = label;
|
||||||
|
@ -1131,18 +1129,12 @@ void CDefView::MergeViewMenu(HMENU hSubMenu)
|
||||||
::DestroyMenu(menubase);
|
::DestroyMenu(menubase);
|
||||||
}
|
}
|
||||||
|
|
||||||
DbgPrint("View mode is %d\n", m_FolderSettings.ViewMode);
|
|
||||||
|
|
||||||
if (m_FolderSettings.ViewMode >= FVM_FIRST && m_FolderSettings.ViewMode <= FVM_LAST)
|
if (m_FolderSettings.ViewMode >= FVM_FIRST && m_FolderSettings.ViewMode <= FVM_LAST)
|
||||||
{
|
{
|
||||||
UINT iItem = FCIDM_SHVIEW_BIGICON + m_FolderSettings.ViewMode - FVM_FIRST;
|
UINT iItemFirst = FCIDM_SHVIEW_BIGICON;
|
||||||
DbgPrint("Checking item %d ...\n", iItem);
|
UINT iItemLast = iItemFirst + FVM_LAST - FVM_FIRST;
|
||||||
item = SHCheckMenuItem(hSubMenu, iItem, TRUE);
|
UINT iItem = iItemFirst + m_FolderSettings.ViewMode - FVM_FIRST;
|
||||||
DbgPrint("SHCheckMenuItem returned %d\n", item);
|
CheckMenuRadioItem(hSubMenu, iItemFirst, iItemLast, iItem, MF_BYCOMMAND);
|
||||||
if (item == -1)
|
|
||||||
{
|
|
||||||
DbgPrint("GetLastError returned %d\n", GetLastError());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue