Only let left btn clicks through for popping up the dialog

b=49904 r=kmcclusk


git-svn-id: svn://10.0.0.236/trunk@77202 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rods%netscape.com
2000-08-25 13:25:50 +00:00
parent 034398419f
commit 545c8c6a7e
2 changed files with 26 additions and 0 deletions

View File

@@ -53,6 +53,7 @@
#include "nsIComponentManager.h"
#include "nsIDOMWindow.h"
#include "nsIFilePicker.h"
#include "nsIDOMMouseEvent.h"
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
@@ -236,6 +237,18 @@ nsFileControlFrame::ScrollIntoView(nsIPresContext* aPresContext)
nsresult
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;
// Get parent nsIDOMWindow object.