mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Support for modal dialogs in Gtk+ xpfe. Reviewed by rods.
This commit is contained in:
parent
e1ddf7f16e
commit
74fe2092df
@ -264,6 +264,13 @@ class nsIWidget : public nsISupports {
|
||||
*/
|
||||
NS_IMETHOD Show(PRBool aState) = 0;
|
||||
|
||||
/**
|
||||
* Make the window modal
|
||||
*
|
||||
*
|
||||
*/
|
||||
NS_IMETHOD SetModal(void) = 0;
|
||||
|
||||
/**
|
||||
* Returns whether the window is visible
|
||||
*
|
||||
|
@ -191,6 +191,22 @@ NS_METHOD nsWidget::Show(PRBool bState)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsWidget::SetModal(void)
|
||||
{
|
||||
GtkWindow *toplevel;
|
||||
|
||||
if (!mWidget)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
toplevel = (GtkWindow *) ::gtk_widget_get_toplevel (mWidget);
|
||||
if (!toplevel)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
::gtk_window_set_modal(toplevel, PR_TRUE);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsWidget::IsVisible(PRBool &aState)
|
||||
{
|
||||
if (mWidget) {
|
||||
|
@ -60,6 +60,7 @@ class nsWidget : public nsBaseWidget
|
||||
NS_IMETHOD Destroy(void);
|
||||
nsIWidget* GetParent(void);
|
||||
|
||||
NS_IMETHOD SetModal(void);
|
||||
NS_IMETHOD Show(PRBool state);
|
||||
NS_IMETHOD IsVisible(PRBool &aState);
|
||||
|
||||
|
@ -429,8 +429,6 @@ nsresult nsWindow::SetIcon(GdkPixmap *pixmap,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Processes an Expose Event
|
||||
*
|
||||
|
@ -811,4 +811,9 @@ NS_METHOD nsBaseWidget::EnableFileDrop(PRBool aEnable)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsBaseWidget::SetModal(void)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -72,6 +72,7 @@ public:
|
||||
virtual nsIDeviceContext* GetDeviceContext();
|
||||
virtual nsIAppShell * GetAppShell();
|
||||
virtual nsIToolkit* GetToolkit();
|
||||
NS_IMETHOD SetModal(void);
|
||||
NS_IMETHOD SetBorderStyle(nsBorderStyle aBorderStyle);
|
||||
NS_IMETHOD SetTitle(const nsString& aTitle);
|
||||
NS_IMETHOD SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[]);
|
||||
|
@ -874,6 +874,7 @@ nsWebShellWindow::ShowModalInternal()
|
||||
subshell->Spinup();
|
||||
|
||||
nsIWidget *window = GetWidget();
|
||||
window->SetModal();
|
||||
NS_ADDREF(window);
|
||||
mContinueModalLoop = PR_TRUE;
|
||||
while (NS_SUCCEEDED(rv) && mContinueModalLoop == PR_TRUE) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user