BColumnListView: Enable invalidating rows, fix SetField()
* Seems like there was no easy way to simply invalidate a given BRow. Introduced BColumnListView::InvalidateRow(). * BRow::SetField() tried to invalidate the row, but invalidated the listview instead of the BOutlineView responsible for drawing the list contents. Use the new InvaalidateRow().
This commit is contained in:
committed by
Rene Gollent
parent
72b9e4a7bc
commit
ed6f171aa6
@@ -135,6 +135,8 @@ public:
|
|||||||
bool IsExpanded() const;
|
bool IsExpanded() const;
|
||||||
bool IsSelected() const;
|
bool IsSelected() const;
|
||||||
|
|
||||||
|
void Invalidate();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Blows up into the debugger if the validation fails.
|
// Blows up into the debugger if the validation fails.
|
||||||
void ValidateFields() const;
|
void ValidateFields() const;
|
||||||
@@ -332,6 +334,8 @@ public:
|
|||||||
parentRow1 = NULL, BRow* parentRow2 = NULL);
|
parentRow1 = NULL, BRow* parentRow2 = NULL);
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
|
void InvalidateRow(BRow* row);
|
||||||
|
|
||||||
// Appearance (DEPRECATED)
|
// Appearance (DEPRECATED)
|
||||||
void GetFont(BFont* font) const
|
void GetFont(BFont* font) const
|
||||||
{ BView::GetFont(font); }
|
{ BView::GetFont(font); }
|
||||||
|
|||||||
@@ -500,9 +500,7 @@ BRow::SetField(BField* field, int32 logicalFieldIndex)
|
|||||||
|
|
||||||
if (NULL != fList) {
|
if (NULL != fList) {
|
||||||
ValidateField(field, logicalFieldIndex);
|
ValidateField(field, logicalFieldIndex);
|
||||||
BRect inv;
|
Invalidate();
|
||||||
fList->GetRowRect(this, &inv);
|
|
||||||
fList->Invalidate(inv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fFields.AddItem(field, logicalFieldIndex);
|
fFields.AddItem(field, logicalFieldIndex);
|
||||||
@@ -530,6 +528,14 @@ BRow::IsSelected() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BRow::Invalidate()
|
||||||
|
{
|
||||||
|
if (fList != NULL)
|
||||||
|
fList->InvalidateRow(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BRow::ValidateFields() const
|
BRow::ValidateFields() const
|
||||||
{
|
{
|
||||||
@@ -1340,6 +1346,15 @@ BColumnListView::Clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BColumnListView::InvalidateRow(BRow* row)
|
||||||
|
{
|
||||||
|
BRect updateRect;
|
||||||
|
GetRowRect(row, &updateRect);
|
||||||
|
fOutlineView->Invalidate(updateRect);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BColumnListView::SetFont(const BFont* font, uint32 mask)
|
BColumnListView::SetFont(const BFont* font, uint32 mask)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user