wxZRColaCharGrid now forwards Tab key to allow classic dialog control navigation
This commit is contained in:
parent
f9ef646f22
commit
01c50ba9e1
@ -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();
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ public:
|
||||
|
||||
protected:
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
protected:
|
||||
|
Loading…
x
Reference in New Issue
Block a user