Changing selection in the tree.

This commit is contained in:
hyatt%netscape.com 1999-02-23 02:39:44 +00:00
Родитель 8ef606dbd7
Коммит d6fb7c48ab
1 изменённых файлов: 58 добавлений и 52 удалений

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

@ -247,7 +247,6 @@ nsTreeCellFrame::HandleDoubleClickEvent(nsIPresContext& aPresContext,
pShell->ExitReflowLock();
}
}
}
return NS_OK;
}
@ -256,17 +255,24 @@ nsTreeCellFrame::HandleDoubleClickEvent(nsIPresContext& aPresContext,
void
nsTreeCellFrame::Select(nsIPresContext& aPresContext, PRBool isSelected, PRBool notifyForReflow)
{
nsCOMPtr<nsIAtom> kSelectedAtom ( dont_AddRef(NS_NewAtom("selected")) );
nsCOMPtr<nsIAtom> kSelectedCellAtom(dont_AddRef(NS_NewAtom("selectedcell")));
nsCOMPtr<nsIAtom> kSelectedAtom(dont_AddRef(NS_NewAtom("selected")));
nsIContent* pParentContent;
mContent->GetParent(pParentContent);
if (isSelected)
{
// We're selecting the node.
mContent->SetAttribute(nsXULAtoms::nameSpaceID, kSelectedAtom, "true", notifyForReflow);
mContent->SetAttribute(nsXULAtoms::nameSpaceID, kSelectedCellAtom, "true", notifyForReflow);
pParentContent->SetAttribute(nsXULAtoms::nameSpaceID, kSelectedAtom, "true", notifyForReflow);
}
else
{
// We're unselecting the node.
mContent->UnsetAttribute(nsXULAtoms::nameSpaceID, kSelectedAtom, notifyForReflow);
// We're deselecting the node.
mContent->UnsetAttribute(nsXULAtoms::nameSpaceID, kSelectedCellAtom, notifyForReflow);
pParentContent->UnsetAttribute(nsXULAtoms::nameSpaceID, kSelectedAtom, notifyForReflow);
}
NS_IF_RELEASE(pParentContent);
}