зеркало из https://github.com/mozilla/pjs.git
Added SetParent method
This commit is contained in:
Родитель
06796df9d0
Коммит
3ab3a2eb61
|
@ -50,6 +50,12 @@ class nsIMenuBar : public nsISupports {
|
|||
*/
|
||||
NS_IMETHOD GetParent(nsIWidget *&aParent) = 0;
|
||||
|
||||
/**
|
||||
* Set the MenuBar's Parent
|
||||
*
|
||||
*/
|
||||
NS_IMETHOD SetParent(nsIWidget *aParent) = 0;
|
||||
|
||||
/**
|
||||
* Adds the Menu
|
||||
*
|
||||
|
|
|
@ -89,8 +89,7 @@ nsMenuBar::~nsMenuBar()
|
|||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsMenuBar::Create(nsIWidget *aParent)
|
||||
{
|
||||
mParent = aParent;
|
||||
NS_IF_ADDREF(mParent);
|
||||
SetParent(aParent);
|
||||
mMenuBar = gtk_menu_bar_new();
|
||||
mParent->SetMenuBar(this);
|
||||
gtk_widget_show(mMenuBar);
|
||||
|
@ -106,6 +105,16 @@ NS_METHOD nsMenuBar::GetParent(nsIWidget *&aParent)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsMenuBar::SetParent(nsIWidget *aParent)
|
||||
{
|
||||
|
||||
NS_IF_RELEASE(mParent);
|
||||
mParent = aParent;
|
||||
NS_IF_ADDREF(mParent);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsMenuBar::AddMenu(nsIMenu * aMenu)
|
||||
{
|
||||
|
@ -189,4 +198,3 @@ nsEventStatus nsMenuBar::MenuDeselected(const nsMenuEvent & aMenuEvent)
|
|||
{
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ public:
|
|||
|
||||
// nsIMenuBar Methods
|
||||
NS_IMETHOD GetParent(nsIWidget *&aParent);
|
||||
NS_IMETHOD SetParent(nsIWidget * aParent);
|
||||
NS_IMETHOD AddMenu(nsIMenu * aMenu);
|
||||
NS_IMETHOD GetMenuCount(PRUint32 &aCount);
|
||||
NS_IMETHOD GetMenuAt(const PRUint32 aCount, nsIMenu *& aMenu);
|
||||
|
@ -63,4 +64,3 @@ protected:
|
|||
};
|
||||
|
||||
#endif // nsMenuBar_h__
|
||||
|
||||
|
|
|
@ -130,8 +130,7 @@ nsMenuBar::~nsMenuBar()
|
|||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsMenuBar::Create(nsIWidget *aParent)
|
||||
{
|
||||
mParent = aParent;
|
||||
NS_IF_ADDREF(mParent);
|
||||
SetParent(aParent);
|
||||
|
||||
//Widget parentWidget = (Widget)mParent->GetNativeData(NS_NATIVE_WIDGET);
|
||||
|
||||
|
@ -154,6 +153,17 @@ NS_METHOD nsMenuBar::GetParent(nsIWidget *&aParent)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsMenuBar::SetParent(nsIWidget *aParent)
|
||||
{
|
||||
|
||||
NS_IF_RELEASE(mParent);
|
||||
mParent = aParent;
|
||||
NS_IF_ADDREF(mParent);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsMenuBar::AddMenu(nsIMenu * aMenu)
|
||||
{
|
||||
|
|
|
@ -47,6 +47,7 @@ public:
|
|||
|
||||
// nsIMenuBar Methods
|
||||
NS_IMETHOD GetParent(nsIWidget *&aParent);
|
||||
NS_IMETHOD SetParent(nsIWidget * aParent);
|
||||
NS_IMETHOD AddMenu(nsIMenu * aMenu);
|
||||
NS_IMETHOD GetMenuCount(PRUint32 &aCount);
|
||||
NS_IMETHOD GetMenuAt(const PRUint32 aCount, nsIMenu *& aMenu);
|
||||
|
|
|
@ -99,8 +99,7 @@ nsMenuBar::~nsMenuBar()
|
|||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsMenuBar::Create(nsIWidget *aParent)
|
||||
{
|
||||
mParent = aParent;
|
||||
NS_ADDREF(mParent);
|
||||
SetParent(aParent);
|
||||
Widget parentWidget = (Widget)mParent->GetNativeData(NS_NATIVE_WIDGET);
|
||||
Widget mainWindow = XtParent(parentWidget);
|
||||
mMenu = XmCreateMenuBar(mainWindow, "menubar", nsnull, 0);
|
||||
|
@ -117,6 +116,16 @@ NS_METHOD nsMenuBar::GetParent(nsIWidget *&aParent)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsMenuBar::SetParent(nsIWidget *aParent)
|
||||
{
|
||||
|
||||
NS_IF_RELEASE(mParent);
|
||||
mParent = aParent;
|
||||
NS_IF_ADDREF(mParent);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsMenuBar::AddMenu(nsIMenu * aMenu)
|
||||
{
|
||||
|
@ -165,4 +174,4 @@ NS_METHOD nsMenuBar::GetNativeData(void *& aData)
|
|||
NS_METHOD nsMenuBar::Paint()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ public:
|
|||
|
||||
// nsIMenuBar Methods
|
||||
NS_IMETHOD GetParent(nsIWidget *&aParent);
|
||||
NS_IMETHOD SetParent(nsIWidget * aParent);
|
||||
NS_IMETHOD AddMenu(nsIMenu * aMenu);
|
||||
NS_IMETHOD GetMenuCount(PRUint32 &aCount);
|
||||
NS_IMETHOD GetMenuAt(const PRUint32 aCount, nsIMenu *& aMenu);
|
||||
|
|
|
@ -114,8 +114,7 @@ nsMenuBar::~nsMenuBar()
|
|||
NS_METHOD nsMenuBar::Create(nsIWidget *aParent)
|
||||
{
|
||||
mMenu = CreateMenu();
|
||||
mParent = aParent;
|
||||
NS_ADDREF(mParent);
|
||||
SetParent(aParent);
|
||||
return NS_OK;
|
||||
|
||||
}
|
||||
|
@ -128,6 +127,16 @@ NS_METHOD nsMenuBar::GetParent(nsIWidget *&aParent)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsMenuBar::SetParent(nsIWidget *aParent)
|
||||
{
|
||||
|
||||
NS_IF_RELEASE(mParent);
|
||||
mParent = aParent;
|
||||
NS_IF_ADDREF(mParent);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsMenuBar::AddMenu(nsIMenu * aMenu)
|
||||
{
|
||||
|
|
|
@ -51,6 +51,7 @@ public:
|
|||
|
||||
// nsIMenuBar Methods
|
||||
NS_IMETHOD GetParent(nsIWidget *&aParent);
|
||||
NS_IMETHOD SetParent(nsIWidget * aParent);
|
||||
NS_IMETHOD AddMenu(nsIMenu * aMenu);
|
||||
NS_IMETHOD GetMenuCount(PRUint32 &aCount);
|
||||
NS_IMETHOD GetMenuAt(const PRUint32 aPos, nsIMenu *& aMenu);
|
||||
|
|
Загрузка…
Ссылка в новой задаче