temporary patch to the forms controls to ignore mouse events when in

printpreview until Bug 124990 gets fixed (radio and checkbox doesn't need the fix)
this code will be removed via bug 146399
Bug 129002 r=dcone sr=attinasi
This commit is contained in:
rods%netscape.com 2002-05-23 11:25:58 +00:00
parent 0355a17aac
commit c2d186a7fa
8 changed files with 66 additions and 0 deletions

View File

@ -2091,6 +2091,13 @@ nsComboboxControlFrame::HandleEvent(nsIPresContext* aPresContext,
nsEventStatus* aEventStatus)
{
NS_ENSURE_ARG_POINTER(aEventStatus);
// temp fix until Bug 124990 gets fixed
PRBool isPaginated = PR_FALSE;
aPresContext->IsPaginated(&isPaginated);
if (isPaginated && NS_IS_MOUSE_EVENT(aEvent)) {
return NS_OK;
}
if (nsEventStatus_eConsumeNoDefault == *aEventStatus) {
return NS_OK;
}

View File

@ -49,6 +49,8 @@
#include "nsIServiceManager.h"
#include "nsIDOMNode.h"
#include "nsLayoutAtoms.h"
// MouseEvent suppression in PP
#include "nsGUIEvent.h"
static NS_DEFINE_CID(kTextNodeCID, NS_TEXTNODE_CID);
@ -628,6 +630,12 @@ nsGfxButtonControlFrame::HandleEvent(nsIPresContext* aPresContext,
nsGUIEvent* aEvent,
nsEventStatus* aEventStatus)
{
// temp fix until Bug 124990 gets fixed
PRBool isPaginated = PR_FALSE;
aPresContext->IsPaginated(&isPaginated);
if (isPaginated && NS_IS_MOUSE_EVENT(aEvent)) {
return NS_OK;
}
// Override the HandleEvent to prevent the nsFrame::HandleEvent
// from being called. The nsFrame::HandleEvent causes the button label
// to be selected (Drawn with an XOR rectangle over the label)

View File

@ -1562,6 +1562,12 @@ nsListControlFrame::HandleEvent(nsIPresContext* aPresContext,
nsEventStatus* aEventStatus)
{
NS_ENSURE_ARG_POINTER(aEventStatus);
// temp fix until Bug 124990 gets fixed
PRBool isPaginated = PR_FALSE;
aPresContext->IsPaginated(&isPaginated);
if (isPaginated && NS_IS_MOUSE_EVENT(aEvent)) {
return NS_OK;
}
/*const char * desc[] = {"NS_MOUSE_MOVE",
"NS_MOUSE_LEFT_BUTTON_UP",

View File

@ -2091,6 +2091,13 @@ nsComboboxControlFrame::HandleEvent(nsIPresContext* aPresContext,
nsEventStatus* aEventStatus)
{
NS_ENSURE_ARG_POINTER(aEventStatus);
// temp fix until Bug 124990 gets fixed
PRBool isPaginated = PR_FALSE;
aPresContext->IsPaginated(&isPaginated);
if (isPaginated && NS_IS_MOUSE_EVENT(aEvent)) {
return NS_OK;
}
if (nsEventStatus_eConsumeNoDefault == *aEventStatus) {
return NS_OK;
}

View File

@ -49,6 +49,8 @@
#include "nsIServiceManager.h"
#include "nsIDOMNode.h"
#include "nsLayoutAtoms.h"
// MouseEvent suppression in PP
#include "nsGUIEvent.h"
static NS_DEFINE_CID(kTextNodeCID, NS_TEXTNODE_CID);
@ -628,6 +630,12 @@ nsGfxButtonControlFrame::HandleEvent(nsIPresContext* aPresContext,
nsGUIEvent* aEvent,
nsEventStatus* aEventStatus)
{
// temp fix until Bug 124990 gets fixed
PRBool isPaginated = PR_FALSE;
aPresContext->IsPaginated(&isPaginated);
if (isPaginated && NS_IS_MOUSE_EVENT(aEvent)) {
return NS_OK;
}
// Override the HandleEvent to prevent the nsFrame::HandleEvent
// from being called. The nsFrame::HandleEvent causes the button label
// to be selected (Drawn with an XOR rectangle over the label)

View File

@ -3517,3 +3517,23 @@ nsGfxTextControlFrame2::SetValueChanged(PRBool aValueChanged)
elem->SetValueChanged(aValueChanged);
}
}
NS_IMETHODIMP
nsGfxTextControlFrame2::HandleEvent(nsIPresContext* aPresContext,
nsGUIEvent* aEvent,
nsEventStatus* aEventStatus)
{
NS_ENSURE_ARG_POINTER(aEventStatus);
// temp fix until Bug 124990 gets fixed
PRBool isPaginated = PR_FALSE;
aPresContext->IsPaginated(&isPaginated);
if (isPaginated && NS_IS_MOUSE_EVENT(aEvent)) {
return NS_OK;
}
return nsStackFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}

View File

@ -96,6 +96,10 @@ public:
nsFramePaintLayer aWhichLayer,
nsIFrame** aFrame);
NS_IMETHOD HandleEvent(nsIPresContext* aPresContext,
nsGUIEvent* aEvent,
nsEventStatus* aEventStatus);
NS_IMETHOD GetPrefSize(nsBoxLayoutState& aBoxLayoutState, nsSize& aSize);
NS_IMETHOD GetMinSize(nsBoxLayoutState& aBoxLayoutState, nsSize& aSize);
NS_IMETHOD GetMaxSize(nsBoxLayoutState& aBoxLayoutState, nsSize& aSize);

View File

@ -1562,6 +1562,12 @@ nsListControlFrame::HandleEvent(nsIPresContext* aPresContext,
nsEventStatus* aEventStatus)
{
NS_ENSURE_ARG_POINTER(aEventStatus);
// temp fix until Bug 124990 gets fixed
PRBool isPaginated = PR_FALSE;
aPresContext->IsPaginated(&isPaginated);
if (isPaginated && NS_IS_MOUSE_EVENT(aEvent)) {
return NS_OK;
}
/*const char * desc[] = {"NS_MOUSE_MOVE",
"NS_MOUSE_LEFT_BUTTON_UP",