changing nsIMenuItem for context menu support

git-svn-id: svn://10.0.0.236/trunk@31084 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
saari%netscape.com
1999-05-11 18:16:25 +00:00
parent c8dccd87f9
commit 91c95ea168
3 changed files with 19 additions and 37 deletions

View File

@@ -48,29 +48,9 @@ class nsIMenuItem : public nsISupports {
* Creates the MenuItem
*
*/
NS_IMETHOD Create(nsIMenu *aParent,
const nsString &aLabel,
PRBool isSeparator) = 0;
/**
* Creates the MenuItem
*
*/
NS_IMETHOD Create(nsIPopUpMenu *aParent,
const nsString &aLabel,
PRUint32 aCommand) = 0;
/**
* Creates the MenuItem as a Separator
*
*/
NS_IMETHOD Create(nsIMenu *aParent) = 0;
/**
* Creates the MenuItem as a Separator
*
*/
NS_IMETHOD Create(nsIPopUpMenu *aParent) = 0;
NS_IMETHOD Create(nsISupports * aParent,
const nsString & aLabel,
PRBool isSeparator) = 0;
/**
* Get the MenuItem label
@@ -79,7 +59,7 @@ class nsIMenuItem : public nsISupports {
NS_IMETHOD GetLabel(nsString &aText) = 0;
/**
* Get the MenuItem label
* Get the MenuItem label
*
*/
NS_IMETHOD SetLabel(nsString &aText) = 0;

View File

@@ -203,7 +203,7 @@ nsIWidget * nsMenuItem::GetMenuBarParent(nsISupports * aParent)
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::Create(nsIMenu * aParent,
NS_METHOD nsMenuItem::Create(nsISupports * aParent,
const nsString & aLabel,
PRBool aIsSeparator)
@@ -212,8 +212,12 @@ NS_METHOD nsMenuItem::Create(nsIMenu * aParent,
return NS_ERROR_FAILURE;
}
mMenuParent = aParent;
if(aParent){
nsIMenu * menu;
aParent->QueryInterface(kIMenuIID, (void**) &menu);
mMenuParent = menu;
NS_RELEASE(menu);
}
nsIWidget * widget = nsnull; // MenuBar's Parent
nsISupports * sups;
if (NS_OK == aParent->QueryInterface(kISupportsIID,(void**)&sups)) {

View File

@@ -45,17 +45,10 @@ public:
// nsISupports
NS_DECL_ISUPPORTS
NS_IMETHOD Create(nsIMenu *aParent,
const nsString &aLabel,
PRBool aIsSeparator);
NS_IMETHOD Create(nsIPopUpMenu *aParent,
const nsString &aLabel,
PRUint32 aCommand) ;
NS_IMETHOD Create(nsIMenu * aParent);
NS_IMETHOD Create(nsIPopUpMenu * aParent);
// nsIMenuBar Methods
NS_IMETHOD Create(nsISupports *aParent,
const nsString &aLabel,
PRBool aIsSeparator);
NS_IMETHOD GetLabel(nsString &aText);
NS_IMETHOD SetLabel(nsString &aText);
NS_IMETHOD SetEnabled(PRBool aIsEnabled);
@@ -87,6 +80,11 @@ public:
nsEventStatus MenuDestruct(const nsMenuEvent & aMenuEvent);
protected:
NS_IMETHOD Create(nsIPopUpMenu *aParent,
const nsString &aLabel,
PRUint32 aCommand) ;
NS_IMETHOD Create(nsIMenu * aParent);
NS_IMETHOD Create(nsIPopUpMenu * aParent);
void Create(nsIWidget * aMBParent, GtkWidget *aParent,
const nsString &aLabel, PRBool aIsSeparator);
nsIWidget *GetMenuBarParent(nsISupports * aParentSupports);