mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
teach (or stub) nsWidget to show/hide and query visible state of menubars
This commit is contained in:
parent
65be2563be
commit
63d352e236
@ -524,14 +524,21 @@ class nsIWidget : public nsISupports {
|
||||
NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar) = 0;
|
||||
|
||||
/**
|
||||
* Set the widget's MenuBar's visibility, without affecting ownership
|
||||
* or any other sticky considerations.
|
||||
* Set the widget's MenuBar's visibility
|
||||
*
|
||||
* @param aShow PR_TRUE to show, PR_FALSE to hide
|
||||
*/
|
||||
|
||||
NS_IMETHOD ShowMenuBar(PRBool aShow) = 0;
|
||||
|
||||
/**
|
||||
* Query whether the widget's MenuBar is visible
|
||||
*
|
||||
* @param aVisible PR_TRUE if currently visible, PR_FALSE if not
|
||||
*/
|
||||
|
||||
NS_IMETHOD IsMenuBarVisible(PRBool *aVisible) = 0;
|
||||
|
||||
/**
|
||||
* Set the collection of tooltip rectangles.
|
||||
* A NS_SHOW_TOOLTIP event is generated when the mouse hovers over one
|
||||
|
@ -775,6 +775,13 @@ NS_METHOD nsWidget::ShowMenuBar(PRBool aShow)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsWidget::IsMenuBarVisible(PRBool *aVisible)
|
||||
{
|
||||
g_print("bleh\n");
|
||||
NS_NOTYETIMPLEMENTED("nsWidget::IsMenuBarvisible");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsWidget::CreateWidget(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
|
@ -110,6 +110,7 @@ class nsWidget : public nsBaseWidget
|
||||
NS_IMETHOD Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect);
|
||||
NS_IMETHOD SetMenuBar(nsIMenuBar *aMenuBar);
|
||||
NS_IMETHOD ShowMenuBar(PRBool aShow);
|
||||
NS_IMETHOD IsMenuBarVisible(PRBool *aVisible);
|
||||
|
||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
|
||||
NS_IMETHOD Invalidate(const nsRect &aRect, PRBool aIsSynchronous);
|
||||
|
@ -597,7 +597,14 @@ NS_METHOD nsWindow::SetMenuBar(nsIMenuBar* aMenuBar)
|
||||
|
||||
NS_METHOD nsWindow::ShowMenuBar(PRBool aShow)
|
||||
{
|
||||
return NS_ERROR_FAILURE; // DRaM
|
||||
return NS_ERROR_FAILURE; // todo: danm
|
||||
}
|
||||
|
||||
|
||||
NS_METHOD nsWindow::IsMenuBarVisible(PRBool *aVisible)
|
||||
{
|
||||
*aVisible = PR_TRUE;
|
||||
return NS_ERROR_FAILURE; // todo: danm
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
@ -62,6 +62,7 @@ public:
|
||||
GdkBitmap *window_mask);
|
||||
NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar);
|
||||
NS_IMETHOD ShowMenuBar(PRBool aShow);
|
||||
NS_IMETHOD IsMenuBarVisible(PRBool *aVisible);
|
||||
|
||||
NS_IMETHOD SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[]);
|
||||
NS_IMETHOD UpdateTooltips(nsRect* aNewTips[]);
|
||||
|
@ -410,6 +410,12 @@ NS_IMETHODIMP nsWindow::ShowMenuBar(PRBool aShow)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsWindow::IsMenuBarVisible(PRBool *aVisible)
|
||||
{
|
||||
*aVisible = PR_TRUE; // likely to be true
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Get the widget's MenuBar.
|
||||
|
@ -122,6 +122,7 @@ public:
|
||||
|
||||
NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar);
|
||||
NS_IMETHOD ShowMenuBar(PRBool aShow);
|
||||
NS_IMETHOD IsMenuBarVisible(PRBool *aVisible);
|
||||
virtual nsIMenuBar* GetMenuBar();
|
||||
NS_IMETHOD GetPreferredSize(PRInt32& aWidth, PRInt32& aHeight);
|
||||
NS_IMETHOD SetPreferredSize(PRInt32 aWidth, PRInt32 aHeight);
|
||||
|
@ -1604,6 +1604,12 @@ NS_METHOD nsWindow::ShowMenuBar(PRBool aShow)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_METHOD nsWindow::IsMenuBarVisible(PRBool *aVisible)
|
||||
{
|
||||
*aVisible = PR_TRUE;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_METHOD nsWindow::GetPreferredSize(PRInt32& aWidth, PRInt32& aHeight)
|
||||
{
|
||||
aWidth = mPreferredWidth;
|
||||
|
@ -131,6 +131,7 @@ public:
|
||||
NS_IMETHOD EndResizingChildren(void);
|
||||
NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar);
|
||||
NS_IMETHOD ShowMenuBar(PRBool aShow);
|
||||
NS_IMETHOD IsMenuBarVisible(PRBool *aVisible);
|
||||
NS_IMETHOD GetPreferredSize(PRInt32& aWidth, PRInt32& aHeight);
|
||||
NS_IMETHOD SetPreferredSize(PRInt32 aWidth, PRInt32 aHeight);
|
||||
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus);
|
||||
|
@ -872,6 +872,12 @@ NS_METHOD nsWindow::ShowMenuBar( PRBool aShow)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_METHOD nsWindow::IsMenuBarVisible( PRBool *aVisible )
|
||||
{
|
||||
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWindow::IsMenuBarVisible - Not Implemented \n"));
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -62,6 +62,7 @@ public:
|
||||
NS_IMETHOD SetTitle(const nsString& aTitle);
|
||||
NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar);
|
||||
NS_IMETHOD ShowMenuBar(PRBool aShow);
|
||||
NS_IMETHOD IsMenuBarVisible(PRBool *aVisible);
|
||||
|
||||
NS_IMETHOD GetBounds( nsRect &aRect );
|
||||
NS_IMETHOD GetClientBounds( nsRect &aRect );
|
||||
|
@ -3230,6 +3230,13 @@ NS_METHOD nsWindow::ShowMenuBar(PRBool aShow)
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_METHOD nsWindow::IsMenuBarVisible(PRBool *aVisible)
|
||||
{
|
||||
HMENU menu = ::GetMenu(mWnd);
|
||||
*aVisible = menu ? PR_TRUE : PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsWindow::GetPreferredSize(PRInt32& aWidth, PRInt32& aHeight)
|
||||
{
|
||||
aWidth = mPreferredWidth;
|
||||
|
@ -120,6 +120,7 @@ public:
|
||||
NS_IMETHOD SetTitle(const nsString& aTitle);
|
||||
NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar);
|
||||
NS_IMETHOD ShowMenuBar(PRBool aShow);
|
||||
NS_IMETHOD IsMenuBarVisible(PRBool *aVisible);
|
||||
NS_IMETHOD SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[]);
|
||||
NS_IMETHOD RemoveTooltips();
|
||||
NS_IMETHOD UpdateTooltips(nsRect* aNewTips[]);
|
||||
|
@ -208,7 +208,12 @@ NS_IMETHODIMP nsWidget::SetMenuBar(nsIMenuBar * aMenuBar)
|
||||
|
||||
NS_IMETHODIMP nsWidget::ShowMenuBar(PRBool aShow)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsWidget::IsMenuBarVisible(PRBool *aVisible)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void * nsWidget::GetNativeData(PRUint32 aDataType)
|
||||
|
@ -85,6 +85,7 @@ public:
|
||||
NS_IMETHOD SetTitle(const nsString& aTitle);
|
||||
NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar);
|
||||
NS_IMETHOD ShowMenuBar(PRBool aShow);
|
||||
NS_IMETHOD IsMenuBarVisible(PRBool *aVisible);
|
||||
NS_IMETHOD SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[]);
|
||||
NS_IMETHOD RemoveTooltips();
|
||||
NS_IMETHOD UpdateTooltips(nsRect* aNewTips[]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user