nsIMenuItem changes for context menus

This commit is contained in:
saari%netscape.com 1999-05-11 18:15:48 +00:00
Родитель a62a14d61d
Коммит e92b2b2d4c
6 изменённых файлов: 34 добавлений и 27 удалений

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

@ -114,6 +114,10 @@
{ 0xf3131891, 0x3dc7, 0x11d2, \
{ 0x8d, 0xb8, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
//-----------------------------------------------------------
// Menus
//-----------------------------------------------------------
// {BC658C81-4BEB-11d2-8DBB-00609703C14E}
#define NS_MENUBAR_CID \
{ 0xbc658c81, 0x4beb, 0x11d2, \
@ -129,6 +133,14 @@
{ 0x7f045771, 0x4beb, 0x11d2, \
{ 0x8d, 0xbb, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
// {1677DAE1-04E2-11d3-B35C-00A0CC3C1CDE}
#define NS_CONTEXTMENU_CID \
{ 0x1677dae1, 0x4e2, 0x11d3, \
{ 0xb3, 0x5c, 0x0, 0xa0, 0xcc, 0x3c, 0x1c, 0xde } };
// deb24690-35f8-11d2-9248-00805f8a7ab6
#define NS_TOOLBAR_CID \
{ 0xdeb24690, 0x35f8, 0x11d2, \

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

@ -184,7 +184,7 @@ nsIWidget * nsMenuItem::GetMenuBarParent(nsISupports * aParent)
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::Create(nsIMenu *aParent,
NS_METHOD nsMenuItem::Create(nsISupports *aParent,
const nsString &aLabel,
PRBool aIsSeparator)

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

@ -42,17 +42,10 @@ public:
// nsISupports
NS_DECL_ISUPPORTS
NS_IMETHOD Create(nsIMenu *aParent,
// nsIMenuItem Methods
NS_IMETHOD Create(nsISupports *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 GetLabel(nsString &aText);
NS_IMETHOD SetLabel(nsString &aText);
NS_IMETHOD SetEnabled(PRBool aIsEnabled);
@ -84,6 +77,12 @@ 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, Widget aParent,
//const nsString &aLabel, PRUint32 aCommand);
nsIWidget * GetMenuBarParent(nsISupports * aParentSupports);

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

@ -147,20 +147,17 @@ nsIWidget * nsMenuItem::GetMenuBarParent(nsISupports * aParent)
//-------------------------------------------------------------------------
NS_METHOD nsMenuItem::Create(
nsIMenu * aParent,
nsISupports * aParent,
const nsString &aLabel,
PRBool aIsSeparator)
{
//mCommand = aCommand;
mLabel = aLabel;
mMenu = aParent;
//NS_ADDREF(mMenu);
nsISupports * sups;
if (NS_OK == aParent->QueryInterface(kISupportsIID,(void**)&sups)) {
//mTarget = GetMenuBarParent(sups);
NS_RELEASE(sups);
mLabel = aLabel;
mIsSeparator = aIsSeparator;
nsIMenu * menu = nsnull;
if (NS_OK == aParent->QueryInterface(kIMenuIID,(void**)&menu)) {
mMenu = menu;
NS_RELEASE(menu);
} else {
mTarget = nsnull;
}

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

@ -47,10 +47,7 @@ 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);
NS_IMETHOD Create(nsISupports * aParent, const nsString &aLabel, PRBool aIsSeparator);
// nsIMenuBar Methods
NS_IMETHOD SetDOMElement(nsIDOMElement * aDOMElement);
@ -88,6 +85,10 @@ public:
PRInt32 GetCmdId();
protected:
NS_IMETHOD Create(nsIPopUpMenu * aParent, const nsString &aLabel, PRUint32 aCommand);
NS_IMETHOD Create(nsIMenu * aParent);
NS_IMETHOD Create(nsIPopUpMenu * aParent);
nsIWidget * GetMenuBarParent(nsISupports * aParent);
nsString mLabel;

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

@ -1441,7 +1441,6 @@ static void AdjustMenus(nsIMenu * aCurrentMenu, nsIMenu * aNewMenu, nsMenuEvent
nsIMenuListener * listener;
if (NS_OK == aCurrentMenu->QueryInterface(kIMenuListenerIID, (void **)&listener)) {
//listener->MenuDeselected(aEvent);
//listener->MenuDestruct(aEvent);
NS_RELEASE(listener);
}
}
@ -1450,7 +1449,6 @@ static void AdjustMenus(nsIMenu * aCurrentMenu, nsIMenu * aNewMenu, nsMenuEvent
if (NS_OK == aNewMenu->QueryInterface(kIMenuListenerIID, (void **)&listener)) {
NS_ASSERTION(false, "get debugger");
//listener->MenuSelected(aEvent);
//listener->MenuConstruct(aEvent, this, null);
NS_RELEASE(listener);
}
}