[Haiku-commits] r31120 - haiku/trunk/src/apps/debuganalyzer/gui/table

bonefish at BerliOS bonefish at mail.berlios.de
Fri Jun 19 19:28:35 CEST 2009


Author: bonefish
Date: 2009-06-19 19:28:33 +0200 (Fri, 19 Jun 2009)
New Revision: 31120
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31120&view=rev

Modified:
   haiku/trunk/src/apps/debuganalyzer/gui/table/Table.cpp
   haiku/trunk/src/apps/debuganalyzer/gui/table/Table.h
Log:
Added missing TableRowsChanged() to TableModelListener and made Table
handle it, too.


Modified: haiku/trunk/src/apps/debuganalyzer/gui/table/Table.cpp
===================================================================
--- haiku/trunk/src/apps/debuganalyzer/gui/table/Table.cpp	2009-06-19 17:26:59 UTC (rev 31119)
+++ haiku/trunk/src/apps/debuganalyzer/gui/table/Table.cpp	2009-06-19 17:28:33 UTC (rev 31120)
@@ -51,6 +51,13 @@
 }
 
 
+void
+TableModelListener::TableRowsChanged(TableModel* model, int32 rowIndex,
+	int32 count)
+{
+}
+
+
 // #pragma mark - TableModel
 
 
@@ -93,6 +100,16 @@
 }
 
 
+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)
@@ -497,6 +514,17 @@
 
 
 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()
 {
 	if (fListeners.IsEmpty())

Modified: haiku/trunk/src/apps/debuganalyzer/gui/table/Table.h
===================================================================
--- haiku/trunk/src/apps/debuganalyzer/gui/table/Table.h	2009-06-19 17:26:59 UTC (rev 31119)
+++ haiku/trunk/src/apps/debuganalyzer/gui/table/Table.h	2009-06-19 17:28:33 UTC (rev 31120)
@@ -28,6 +28,8 @@
 									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:
 			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 @@
 									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;




More information about the Haiku-commits mailing list