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

bonefish at BerliOS bonefish at mail.berlios.de
Fri Jun 19 23:56:08 CEST 2009


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

Modified:
   haiku/trunk/src/apps/debuganalyzer/gui/table/AbstractTable.cpp
   haiku/trunk/src/apps/debuganalyzer/gui/table/AbstractTable.h
Log:
Added the sorting column related methods.


Modified: haiku/trunk/src/apps/debuganalyzer/gui/table/AbstractTable.cpp
===================================================================
--- haiku/trunk/src/apps/debuganalyzer/gui/table/AbstractTable.cpp	2009-06-19 21:54:48 UTC (rev 31123)
+++ haiku/trunk/src/apps/debuganalyzer/gui/table/AbstractTable.cpp	2009-06-19 21:56:08 UTC (rev 31124)
@@ -103,3 +103,44 @@
 {
 	BColumnListView::DeselectAll();
 }
+
+
+void
+AbstractTable::SetSortingEnabled(bool enabled)
+{
+	BColumnListView::SetSortingEnabled(enabled);
+}
+
+
+bool
+AbstractTable::SortingEnabled() const
+{
+	return BColumnListView::SortingEnabled();
+}
+
+
+void
+AbstractTable::SetSortColumn(TableColumn* column, bool add, bool ascending)
+{
+	if (AbstractColumn* privateColumn = GetColumn(column))
+		BColumnListView::SetSortColumn(privateColumn, add, ascending);
+}
+
+
+void
+AbstractTable::ClearSortColumns()
+{
+	BColumnListView::ClearSortColumns();
+}
+
+
+AbstractTable::AbstractColumn*
+AbstractTable::GetColumn(TableColumn* column) const
+{
+	for (int32 i = 0; AbstractColumn* privateColumn = fColumns.ItemAt(i); i++) {
+		if (privateColumn->GetTableColumn() == column)
+			return privateColumn;
+	}
+
+	return NULL;
+}

Modified: haiku/trunk/src/apps/debuganalyzer/gui/table/AbstractTable.h
===================================================================
--- haiku/trunk/src/apps/debuganalyzer/gui/table/AbstractTable.h	2009-06-19 21:54:48 UTC (rev 31123)
+++ haiku/trunk/src/apps/debuganalyzer/gui/table/AbstractTable.h	2009-06-19 21:56:08 UTC (rev 31124)
@@ -37,6 +37,12 @@
 			void				SetSelectionMode(list_view_type type);
 			void 				DeselectAll();
 
+			void				SetSortingEnabled(bool enabled);
+			bool				SortingEnabled() const;
+			void				SetSortColumn(TableColumn* column, bool add,
+									bool ascending);
+			void				ClearSortColumns();
+
 protected:
 			class AbstractColumn;
 
@@ -45,6 +51,8 @@
 protected:
 	virtual	AbstractColumn*		CreateColumn(TableColumn* column) = 0;
 
+			AbstractColumn*		GetColumn(TableColumn* column) const;
+
 protected:
 			ColumnList			fColumns;
 };




More information about the Haiku-commits mailing list