fixed some spurious redraws

This commit is contained in:
pierre%netscape.com 1999-04-20 04:02:53 +00:00
parent e5bef20561
commit bd9dd7ad3b
4 changed files with 47 additions and 3 deletions

View File

@ -118,7 +118,7 @@ NS_IMETHODIMP nsListBox::Create(nsIWidget *aParent,
SetMultipleSelection(mMultiSelect);
::SetControlMinimum(mControl, 0);
::SetControlMaximum(mControl, 0);
::LSetDrawingMode(true, mListHandle);
::LSetDrawingMode(mVisible, mListHandle);
}
else
res = NS_ERROR_FAILURE;
@ -154,6 +154,26 @@ nsresult nsListBox::QueryInterface(const nsIID& aIID, void** aInstancePtr)
return nsWindow::QueryInterface(aIID,aInstancePtr);
}
//-------------------------------------------------------------------------
//
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsListBox::Show(PRBool bState)
{
if (! mListHandle)
return NS_ERROR_NOT_INITIALIZED;
if (mVisible == bState)
return NS_OK;
Inherited::Show(bState);
StartDraw();
::LSetDrawingMode(bState, mListHandle);
EndDraw();
return NS_OK;
}
#pragma mark -
//-------------------------------------------------------------------------
//
@ -420,7 +440,7 @@ nsresult nsListBox::SetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
::LSetSelect(true, theCell, mListHandle);
}
::LAutoScroll(mListHandle);
::LSetDrawingMode(true, mListHandle);
::LSetDrawingMode(mVisible, mListHandle);
EndDraw();
Invalidate(PR_TRUE);
@ -476,7 +496,7 @@ nsresult nsListBox::Deselect()
::LSetSelect(false, theCell, mListHandle);
::LNextCell(true, true, &theCell, mListHandle);
}
::LSetDrawingMode(true, mListHandle);
::LSetDrawingMode(mVisible, mListHandle);
EndDraw();
Invalidate(PR_TRUE);

View File

@ -49,6 +49,8 @@ public:
nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull);
NS_IMETHOD Show(PRBool aState);
// nsIListBox part
NS_IMETHOD SetMultipleSelection(PRBool aMultipleSelections);
NS_IMETHOD AddItemAt(nsString &aItem, PRInt32 aPosition);

View File

@ -101,6 +101,8 @@ NS_IMETHODIMP nsTextAreaWidget::Create(nsIWidget *aParent,const nsRect &aRect,EV
StartDraw();
PRUint32 teFlags = weDoAutoScroll | weDoOutlineHilite | weDoMonoStyled;
if (!mVisible)
teFlags |= weDoInhibitRedraw;
WENew(&destRect, &viewRect, teFlags, &mTE_Data);
EndDraw();
@ -137,6 +139,24 @@ nsresult nsTextAreaWidget::QueryInterface(REFNSIID aIID, void** aInstancePtr)
return nsWindow::QueryInterface(aIID, aInstancePtr);
}
//-------------------------------------------------------------------------
//
//
//-------------------------------------------------------------------------
NS_IMETHODIMP nsTextAreaWidget::Show(PRBool bState)
{
if (! mTE_Data)
return NS_ERROR_NOT_INITIALIZED;
if (mVisible == bState)
return NS_OK;
Inherited::Show(bState);
WEFeatureFlag(weFInhibitRedraw, (bState ? weBitClear : weBitSet), mTE_Data);
return NS_OK;
}
//-------------------------------------------------------------------------
/**
* The onPaint handler for a nsTextAreaWidget -- this may change, inherited from windows

View File

@ -45,6 +45,8 @@ public:
nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull);
NS_IMETHOD Show(PRBool aState);
// nsISupports
NS_IMETHOD_(nsrefcnt) AddRef();
NS_IMETHOD_(nsrefcnt) Release();