Fixed the resize problem, now breaks out of the infinite loop.

git-svn-id: svn://10.0.0.236/trunk@13386 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dcone%netscape.com
1998-10-23 18:00:54 +00:00
parent 58bc94bb8e
commit e94d00e173
9 changed files with 238 additions and 3 deletions

View File

@@ -178,6 +178,62 @@ PRBool nsCheckButton::OnResize(nsSizeEvent &aEvent)
return PR_FALSE;
}
/**-------------------------------------------------------------------------------
* Resizes the Resizes the bounds
* @update dc 10/23/98
* @Param aWidth -- The new width
* @Param aHeight -- The new width
* @Param aRepaint -- a boolean which tells if we need to repaint
* @return -- True if the event was handled, NS_OK is always return for now
*/
NS_IMETHODIMP nsCheckButton::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
{
mBounds.width = aWidth;
mBounds.height = aHeight;
if(nsnull!=mWindowRegion)
::DisposeRgn(mWindowRegion);
mWindowRegion = NewRgn();
SetRectRgn(mWindowRegion,mBounds.x,mBounds.y,mBounds.x+mBounds.width,mBounds.y+mBounds.height);
if (aRepaint){
UpdateVisibilityFlag();
UpdateDisplay();
}
return(NS_OK);
}
/**-------------------------------------------------------------------------------
* Resizes the Resizes the bounds
* @update dc 10/23/98
* @Param aX -- the left position of the bounds
* @Param aY -- the top position of the bounds
* @Param aWidth -- The new width
* @Param aHeight -- The new width
* @Param aRepaint -- a boolean which tells if we need to repaint
* @return -- True if the event was handled, NS_OK is always return for now
*/
NS_IMETHODIMP nsCheckButton::Resize(PRUint32 aX, PRUint32 aY, PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
{
nsSizeEvent event;
mBounds.x = aX;
mBounds.y = aY;
mBounds.width = aWidth;
mBounds.height = aHeight;
if(nsnull!=mWindowRegion)
::DisposeRgn(mWindowRegion);
mWindowRegion = NewRgn();
SetRectRgn(mWindowRegion,mBounds.x,mBounds.y,mBounds.x+mBounds.width,mBounds.y+mBounds.height);
if (aRepaint){
UpdateVisibilityFlag();
UpdateDisplay();
}
return(NS_OK);
}
/**-------------------------------------------------------------------------------
* DispatchMouseEvent handle an event for this checkbutton
* @Param aEvent -- The mouse event to respond to for this button