зеркало из https://github.com/mozilla/gecko-dev.git
Add ModalEventFilter (originally nsAppShell::EventIsForModalWindow) and add parameter to SetModal. part of fix for bug 14131. r:rods@netscape.com.
This commit is contained in:
Родитель
321a047de5
Коммит
7935f83bdc
|
@ -299,10 +299,10 @@ class nsIWidget : public nsISupports {
|
|||
NS_IMETHOD Show(PRBool aState) = 0;
|
||||
|
||||
/**
|
||||
* Make the window modal
|
||||
* Make the window modal
|
||||
*
|
||||
*/
|
||||
NS_IMETHOD SetModal(void) = 0;
|
||||
NS_IMETHOD SetModal(PRBool aModal) = 0;
|
||||
|
||||
/**
|
||||
* Returns whether the window is visible
|
||||
|
@ -706,6 +706,20 @@ class nsIWidget : public nsISupports {
|
|||
*
|
||||
*/
|
||||
NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent) = 0;
|
||||
|
||||
/**
|
||||
* Determine whether a given event should be processed assuming we are
|
||||
* the currently active modal window.
|
||||
* Note that the exact semantics of this method are platform-dependent.
|
||||
* The Macintosh, for instance, cares deeply that this method do exactly
|
||||
* as advertised. Gtk, for instance, handles modality in a completely
|
||||
* different fashion and does little if anything with this method.
|
||||
* @param aRealEvent event is real or a null placeholder (Macintosh)
|
||||
* @param aEvent void pointer to native event structure
|
||||
* @param aForWindow return value. PR_TRUE iff event should be processed.
|
||||
*/
|
||||
NS_IMETHOD ModalEventFilter(PRBool aRealEvent, void *aEvent, PRBool *aForWindow) = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif // nsIWidget_h__
|
||||
|
|
|
@ -699,11 +699,19 @@ NS_METHOD nsBaseWidget::EnableDragDrop(PRBool aEnable)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsBaseWidget::SetModal(void)
|
||||
NS_METHOD nsBaseWidget::SetModal(PRBool aModal)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// generic xp assumption is that events should be processed
|
||||
NS_METHOD nsBaseWidget::ModalEventFilter(PRBool aRealEvent, void *aEvent,
|
||||
PRBool *aForWindow)
|
||||
{
|
||||
*aForWindow = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
//////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
|
|
@ -79,7 +79,9 @@ public:
|
|||
virtual nsIDeviceContext* GetDeviceContext();
|
||||
virtual nsIAppShell * GetAppShell();
|
||||
virtual nsIToolkit* GetToolkit();
|
||||
NS_IMETHOD SetModal(void);
|
||||
NS_IMETHOD SetModal(PRBool aModal);
|
||||
NS_IMETHOD ModalEventFilter(PRBool aRealEvent, void *aEvent,
|
||||
PRBool *aForWindow);
|
||||
NS_IMETHOD SetWindowType(nsWindowType aWindowType);
|
||||
NS_IMETHOD SetBorderStyle(nsBorderStyle aBorderStyle);
|
||||
NS_IMETHOD AddMouseListener(nsIMouseListener * aListener);
|
||||
|
|
Загрузка…
Ссылка в новой задаче