зеркало из https://github.com/mozilla/gecko-dev.git
Added an Invalidate method for a rect in a window
This commit is contained in:
Родитель
a2b1bb00cb
Коммит
64c6bab0fd
|
@ -373,6 +373,15 @@ class nsIWidget : public nsISupports {
|
|||
|
||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous) = 0;
|
||||
|
||||
/**
|
||||
* Invalidate a specified rect for a widget and repaints it.
|
||||
*
|
||||
* @param aIsSynchronouse PR_TRUE then repaint synchronously. If PR_FALSE repaint later.
|
||||
*
|
||||
*/
|
||||
|
||||
NS_IMETHOD Invalidate(const nsRect & aRect, PRBool aIsSynchronous) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Adds a mouse listener to this widget
|
||||
|
|
|
@ -1028,6 +1028,29 @@ NS_METHOD nsWindow::Invalidate(PRBool aIsSynchronous)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Invalidate this component visible area
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsWindow::Invalidate(const nsRect & aRect, PRBool aIsSynchronous)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
if (mWnd) {
|
||||
rect.left = aRect.x;
|
||||
rect.top = aRect.y;
|
||||
rect.right = aRect.x + aRect.width;
|
||||
rect.bottom = aRect.y + aRect.height;
|
||||
VERIFY(::InvalidateRect(mWnd, &rect, TRUE));
|
||||
if (aIsSynchronous) {
|
||||
VERIFY(::UpdateWindow(mWnd));
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
|
|
|
@ -103,6 +103,7 @@ public:
|
|||
NS_IMETHOD SetFont(const nsFont &aFont);
|
||||
NS_IMETHOD SetCursor(nsCursor aCursor);
|
||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
|
||||
NS_IMETHOD Invalidate(const nsRect & aRect, PRBool aIsSynchronous);
|
||||
virtual void* GetNativeData(PRUint32 aDataType);
|
||||
NS_IMETHOD SetColorMap(nsColorMap *aColorMap);
|
||||
NS_IMETHOD Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect);
|
||||
|
|
Загрузка…
Ссылка в новой задаче