Only let left btn clicks through for popping up the dialog

b=49904 r=kmcclusk
This commit is contained in:
rods%netscape.com 2000-08-25 13:25:50 +00:00
Родитель 18d89a1b76
Коммит 412b9b55f7
2 изменённых файлов: 26 добавлений и 0 удалений

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

@ -53,6 +53,7 @@
#include "nsIComponentManager.h" #include "nsIComponentManager.h"
#include "nsIDOMWindow.h" #include "nsIDOMWindow.h"
#include "nsIFilePicker.h" #include "nsIFilePicker.h"
#include "nsIDOMMouseEvent.h"
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID); static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
@ -236,6 +237,18 @@ nsFileControlFrame::ScrollIntoView(nsIPresContext* aPresContext)
nsresult nsresult
nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent) nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
{ {
// only allow the left button
nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aMouseEvent);
if (mouseEvent) {
PRUint16 whichButton;
if (NS_SUCCEEDED(mouseEvent->GetButton(&whichButton))) {
if (whichButton != 1) {
return NS_OK;
}
}
}
nsresult result; nsresult result;
// Get parent nsIDOMWindow object. // Get parent nsIDOMWindow object.

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

@ -53,6 +53,7 @@
#include "nsIComponentManager.h" #include "nsIComponentManager.h"
#include "nsIDOMWindow.h" #include "nsIDOMWindow.h"
#include "nsIFilePicker.h" #include "nsIFilePicker.h"
#include "nsIDOMMouseEvent.h"
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID); static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
@ -236,6 +237,18 @@ nsFileControlFrame::ScrollIntoView(nsIPresContext* aPresContext)
nsresult nsresult
nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent) nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
{ {
// only allow the left button
nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aMouseEvent);
if (mouseEvent) {
PRUint16 whichButton;
if (NS_SUCCEEDED(mouseEvent->GetButton(&whichButton))) {
if (whichButton != 1) {
return NS_OK;
}
}
}
nsresult result; nsresult result;
// Get parent nsIDOMWindow object. // Get parent nsIDOMWindow object.