Author: dquintana Date: Fri May 23 21:22:48 2014 New Revision: 63426
URL: http://svn.reactos.org/svn/reactos?rev=63426&view=rev Log: [SHELL32] * Reuse the same menu instead of recreating it every time something changes. Fixes the menus not showing, but it's not the right way to do it. A better implementation should come later.
[BROWSEUI] * Add a german version of the toolbar strings, by Christoph von Wittich.
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp branches/shell-experiments/dll/win32/browseui/lang/de-DE.rc branches/shell-experiments/dll/win32/shell32/shlview.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] Fri May 23 21:22:48 2014 @@ -1156,7 +1156,6 @@ } else if (!(info.fType & MFT_BITMAP)) { - info.cch++; info.dwTypeData = (PWSTR) HeapAlloc(GetProcessHeap(), 0, (info.cch + 1) * sizeof(WCHAR));
Modified: branches/shell-experiments/dll/win32/browseui/lang/de-DE.rc URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/brow... ============================================================================== --- branches/shell-experiments/dll/win32/browseui/lang/de-DE.rc [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/lang/de-DE.rc [iso-8859-1] Fri May 23 21:22:48 2014 @@ -246,7 +246,7 @@
STRINGTABLE BEGIN - IDS_UP "Aufwärts" + IDS_UP "Ãbergeordneter Ordner" END
STRINGTABLE @@ -254,3 +254,10 @@ IDS_BACK "Zurück" IDS_FORWARD "Vorwärts" END + + +STRINGTABLE +BEGIN + IDS_STANDARD_TOOLBAR, "|Zurück|Vorwärts|Ãbergeordneter Ordner|Suchen|Ordner|Verschieben nach|Kopieren nach|Löschen|Rückgängig|Ansicht|Stop|Aktualisieren|Startseite|Netzlaufwerk verbinden|Netzlaufwerk trennen|Favoriten|Verlauf|Vollbild|Eigenschaften|Ausschneiden|Kopieren|Einfügen|Ordneroptionen||" +END +
Modified: branches/shell-experiments/dll/win32/shell32/shlview.cpp URL: http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/shel... ============================================================================== --- branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] Fri May 23 21:22:48 2014 @@ -1347,13 +1347,7 @@
if (m_uState != SVUIA_DEACTIVATE) { - if (m_hMenu) - { - m_pShellBrowser->SetMenuSB(0, 0, 0); - m_pShellBrowser->RemoveMenusSB(m_hMenu); - DestroyMenu(m_hMenu); - m_hMenu = 0; - } + // TODO: cleanup menu after deactivation
m_uState = SVUIA_DEACTIVATE; } @@ -1361,7 +1355,6 @@
void CDefView::DoActivate(UINT uState) { - OLEMENUGROUPWIDTHS omw = { {0, 0, 0, 0, 0, 0} }; MENUITEMINFOA mii; CHAR szText[MAX_PATH];
@@ -1378,14 +1371,28 @@ /*only do This if we are active */ if(uState != SVUIA_DEACTIVATE) { + // FIXME: windows does not do this. + + // temporary solution (HACK): wipe the contents and refill + { + OLEMENUGROUPWIDTHS omw = { { 0 } }; + + INT mic = GetMenuItemCount(m_hMenu); + for (int i = 0; i < mic; i++) + { + HMENU submenu = GetSubMenu(m_hMenu, 0); + RemoveMenu(m_hMenu, 0, MF_BYPOSITION); + if (submenu) + DestroyMenu(submenu); + } + + m_pShellBrowser->InsertMenusSB(m_hMenu, &omw); + } + /*merge the menus */ - m_hMenu = CreateMenu();
if(m_hMenu) { - m_pShellBrowser->InsertMenusSB(m_hMenu, &omw); - TRACE("-- after fnInsertMenusSB\n"); - /*build the top level menu get the menu item's text*/ strcpy(szText, "dummy 31");
@@ -1987,6 +1994,8 @@
HRESULT WINAPI CDefView::CreateViewWindow(IShellView *lpPrevView, LPCFOLDERSETTINGS lpfs, IShellBrowser *psb, RECT *prcView, HWND *phWnd) { + OLEMENUGROUPWIDTHS omw = { { 0, 0, 0, 0, 0, 0 } }; + *phWnd = 0;
TRACE("(%p)->(shlview=%p set=%p shlbrs=%p rec=%p hwnd=%p) incomplete\n", this, lpPrevView, lpfs, psb, prcView, phWnd); @@ -2027,6 +2036,13 @@
SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); UpdateWindow(); + + if (!m_hMenu) + { + m_hMenu = CreateMenu(); + m_pShellBrowser->InsertMenusSB(m_hMenu, &omw); + TRACE("-- after fnInsertMenusSB\n"); + }
return S_OK; }