Send the autosize column event for grid native header columns

Send wxEVT_GRID_COL_AUTO_SIZE on double clicking on a separator line of
the grid native header to allow override default behaviour.
This commit is contained in:
Ilya Sinitsyn
2019-09-30 23:36:31 +07:00
committed by Vadim Zeitlin
parent 6ed0443d2f
commit 8971321542
3 changed files with 16 additions and 11 deletions

View File

@@ -3874,13 +3874,7 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event, wxGridColLabelWindo
}
else
{
// adjust column width depending on label text
//
// TODO: generate RESIZING event, see #10754
if ( !SendGridSizeEvent(wxEVT_GRID_COL_AUTO_SIZE, -1, colEdge, event) )
AutoSizeColLabelSize( colEdge );
SendGridSizeEvent(wxEVT_GRID_COL_SIZE, -1, colEdge, event);
HandleColumnAutosize(colEdge, event);
ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL, colLabelWin);
m_dragLastPos = -1;
@@ -4023,6 +4017,17 @@ void wxGrid::ProcessCornerLabelMouseEvent( wxMouseEvent& event )
}
}
void wxGrid::HandleColumnAutosize(int col, const wxMouseEvent& event)
{
// adjust column width depending on label text
//
// TODO: generate RESIZING event, see #10754
if ( !SendGridSizeEvent(wxEVT_GRID_COL_AUTO_SIZE, -1, col, event) )
AutoSizeColLabelSize(col);
SendGridSizeEvent(wxEVT_GRID_COL_SIZE, -1, col, event);
}
void wxGrid::CancelMouseCapture()
{
// cancel operation currently in progress, whatever it is