fixed some clipping and updating stuff
git-svn-id: svn://10.0.0.236/trunk@12881 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user