#include "wx/generic/gridsel.h"
-const wxChar wxGridNameStr[] = wxT("grid");
+const char wxGridNameStr[] = "grid";
#if defined(__WXMOTIF__)
#define WXUNUSED_MOTIF(identifier) WXUNUSED(identifier)
if ((ctrl || alt) && !(ctrl && alt))
return false;
- int key = 0;
- bool keyOk = true;
-
-#ifdef __WXGTK20__
- // If it's a F-Key or other special key then it shouldn't start the
- // editor.
- if (event.GetKeyCode() >= WXK_START)
- return false;
-#endif
#if wxUSE_UNICODE
// if the unicode key code is not really a unicode character (it may
// be a function key or etc., the platforms appear to always give us a
// small value in this case) then fallback to the ASCII key code but
// don't do anything for function keys or etc.
- key = event.GetUnicodeKey();
- if (key <= 127)
- {
- key = event.GetKeyCode();
- keyOk = (key <= 127);
- }
+ if ( event.GetUnicodeKey() > 127 && event.GetKeyCode() > 127 )
+ return false;
#else
- key = event.GetKeyCode();
- keyOk = (key <= 255);
+ if ( event.GetKeyCode() > 255 )
+ return false;
#endif
- return keyOk;
+ return true;
}
void wxGridCellEditor::StartingKey(wxKeyEvent& event)
m_data[row][col] = value;
}
-bool wxGridStringTable::IsEmptyCell( int row, int col )
-{
- wxCHECK_MSG( (row < GetNumberRows()) && (col < GetNumberCols()),
- true,
- _T("invalid row or column index in wxGridStringTable") );
-
- return (m_data[row][col] == wxEmptyString);
-}
-
void wxGridStringTable::Clear()
{
int row, col;
wxGrid::~wxGrid()
{
+ if ( m_winCapture )
+ m_winCapture->ReleaseMouse();
+
// Ensure that the editor control is destroyed before the grid is,
// otherwise we crash later when the editor tries to do something with the
// half destroyed grid
m_colWidths.Add( m_defaultColWidth, m_numCols );
- int colRight = 0;
for ( int i = 0; i < m_numCols; i++ )
{
- colRight = ( GetColPos( i ) + 1 ) * m_defaultColWidth;
+ int colRight = ( GetColPos( i ) + 1 ) * m_defaultColWidth;
m_colRights.Add( colRight );
}
}
if ( m_winCapture )
{
- if (m_winCapture->HasCapture())
- m_winCapture->ReleaseMouse();
+ m_winCapture->ReleaseMouse();
m_winCapture = NULL;
}
{
if (m_winCapture)
{
- if (m_winCapture->HasCapture())
- m_winCapture->ReleaseMouse();
+ m_winCapture->ReleaseMouse();
m_winCapture = NULL;
}
bool wxGrid::MovePageDown()
{
return DoMoveCursorByPage(
- wxGridForwardOperations(this, wxGridColumnOperations()));
+ wxGridForwardOperations(this, wxGridRowOperations()));
}
// helper of DoMoveCursorByBlock(): advance the cell coordinates using diroper