Browse Source

tags/2021-05-28
jules 18 years ago
parent
commit
fa5ebd9dca
2 changed files with 23 additions and 4 deletions
  1. +8
    -3
      src/juce_appframework/gui/components/controls/juce_TableHeaderComponent.cpp
  2. +15
    -1
      src/juce_appframework/gui/components/controls/juce_TableHeaderComponent.h

+ 8
- 3
src/juce_appframework/gui/components/controls/juce_TableHeaderComponent.cpp View File

@@ -409,9 +409,7 @@ void TableHeaderComponent::setSortColumnId (const int columnId, const bool sortF
if (ci != 0)
ci->propertyFlags |= (sortForwards ? sortedForwards : sortedBackwards);
sortChanged = true;
repaint();
triggerAsyncUpdate();
reSortTable();
}
}
@@ -433,6 +431,13 @@ bool TableHeaderComponent::isSortedForwards() const throw()
return true;
}
void TableHeaderComponent::reSortTable()
{
sortChanged = true;
repaint();
triggerAsyncUpdate();
}
//==============================================================================
const String TableHeaderComponent::toString() const
{


+ 15
- 1
src/juce_appframework/gui/components/controls/juce_TableHeaderComponent.h View File

@@ -220,7 +220,11 @@ public:
/** Changes the column which is the sort column.
This can cause an asynchronous callback to the tableSortOrderChanged() method of any registered listeners.
@see getSortColumnId, isSortedForwards
If this method doesn't actually change the column ID, then no re-sort will take place (you can
call reSortTable() to force a re-sort to happen if you've modified the table's contents).
@see getSortColumnId, isSortedForwards, reSortTable
*/
void setSortColumnId (const int columnId, const bool sortForwards);
@@ -235,6 +239,16 @@ public:
*/
bool isSortedForwards() const throw();
/** Triggers a re-sort of the table according to the current sort-column.
If you modifiy the table's contents, you can call this to signal that the table needs
to be re-sorted.
(This doesn't do any sorting synchronously - it just asynchronously sends a call to the
tableSortOrderChanged() method of any listeners).
*/
void reSortTable();
//==============================================================================
/** Returns the total width of all the visible columns in the table.
*/


Loading…
Cancel
Save