wxZRColaCharGrid now forwards Tab key to allow classic dialog control navigation

This commit is contained in:
Simon Rozman 2016-05-06 08:40:03 +02:00
parent f9ef646f22
commit 01c50ba9e1
2 changed files with 20 additions and 0 deletions

View File

@ -26,6 +26,7 @@
BEGIN_EVENT_TABLE(wxZRColaCharGrid, wxGrid)
EVT_SIZE(wxZRColaCharGrid::OnSize)
EVT_KEY_DOWN(wxZRColaCharGrid::OnKeyDown)
END_EVENT_TABLE()
@ -106,3 +107,21 @@ void wxZRColaCharGrid::OnSize(wxSizeEvent& event)
EndBatch();
m_isResizing = false;
}
void wxZRColaCharGrid::OnKeyDown(wxKeyEvent& event)
{
wxWindow *parentWnd;
if (event.GetKeyCode() == WXK_TAB && (parentWnd = GetParent()) != NULL) {
wxNavigationKeyEvent eventNav;
eventNav.SetDirection(!event.ShiftDown());
eventNav.SetWindowChange(event.ControlDown());
eventNav.SetEventObject(this);
if (parentWnd->HandleWindowEvent(eventNav))
return;
}
event.Skip();
}

View File

@ -54,6 +54,7 @@ public:
protected:
void OnSize(wxSizeEvent& event);
void OnKeyDown(wxKeyEvent& event);
DECLARE_EVENT_TABLE()
protected: