added new caret api implementation from new nsicaret api. EraseCaret. erase the caret without messing with visibility. forces a refresh of state to mDrawn=0; r=hyatt, bug = 34896

This commit is contained in:
mjudge%netscape.com 2000-06-09 04:22:20 +00:00
Родитель debb599cd2
Коммит 92f73bb9d2
4 изменённых файлов: 24 добавлений и 2 удалений

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

@ -327,14 +327,23 @@ NS_IMETHODIMP nsCaret::ClearFrameRefs(nsIFrame* aFrame)
return NS_OK;
}
NS_IMETHODIMP nsCaret::EraseCaret()
{
if (mDrawn)
DrawCaret();
return NS_OK;
}
#ifdef XP_MAC
#pragma mark -
#endif
//-----------------------------------------------------------------------------
NS_IMETHODIMP nsCaret::NotifySelectionChanged(nsIDOMDocument *, nsIDOMSelection *aDomSel, short)
NS_IMETHODIMP nsCaret::NotifySelectionChanged(nsIDOMDocument *, nsIDOMSelection *aDomSel, short aReason)
{
if (aReason & nsIDOMSelectionListener::MOUSEUP_REASON)//this wont do
return NS_OK;
if (mVisible)
StopBlinking();
nsCOMPtr<nsIDOMSelection> domSel(do_QueryReferent(mDomSelectionWeak));
@ -665,6 +674,7 @@ void nsCaret::DrawCaretWithContext(nsIRenderingContext* inRendContext)
localRC->SetColor(NS_RGB(255,255,255));
localRC->InvertRect(mCaretRect);
ToggleDrawnStatus();
}
//-----------------------------------------------------------------------------

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

@ -59,6 +59,7 @@ class nsCaret : public nsICaret,
NS_IMETHOD SetCaretReadOnly(PRBool inMakeReadonly);
NS_IMETHOD GetWindowRelativeCoordinates(nsRect& outCoordinates, PRBool& outIsCollapsed, nsIDOMSelection *inDOMSel);
NS_IMETHOD ClearFrameRefs(nsIFrame* aFrame);
NS_IMETHOD EraseCaret();
//nsIDOMSelectionListener interface
NS_IMETHOD NotifySelectionChanged(nsIDOMDocument *aDoc, nsIDOMSelection *aSel, short aReason);

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

@ -327,14 +327,23 @@ NS_IMETHODIMP nsCaret::ClearFrameRefs(nsIFrame* aFrame)
return NS_OK;
}
NS_IMETHODIMP nsCaret::EraseCaret()
{
if (mDrawn)
DrawCaret();
return NS_OK;
}
#ifdef XP_MAC
#pragma mark -
#endif
//-----------------------------------------------------------------------------
NS_IMETHODIMP nsCaret::NotifySelectionChanged(nsIDOMDocument *, nsIDOMSelection *aDomSel, short)
NS_IMETHODIMP nsCaret::NotifySelectionChanged(nsIDOMDocument *, nsIDOMSelection *aDomSel, short aReason)
{
if (aReason & nsIDOMSelectionListener::MOUSEUP_REASON)//this wont do
return NS_OK;
if (mVisible)
StopBlinking();
nsCOMPtr<nsIDOMSelection> domSel(do_QueryReferent(mDomSelectionWeak));
@ -665,6 +674,7 @@ void nsCaret::DrawCaretWithContext(nsIRenderingContext* inRendContext)
localRC->SetColor(NS_RGB(255,255,255));
localRC->InvertRect(mCaretRect);
ToggleDrawnStatus();
}
//-----------------------------------------------------------------------------

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

@ -59,6 +59,7 @@ class nsCaret : public nsICaret,
NS_IMETHOD SetCaretReadOnly(PRBool inMakeReadonly);
NS_IMETHOD GetWindowRelativeCoordinates(nsRect& outCoordinates, PRBool& outIsCollapsed, nsIDOMSelection *inDOMSel);
NS_IMETHOD ClearFrameRefs(nsIFrame* aFrame);
NS_IMETHOD EraseCaret();
//nsIDOMSelectionListener interface
NS_IMETHOD NotifySelectionChanged(nsIDOMDocument *aDoc, nsIDOMSelection *aSel, short aReason);