X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/59ddac01094fa71996012466638d4e2d965362ae..c18ac572dba92039e133a42a5412b4541a315edd:/src/generic/grid.cpp diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 22bd89555c..b6afb0c214 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -3629,9 +3629,10 @@ void wxGrid::Create() m_cellEditCtrlEnabled = FALSE; - m_defaultCellAttr = new wxGridCellAttr(m_defaultCellAttr); + m_defaultCellAttr = new wxGridCellAttr(); // Set default cell attributes + m_defaultCellAttr->SetDefAttr(m_defaultCellAttr); m_defaultCellAttr->SetKind(wxGridCellAttr::Default); m_defaultCellAttr->SetFont(GetFont()); m_defaultCellAttr->SetAlignment(wxALIGN_LEFT, wxALIGN_TOP); @@ -5831,7 +5832,14 @@ void wxGrid::OnKeyDown( wxKeyEvent& event ) || editor->IsAcceptedKey(event) ) { EnableCellEditControl(); - editor->StartingKey(event); + + // the editor could be not shown for a variety of + // reasons (i.e. blocked by the app or whatever), so + // check if it really was created + if ( m_cellEditCtrlEnabled ) + { + editor->StartingKey(event); + } } else {