added wxHeaderCtrl::ResetColumnsOrder() function; use it from wxGrid
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57337 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -98,6 +98,9 @@ public:
|
|||||||
// get the position at which this column is currently displayed
|
// get the position at which this column is currently displayed
|
||||||
unsigned int GetColumnPos(unsigned int idx) const;
|
unsigned int GetColumnPos(unsigned int idx) const;
|
||||||
|
|
||||||
|
// reset the columns order to the natural one
|
||||||
|
void ResetColumnsOrder();
|
||||||
|
|
||||||
// helper function used by the generic version of this control and also
|
// helper function used by the generic version of this control and also
|
||||||
// wxGrid: reshuffles the array of column indices indexed by positions
|
// wxGrid: reshuffles the array of column indices indexed by positions
|
||||||
// (i.e. using the same convention as for SetColumnsOrder()) so that the
|
// (i.e. using the same convention as for SetColumnsOrder()) so that the
|
||||||
|
@@ -268,6 +268,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
unsigned int GetColumnPos(unsigned int idx) const;
|
unsigned int GetColumnPos(unsigned int idx) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Reset the columns order to the natural one.
|
||||||
|
|
||||||
|
After calling this function, the column with index @c idx appears at
|
||||||
|
position @c idx in the control.
|
||||||
|
*/
|
||||||
|
void ResetColumnsOrder();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Helper function to manipulate the array of column indices.
|
Helper function to manipulate the array of column indices.
|
||||||
|
|
||||||
|
@@ -113,6 +113,16 @@ void wxHeaderCtrlBase::SetColumnsOrder(const wxArrayInt& order)
|
|||||||
// TODO-RTL: do we need to reverse the array?
|
// TODO-RTL: do we need to reverse the array?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxHeaderCtrlBase::ResetColumnsOrder()
|
||||||
|
{
|
||||||
|
const unsigned count = GetColumnCount();
|
||||||
|
wxArrayInt order(count);
|
||||||
|
for ( unsigned n = 0; n < count; n++ )
|
||||||
|
order[n] = n;
|
||||||
|
|
||||||
|
DoSetColumnsOrder(order);
|
||||||
|
}
|
||||||
|
|
||||||
wxArrayInt wxHeaderCtrlBase::GetColumnsOrder() const
|
wxArrayInt wxHeaderCtrlBase::GetColumnsOrder() const
|
||||||
{
|
{
|
||||||
const wxArrayInt order = DoGetColumnsOrder();
|
const wxArrayInt order = DoGetColumnsOrder();
|
||||||
|
@@ -6883,6 +6883,11 @@ void wxGrid::SetColPos(int idx, int pos)
|
|||||||
void wxGrid::ResetColPos()
|
void wxGrid::ResetColPos()
|
||||||
{
|
{
|
||||||
m_colAt.clear();
|
m_colAt.clear();
|
||||||
|
|
||||||
|
if ( m_useNativeHeader )
|
||||||
|
GetColHeader()->ResetColumnsOrder();
|
||||||
|
else
|
||||||
|
m_colWindow->Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGrid::EnableDragColMove( bool enable )
|
void wxGrid::EnableDragColMove( bool enable )
|
||||||
|
Reference in New Issue
Block a user