git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57371
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// only the display and hit testing code really cares about display
// positions at all
// only the display and hit testing code really cares about display
// positions at all
+ // set the positions of all columns at once (this method uses the same
+ // conventions as wxHeaderCtrl::SetColumnsOrder() for the order array)
+ void SetColumnsOrder(const wxArrayInt& order);
+
// return the column index corresponding to the given (valid) position
int GetColAt(int pos) const
{
// return the column index corresponding to the given (valid) position
int GetColAt(int pos) const
{
*/
void SetColPos(int colID, int newPos);
*/
void SetColPos(int colID, int newPos);
+ /**
+ Sets the positions of all columns at once.
+
+ This method takes an array containing the indices of the columns in
+ their display order, i.e. uses the same convention as
+ wxHeaderCtrl::SetColumnsOrder().
+ */
+ void SetColumnsOrder(const wxArrayInt& order);
+
/**
Resets the position of the columns to the default.
*/
/**
Resets the position of the columns to the default.
*/
GetOwner()->SendEvent(wxEVT_GRID_COL_SIZE, -1, idx);
}
GetOwner()->SendEvent(wxEVT_GRID_COL_SIZE, -1, idx);
}
// event handlers forwarding wxHeaderCtrl events to wxGrid
void OnClick(wxHeaderCtrlEvent& event)
{
// event handlers forwarding wxHeaderCtrl events to wxGrid
void OnClick(wxHeaderCtrlEvent& event)
{
+void wxGrid::SetColumnsOrder(const wxArrayInt& order)
+{
+ m_colAt = order;
+
+ RefreshAfterColPosChange();
+}
+
void wxGrid::SetColPos(int idx, int pos)
{
// we're going to need m_colAt now, initialize it if needed
void wxGrid::SetColPos(int idx, int pos)
{
// we're going to need m_colAt now, initialize it if needed