Added missing TableRowsChanged() to TableModelListener and made Table

handle it, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31120 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-06-19 17:28:33 +00:00
parent 36c16b9292
commit 028b98e7ff
2 changed files with 33 additions and 0 deletions
@@ -51,6 +51,13 @@ TableModelListener::TableRowsRemoved(TableModel* model, int32 rowIndex,
}
void
TableModelListener::TableRowsChanged(TableModel* model, int32 rowIndex,
int32 count)
{
}
// #pragma mark - TableModel
@@ -93,6 +100,16 @@ TableModel::NotifyRowsRemoved(int32 rowIndex, int32 count)
}
void
TableModel::NotifyRowsChanged(int32 rowIndex, int32 count)
{
for (ListenerList::Iterator it = fListeners.GetIterator();
TableModelListener* listener = it.Next();) {
listener->TableRowsChanged(this, rowIndex, count);
}
}
// #pragma mark - TableSelectionModel
TableSelectionModel::TableSelectionModel(Table* table)
@@ -496,6 +513,17 @@ Table::TableRowsRemoved(TableModel* model, int32 rowIndex, int32 count)
}
void
Table::TableRowsChanged(TableModel* model, int32 rowIndex, int32 count)
{
int32 endIndex = rowIndex + count;
for (int32 i = rowIndex; i < endIndex; i++) {
if (BRow* row = fRows.ItemAt(i))
UpdateRow(row);
}
}
void
Table::ItemInvoked()
{
+5
View File
@@ -28,6 +28,8 @@ public:
int32 rowIndex, int32 count);
virtual void TableRowsRemoved(TableModel* model,
int32 rowIndex, int32 count);
virtual void TableRowsChanged(TableModel* model,
int32 rowIndex, int32 count);
};
@@ -49,6 +51,7 @@ protected:
protected:
void NotifyRowsAdded(int32 rowIndex, int32 count);
void NotifyRowsRemoved(int32 rowIndex, int32 count);
void NotifyRowsChanged(int32 rowIndex, int32 count);
protected:
ListenerList fListeners;
@@ -118,6 +121,8 @@ private:
int32 rowIndex, int32 count);
virtual void TableRowsRemoved(TableModel* model,
int32 rowIndex, int32 count);
virtual void TableRowsChanged(TableModel* model,
int32 rowIndex, int32 count);
private:
class Column;