From ebb56bf41c66cc8fc86346bf8bb639830b6d268c Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Thu, 18 Feb 1999 16:32:44 +0000 Subject: [PATCH] Added a little code to find the menus and load them. They aren't hooked up yet. git-svn-id: svn://10.0.0.236/trunk@21143 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpfe/appshell/src/nsWebShellWindow.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp index 5249c9d77a9..5361595e4d4 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp @@ -458,7 +458,7 @@ void nsWebShellWindow::LoadMenus(nsIDOMDocument * aDOMDoc, nsIWidget * aParentWi // Set nsMenu Name pnsMenu->SetLabel(menuName); // Make nsMenu a child of nsMenuBar - //pnsMenuBar->AddMenu(pnsMenu); // XXX adds an additional menu + pnsMenuBar->AddMenu(pnsMenu); // XXX adds an additional menu // Begin menuitem inner loop nsCOMPtr menuitemNode; @@ -484,7 +484,7 @@ void nsWebShellWindow::LoadMenus(nsIDOMDocument * aDOMDoc, nsIWidget * aParentWi // Set nsMenuItem Name pnsMenuItem->SetLabel(menuitemName); // Make nsMenuItem a child of nsMenu - //pnsMenu->AddMenuItem(pnsMenuItem); // XXX adds an additional item + pnsMenu->AddMenuItem(pnsMenuItem); // XXX adds an additional item /* ConnectCommandToOneGUINode(menuitemNode); @@ -526,7 +526,7 @@ void nsWebShellWindow::LoadMenus(nsIDOMDocument * aDOMDoc, nsIWidget * aParentWi } // end while (nsnull != menuNode) // Give the aParentWindow this nsMenuBar to hold onto. - //mWindow->SetMenuBar(pnsMenuBar); + mWindow->SetMenuBar(pnsMenuBar); // HACK: force a paint for now pnsMenuBar->Paint(); @@ -648,9 +648,13 @@ nsCOMPtr nsWebShellWindow::GetNamedDOMDoc(const nsString & aWebS // first get the toolbar child WebShell nsCOMPtr childWebShell; - mWebShell->FindChildWithName(aWebShellName, *getter_AddRefs(childWebShell)); - if (!childWebShell) - return domDoc; + if (aWebShellName.Equals("this")) { // XXX small kludge for code reused + childWebShell = mWebShell; + } else { + mWebShell->FindChildWithName(aWebShellName, *getter_AddRefs(childWebShell)); + if (!childWebShell) + return domDoc; + } nsCOMPtr cv; childWebShell->GetContentViewer(getter_AddRefs(cv)); @@ -708,7 +712,7 @@ NS_IMETHODIMP nsWebShellWindow::OnConnectionsComplete() /////////////////////////////// // Find the Menubar DOM and Load the menus, hooking them up to the loaded commands /////////////////////////////// - nsCOMPtr menubarDOMDoc(GetNamedDOMDoc(nsAutoString("browser.toolbar"))); + nsCOMPtr menubarDOMDoc(GetNamedDOMDoc(nsAutoString("this"))); // XXX "this" is a small kludge for code reused if (menubarDOMDoc) LoadMenus(menubarDOMDoc, mWindow);