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:
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user