mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 15:55:16 +00:00
Checking in a tweak to menu bar listener, and adding some popup set code.
This commit is contained in:
parent
230f987244
commit
452311e2d9
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user