From 028b98e7ff82631e7d74e1d61600e206f46464aa Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 19 Jun 2009 17:28:33 +0000 Subject: [PATCH] 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 --- src/apps/debuganalyzer/gui/table/Table.cpp | 28 ++++++++++++++++++++++ src/apps/debuganalyzer/gui/table/Table.h | 5 ++++ 2 files changed, 33 insertions(+) diff --git a/src/apps/debuganalyzer/gui/table/Table.cpp b/src/apps/debuganalyzer/gui/table/Table.cpp index 36f47c3f28..497c1f88b4 100644 --- a/src/apps/debuganalyzer/gui/table/Table.cpp +++ b/src/apps/debuganalyzer/gui/table/Table.cpp @@ -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() { diff --git a/src/apps/debuganalyzer/gui/table/Table.h b/src/apps/debuganalyzer/gui/table/Table.h index d7417b2929..e064e57795 100644 --- a/src/apps/debuganalyzer/gui/table/Table.h +++ b/src/apps/debuganalyzer/gui/table/Table.h @@ -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;