bug #6251: added UpdateAllViews(PRUint32 aUpdateFlags), which will force a complete refresh of all views owned by an nsIViewManager.

This commit is contained in:
beard%netscape.com 1999-09-19 00:51:41 +00:00
Родитель 1cfe04258a
Коммит 6bb85f6f32
3 изменённых файлов: 32 добавлений и 0 удалений

Просмотреть файл

@ -135,6 +135,13 @@ public:
*/
NS_IMETHOD UpdateView(nsIView *aView, const nsRect &aRect, PRUint32 aUpdateFlags) = 0;
/**
* Called to inform the view manager that it should redraw all views.
* @param aView view to paint. should be root view
* @param aUpdateFlags see bottom of nsIViewManager.h for description
*/
NS_IMETHOD UpdateAllViews(PRUint32 aUpdateFlags) = 0;
/**
* Called to dispatch an event to the appropriate view. Often called
* as a result of receiving a mouse or keyboard event from the widget

Просмотреть файл

@ -1472,6 +1472,29 @@ NS_IMETHODIMP nsViewManager :: UpdateView(nsIView *aView, const nsRect &aRect, P
return NS_OK;
}
NS_IMETHODIMP nsViewManager::UpdateAllViews(PRUint32 aUpdateFlags)
{
UpdateViews(mRootView, aUpdateFlags);
return NS_OK;
}
void nsViewManager::UpdateViews(nsIView *aView, PRUint32 aUpdateFlags)
{
// update this view.
nsRect dirtyRect;
aView->GetBounds(dirtyRect);
dirtyRect.x = dirtyRect.y = 0;
UpdateView(aView, dirtyRect, aUpdateFlags);
// update all children as well.
nsIView* childView = nsnull;
aView->GetChild(0, childView);
while (nsnull != childView) {
UpdateViews(childView, aUpdateFlags);
childView->GetNextSibling(childView);
}
}
NS_IMETHODIMP nsViewManager :: DispatchEvent(nsGUIEvent *aEvent, nsEventStatus &aStatus)
{
aStatus = nsEventStatus_eIgnore;

Просмотреть файл

@ -58,6 +58,7 @@ public:
NS_IMETHOD UpdateView(nsIView *aView, nsIRegion *aRegion,
PRUint32 aUpdateFlags);
NS_IMETHOD UpdateView(nsIView *aView, const nsRect &aRect, PRUint32 aUpdateFlags);
NS_IMETHOD UpdateAllViews(PRUint32 aUpdateFlags);
NS_IMETHOD DispatchEvent(nsGUIEvent *aEvent, nsEventStatus &aStatus);
@ -129,6 +130,7 @@ private:
void UpdateTransCnt(nsIView *oldview, nsIView *newview);
void ProcessPendingUpdates(nsIView *aView);
void UpdateViews(nsIView *aView, PRUint32 aUpdateFlags);
void Refresh(nsIView *aView, nsIRenderingContext *aContext,
nsIRegion *region, PRUint32 aUpdateFlags);