[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.

svn path=/branches/shell-experiments/; revision=63426
This commit is contained in:
David Quintana 2014-05-23 21:22:48 +00:00
parent baa587134e
commit fe43858e1e
3 changed files with 36 additions and 14 deletions

View file

@ -1156,7 +1156,6 @@ HRESULT CMenuStaticToolbar::FillToolbar(BOOL clearFirst)
} }
else if (!(info.fType & MFT_BITMAP)) else if (!(info.fType & MFT_BITMAP))
{ {
info.cch++; info.cch++;
info.dwTypeData = (PWSTR) HeapAlloc(GetProcessHeap(), 0, (info.cch + 1) * sizeof(WCHAR)); info.dwTypeData = (PWSTR) HeapAlloc(GetProcessHeap(), 0, (info.cch + 1) * sizeof(WCHAR));

View file

@ -246,7 +246,7 @@ END
STRINGTABLE STRINGTABLE
BEGIN BEGIN
IDS_UP "Aufwärts" IDS_UP "Übergeordneter Ordner"
END END
STRINGTABLE STRINGTABLE
@ -254,3 +254,10 @@ BEGIN
IDS_BACK "Zurück" IDS_BACK "Zurück"
IDS_FORWARD "Vorwärts" IDS_FORWARD "Vorwärts"
END 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

View file

@ -1347,13 +1347,7 @@ void CDefView::OnDeactivate()
if (m_uState != SVUIA_DEACTIVATE) if (m_uState != SVUIA_DEACTIVATE)
{ {
if (m_hMenu) // TODO: cleanup menu after deactivation
{
m_pShellBrowser->SetMenuSB(0, 0, 0);
m_pShellBrowser->RemoveMenusSB(m_hMenu);
DestroyMenu(m_hMenu);
m_hMenu = 0;
}
m_uState = SVUIA_DEACTIVATE; m_uState = SVUIA_DEACTIVATE;
} }
@ -1361,7 +1355,6 @@ void CDefView::OnDeactivate()
void CDefView::DoActivate(UINT uState) void CDefView::DoActivate(UINT uState)
{ {
OLEMENUGROUPWIDTHS omw = { {0, 0, 0, 0, 0, 0} };
MENUITEMINFOA mii; MENUITEMINFOA mii;
CHAR szText[MAX_PATH]; CHAR szText[MAX_PATH];
@ -1378,14 +1371,28 @@ void CDefView::DoActivate(UINT uState)
/*only do This if we are active */ /*only do This if we are active */
if(uState != SVUIA_DEACTIVATE) 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 */ /*merge the menus */
m_hMenu = CreateMenu();
if(m_hMenu) if(m_hMenu)
{ {
m_pShellBrowser->InsertMenusSB(m_hMenu, &omw);
TRACE("-- after fnInsertMenusSB\n");
/*build the top level menu get the menu item's text*/ /*build the top level menu get the menu item's text*/
strcpy(szText, "dummy 31"); strcpy(szText, "dummy 31");
@ -1987,6 +1994,8 @@ HRESULT WINAPI CDefView::Refresh()
HRESULT WINAPI CDefView::CreateViewWindow(IShellView *lpPrevView, LPCFOLDERSETTINGS lpfs, IShellBrowser *psb, RECT *prcView, HWND *phWnd) HRESULT WINAPI CDefView::CreateViewWindow(IShellView *lpPrevView, LPCFOLDERSETTINGS lpfs, IShellBrowser *psb, RECT *prcView, HWND *phWnd)
{ {
OLEMENUGROUPWIDTHS omw = { { 0, 0, 0, 0, 0, 0 } };
*phWnd = 0; *phWnd = 0;
TRACE("(%p)->(shlview=%p set=%p shlbrs=%p rec=%p hwnd=%p) incomplete\n", this, lpPrevView, lpfs, psb, prcView, phWnd); TRACE("(%p)->(shlview=%p set=%p shlbrs=%p rec=%p hwnd=%p) incomplete\n", this, lpPrevView, lpfs, psb, prcView, phWnd);
@ -2028,6 +2037,13 @@ HRESULT WINAPI CDefView::CreateViewWindow(IShellView *lpPrevView, LPCFOLDERSETTI
SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
UpdateWindow(); UpdateWindow();
if (!m_hMenu)
{
m_hMenu = CreateMenu();
m_pShellBrowser->InsertMenusSB(m_hMenu, &omw);
TRACE("-- after fnInsertMenusSB\n");
}
return S_OK; return S_OK;
} }