Allow wxGridCellNumberEditor::StartingKey to work when the control is

a spinctrl too.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2005-05-30 18:48:23 +00:00
parent f0e8780701
commit eb5e42b615

View File

@@ -956,9 +956,9 @@ bool wxGridCellNumberEditor::IsAcceptedKey(wxKeyEvent& event)
void wxGridCellNumberEditor::StartingKey(wxKeyEvent& event)
{
int keycode = event.GetKeyCode();
if ( !HasRange() )
{
int keycode = event.GetKeyCode();
if ( wxIsdigit(keycode) || keycode == '+' || keycode == '-')
{
wxGridCellTextEditor::StartingKey(event);
@@ -967,7 +967,18 @@ void wxGridCellNumberEditor::StartingKey(wxKeyEvent& event)
return;
}
}
#if wxUSE_SPINCTRL
else
{
if ( wxIsdigit(keycode) )
{
wxSpinCtrl* spin = (wxSpinCtrl*)m_control;
spin->SetValue(keycode - '0');
spin->SetSelection(1,1);
return;
}
}
#endif
event.Skip();
}