From 5094c23fe334aed5953452b9c29677948318ef99 Mon Sep 17 00:00:00 2001 From: "dcone%netscape.com" Date: Thu, 15 Oct 1998 13:39:47 +0000 Subject: [PATCH] fixed some clipping and updating stuff git-svn-id: svn://10.0.0.236/trunk@12881 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/mac/nsButton.cpp | 23 --------------------- mozilla/widget/src/mac/nsMacMessagePump.cpp | 4 +++- mozilla/widget/src/mac/nsTextWidget.cpp | 8 +++---- 3 files changed, 7 insertions(+), 28 deletions(-) diff --git a/mozilla/widget/src/mac/nsButton.cpp b/mozilla/widget/src/mac/nsButton.cpp index f0a5f3d89eb..1bb6c862840 100644 --- a/mozilla/widget/src/mac/nsButton.cpp +++ b/mozilla/widget/src/mac/nsButton.cpp @@ -159,29 +159,6 @@ PRBool nsButton::OnResize(nsSizeEvent &aEvent) return PR_FALSE; } -#ifdef NOTNOW -/* - * @update gpk 08/27/98 - * @param aX -- x offset in widget local coordinates - * @param aY -- y offset in widget local coordinates - * @return PR_TRUE if the pt is contained in the widget - */ -PRBool -nsButton::PtInWindow(PRInt32 aX,PRInt32 aY) -{ - PRBool result = PR_FALSE; - nsPoint hitPt(aX,aY); - nsRect bounds; - PRInt32 offx,offy; - - CalcOffset(offx,offy); - GetBounds(bounds); - bounds.MoveBy(offx,offy); - if(bounds.Contains(hitPt)) - result = PR_TRUE; - return(result); -} -#endif PRBool nsButton::DispatchMouseEvent(nsMouseEvent &aEvent) diff --git a/mozilla/widget/src/mac/nsMacMessagePump.cpp b/mozilla/widget/src/mac/nsMacMessagePump.cpp index 460929c69b3..0c7e02d472a 100644 --- a/mozilla/widget/src/mac/nsMacMessagePump.cpp +++ b/mozilla/widget/src/mac/nsMacMessagePump.cpp @@ -195,6 +195,8 @@ nsRefData *theRefData; { SetPort(whichwindow); BeginUpdate(whichwindow); + // we have to layout the entire window, so this does us no good + EndUpdate(whichwindow); theRefData = (nsRefData*)GetWRefCon (whichwindow); thewindow = (nsWindow*)theRefData->GetTopWidget(); @@ -222,7 +224,7 @@ nsRefData *theRefData; // take care of the childern thewindow->DoPaintWidgets(updateregion,pEvent.renderingContext); } - EndUpdate(whichwindow); + } ::SetPort(curport); diff --git a/mozilla/widget/src/mac/nsTextWidget.cpp b/mozilla/widget/src/mac/nsTextWidget.cpp index 62624265721..ca19a6de3d0 100644 --- a/mozilla/widget/src/mac/nsTextWidget.cpp +++ b/mozilla/widget/src/mac/nsTextWidget.cpp @@ -201,24 +201,24 @@ PRInt32 offx,offy; nsRect therect; Rect macrect; GrafPtr theport; -RGBColor blackcolor = {0,0,0}; RgnHandle thergn; CalcOffset(offx,offy); ::GetPort(&theport); ::SetPort(mWindowPtr); - //::SetOrigin(-offx,-offy); + ::SetOrigin(-offx,-offy); GetBounds(therect); nsRectToMacRect(therect,macrect); thergn = ::NewRgn(); ::GetClip(thergn); ::ClipRect(¯ect); + ::EraseRect(¯ect); + ::PenSize(1,1); WEActivate(mTE_Data); WEUpdate(nsnull,mTE_Data); - ::PenSize(1,1); ::FrameRect(¯ect); ::SetClip(thergn); - //::SetOrigin(0,0); + ::SetOrigin(0,0); ::SetPort(theport); return PR_FALSE;