- {
- cell->SetTextValue(grid->GetTextItem()->GetValue());
- if ( m_editInPlace && !m_inOnTextInPlace )
- {
- m_inPlaceTextItem->SetValue( grid->GetTextItem()->GetValue() );
- }
-
- wxClientDC dc(grid);
-
- dc.BeginDrawing();
- grid->SetGridClippingRegion(& dc);
- grid->DrawCellBackground(& dc, &grid->GetCurrentRect(), grid->GetCursorRow(), grid->GetCursorColumn());
- grid->DrawCellValue(& dc, &grid->GetCurrentRect(), grid->GetCursorRow(), grid->GetCursorColumn());
- if ( !(m_editable && m_editInPlace ) ) grid->HighlightCell(& dc);
- dc.DestroyClippingRegion();
- dc.EndDrawing();
-
- //grid->OnCellChange(grid->GetCursorRow(), grid->GetCursorColumn());
- wxGridEvent g_evt(GetId(), wxEVT_GRID_CELL_CHANGE, grid,
- grid->GetCursorRow(), grid->GetCursorColumn());
- GetEventHandler()->ProcessEvent(g_evt);
-
- // grid->DrawCellText();
- }
+ {
+ cell->SetTextValue(grid->GetTextItem()->GetValue());
+ if ( m_editInPlace && !m_inOnTextInPlace )
+ {
+ m_inPlaceTextItem->SetValue( grid->GetTextItem()->GetValue() );
+ }
+
+ if (!m_editInPlace) {
+ wxClientDC dc(grid);
+
+ dc.BeginDrawing();
+ grid->SetGridClippingRegion(& dc);
+ grid->DrawCellBackground(& dc, &grid->GetCurrentRect(), grid->GetCursorRow(), grid->GetCursorColumn());
+ grid->DrawCellValue(& dc, &grid->GetCurrentRect(), grid->GetCursorRow(), grid->GetCursorColumn());
+ grid->HighlightCell(& dc, TRUE);
+ dc.DestroyClippingRegion();
+ dc.EndDrawing();
+ }
+
+ //grid->OnCellChange(grid->GetCursorRow(), grid->GetCursorColumn());
+ wxGridEvent g_evt(GetId(), wxEVT_GRID_CELL_CHANGE, grid,
+ grid->GetCursorRow(), grid->GetCursorColumn());
+ GetEventHandler()->ProcessEvent(g_evt);
+
+ // grid->DrawCellText();
+ }
+ }
+}
+
+void wxGenericGrid::OnTextEnter(wxCommandEvent& WXUNUSED(ev) )
+{
+ // move the cursor down the current row (if possible)
+ // when the enter key has been pressed
+ //
+ if ( m_editable )
+ {
+ if ( GetCursorRow() < GetRows()-1 )
+ {
+ wxClientDC dc( this );
+ dc.BeginDrawing();
+ OnSelectCellImplementation(& dc,
+ GetCursorRow()+1,
+ GetCursorColumn() );
+ dc.EndDrawing();
+ }