Checking in a tweak to menu bar listener, and adding some popup set code.

This commit is contained in:
hyatt%netscape.com 1999-08-19 22:10:24 +00:00
Родитель 230f987244
Коммит 452311e2d9
4 изменённых файлов: 51 добавлений и 14 удалений

Просмотреть файл

@ -17,6 +17,6 @@
DEPTH=..\..\..
DIRS=src
DIRS=public src
include <$(DEPTH)\config\rules.mak>

Просмотреть файл

@ -70,7 +70,7 @@ nsMenuBarListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
}
if (aIID.Equals(nsCOMTypeInfo<nsIDOMEventReceiver>::GetIID())) {
*aInstancePtr = (void*)(nsIDOMEventListener*)(nsIDOMMouseMotionListener*)this;
*aInstancePtr = (void*)(nsIDOMEventListener*)(nsIDOMKeyListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}
@ -80,7 +80,7 @@ nsMenuBarListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return NS_OK;
}
if (aIID.Equals(nsCOMTypeInfo<nsISupports>::GetIID())) {
*aInstancePtr = (void*)(nsISupports*)(nsIDOMMouseMotionListener*)this;
*aInstancePtr = (void*)(nsISupports*)(nsIDOMKeyListener*)this;
NS_ADDREF_THIS();
return NS_OK;
}

Просмотреть файл

@ -78,7 +78,16 @@ NS_IMETHODIMP nsPopupSetFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
}
*aInstancePtr = NULL;
if (aIID.Equals(nsIPopupSetFrame::GetIID())) {
*aInstancePtr = (void*)(nsIPopupSetFrame*) this;
NS_ADDREF_THIS();
return NS_OK;
}
return nsBoxFrame::QueryInterface(aIID, aInstancePtr);
}
@ -354,3 +363,25 @@ nsPopupSetFrame::AppendFrames(nsIPresContext& aPresContext,
return rv;
}
NS_IMETHODIMP
nsPopupSetFrame::CreatePopup(nsIFrame* aElementFrame, nsIContent* aPopupContent,
PRInt32 aXPos, PRInt32 aYPos,
const nsString& aPopupType, const nsString& anAnchorAlignment,
const nsString& aPopupAlignment)
{
// Generate the popup.
//MarkAsGenerated(aPopupContent);
// Now we'll have it in our child frame list. Make it our active child.
//SetActiveChild(aPopupContent);
// Show the popup at the specified position.
mXPos = aXPos;
mYPos = aYPos;
// Mark the view as active.
//ActivateMenuPopup(PR_TRUE);
return NS_OK;
}

Просмотреть файл

@ -27,6 +27,7 @@
#include "nsIAtom.h"
#include "nsCOMPtr.h"
#include "nsIPopupSetFrame.h"
#include "nsIAnonymousContentCreator.h"
#include "nsBoxFrame.h"
#include "nsFrameList.h"
@ -37,7 +38,7 @@
nsresult NS_NewPopupSetFrame(nsIFrame** aResult) ;
class nsPopupSetFrame : public nsBoxFrame
class nsPopupSetFrame : public nsBoxFrame, public nsIPopupSetFrame
{
public:
nsPopupSetFrame();
@ -88,22 +89,27 @@ public:
nsIAtom* aListName,
nsIFrame* aOldFrame);
/*
void KeyboardNavigation(PRUint32 aDirection, PRBool& aHandledFlag);
void ShortcutNavigation(PRUint32 aLetter, PRBool& aHandledFlag);
void Escape(PRBool& aHandledFlag);
void Enter();
NS_IMETHOD CreatePopup(nsIFrame* aElementFrame, nsIContent* aPopupContent,
PRInt32 aXPos, PRInt32 aYPos,
const nsString& aPopupType, const nsString& anAnchorAlignment,
const nsString& aPopupAlignment);
//void ActivateMenuPopup(PRBool aActivateFlag);
PRBool IsOpen() { return mMenuOpen; };
protected:
void GetMenuChildrenElement(nsIContent** aResult);
*/
//void MarkAsGenerated();
//void SetActiveChild(nsIContent* aPopupContent);
protected:
nsFrameList mPopupFrames;
nsIFrame* mActiveChild;
nsIPresContext* mPresContext; // Our pres context.
PRInt32 mXPos; // Active child's x position
PRInt32 mYPos; // Active child's y position
}; // class nsPopupSetFrame
#endif