Added the sorting column related methods.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31124 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -103,3 +103,44 @@ AbstractTable::DeselectAll()
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,12 @@ public:
|
||||
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:
|
||||
protected:
|
||||
virtual AbstractColumn* CreateColumn(TableColumn* column) = 0;
|
||||
|
||||
AbstractColumn* GetColumn(TableColumn* column) const;
|
||||
|
||||
protected:
|
||||
ColumnList fColumns;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user