-
//////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNAMIC_CLASS( wxGridTextCtrl, wxTextCtrl )
{
switch ( event.KeyCode() )
{
+#if 0
case WXK_ESCAPE:
m_grid->SetEditControlValue( startValue );
SetInsertionPointEnd();
break;
-
+#else
+ case WXK_ESCAPE:
+ m_grid->EnableCellEditControl( FALSE );
+#endif
case WXK_UP:
case WXK_DOWN:
case WXK_LEFT:
}
}
break;
-
case WXK_HOME:
case WXK_END:
if ( m_isCellControl )
{ }
+//-----------------------------------------------------------------------------
+// wxGridEditTimer (internal)
+//-----------------------------------------------------------------------------
+
+wxGridEditTimer::wxGridEditTimer( wxGrid *owner )
+{
+ m_owner = owner;
+}
+
+void wxGridEditTimer::Notify()
+{
+ m_owner->EnableCellEditControl( TRUE );
+}
+
//////////////////////////////////////////////////////////////////////
if (m_ownTable)
delete m_table;
+ delete m_editTimer;
}
m_dragRowOrCol = -1;
m_isDragging = FALSE;
+ m_editTimer = new wxGridEditTimer ( this );
+
m_rowResizeCursor = wxCursor( wxCURSOR_SIZENS );
m_colResizeCursor = wxCursor( wxCURSOR_SIZEWE );
wxClientDC dc( m_gridWin );
PrepareDC( dc );
+ y = wxMax( y,
+ m_rowBottoms[m_dragRowOrCol] -
+ m_rowHeights[m_dragRowOrCol] +
+ WXGRID_MIN_ROW_HEIGHT );
dc.SetLogicalFunction(wxINVERT);
if ( m_dragLastPos >= 0 )
{
wxClientDC dc( m_gridWin );
PrepareDC( dc );
+ x = wxMax( x,
+ m_colRights[m_dragRowOrCol] -
+ m_colWidths[m_dragRowOrCol] +
+ WXGRID_MIN_COL_WIDTH );
dc.SetLogicalFunction(wxINVERT);
if ( m_dragLastPos >= 0 )
{
wxClientDC dc( m_gridWin );
PrepareDC( dc );
+ y = wxMax( y,
+ m_rowBottoms[m_dragRowOrCol] -
+ m_rowHeights[m_dragRowOrCol] +
+ WXGRID_MIN_ROW_HEIGHT );
dc.SetLogicalFunction(wxINVERT);
if ( m_dragLastPos >= 0 )
{
wxClientDC dc( m_gridWin );
PrepareDC( dc );
+ x = wxMax( x,
+ m_colRights[m_dragRowOrCol] -
+ m_colWidths[m_dragRowOrCol] + WXGRID_MIN_COL_WIDTH );
dc.SetLogicalFunction(wxINVERT);
if ( m_dragLastPos >= 0 )
{
//
if ( event.LeftDown() )
{
- if ( event.AltDown() )
- {
- MakeCellVisible( coords );
- SetCurrentCell( coords );
- EnableCellEditControl( TRUE );
- }
- else
- {
- EnableCellEditControl( FALSE );
- }
+ EnableCellEditControl( FALSE );
if ( event.ShiftDown() )
{
SelectBlock( m_currentCellCoords, coords );
else if ( event.LeftDClick() )
{
EnableCellEditControl( FALSE );
+ m_editTimer->Stop();
if ( XToEdgeOfCol(x) < 0 && YToEdgeOfRow(y) < 0 )
{
SendEvent( EVT_GRID_CELL_LEFT_DCLICK,
// been hidden for drag-shrinking.
if ( IsCellEditControlEnabled() )
ShowCellEditControl();
+ if( IsEditable() && coords == m_currentCellCoords )
+ m_editTimer->Start( 100, TRUE );
}
else if ( m_cursorMode == WXGRID_CURSOR_RESIZE_ROW )
{
if ( !IsCellEditControlEnabled() )
EnableCellEditControl( TRUE );
if ( IsCellEditControlEnabled() )
- {
- event.SetEventObject( m_cellEditCtrl );
- m_cellEditCtrl->GetEventHandler()->ProcessEvent( event );
- }
- break;
+ {
+ event.SetEventObject( m_cellEditCtrl );
+ m_cellEditCtrl->GetEventHandler()->ProcessEvent( event );
+ }
+ break;
}
}
int left, top, right, bottom;
CalcScrolledPosition( rect.GetLeft(), rect.GetTop(), &left, &top );
CalcScrolledPosition( rect.GetRight(), rect.GetBottom(), &right, &bottom );
-
+ left--; top--; right--; bottom--; // cell is shifted by one pixel
int cw, ch;
m_gridWin->GetClientSize( &cw, &ch );