changing nsIMenuItem for context menu support

This commit is contained in:
saari%netscape.com 1999-05-11 18:16:25 +00:00
Родитель 7eeb4072f4
Коммит 53aeaf5d49
3 изменённых файлов: 19 добавлений и 37 удалений

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

@ -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;

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

@ -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)) {

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

@ -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);