| 797 | } |
| 798 | |
| 799 | LRESULT OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled) |
| 800 | { |
| 801 | switch( wParam ) { |
| 802 | case VK_F2: |
| 803 | case VK_SPACE: |
| 804 | case VK_RETURN: |
| 805 | if( _IsValidSelection() ) { |
| 806 | IProperty* prop = GetProperty(m_iSelectedRow, m_iSelectedCol); |
| 807 | ATLASSERT(prop); |
| 808 | if( prop->IsEnabled() ) { |
| 809 | _SpawnInplaceWindow(prop, m_iSelectedRow, m_iSelectedCol); |
| 810 | prop->Activate(PACT_SPACE, 0); |
| 811 | _InvalidateItem(m_iSelectedRow, m_iSelectedCol); |
| 812 | } |
| 813 | } |
| 814 | return 0; |
| 815 | case VK_TAB: |
| 816 | if( (m_di.dwExtStyle & PGS_EX_TABNAVIGATION) != 0 ) { |
| 817 | SendMessage(WM_USER_PROP_NAVIGATE, VK_TAB); |
| 818 | } |
| 819 | else { |
| 820 | ::PostMessage(GetParent(), WM_NEXTDLGCTL, ::GetKeyState(VK_SHIFT) < 0 ? 1 : 0, (LPARAM) FALSE); |
| 821 | } |
| 822 | return 0; |
| 823 | case VK_LEFT: |
| 824 | case VK_RIGHT: |
| 825 | SendMessage(WM_USER_PROP_NAVIGATE, wParam); |
| 826 | return 0; |
| 827 | case VK_DELETE: |
| 828 | if( _IsValidSelection() ) { |
| 829 | IProperty* prop = GetProperty(m_iSelectedRow, m_iSelectedCol); |
| 830 | ATLASSERT(prop); |
| 831 | // We support pressing DELETE key on an edit control as well |
| 832 | // as typing stuff (see OnChar() handler) |
| 833 | if( prop->GetKind() == PROPKIND_EDIT && prop->IsEnabled() ) { |
| 834 | if( _SpawnInplaceWindow(prop, m_iSelectedRow, m_iSelectedCol) ) { |
| 835 | prop->Activate(PACT_SPACE, 0); |
| 836 | // Simulate typing in the inplace editor... |
| 837 | ::SendMessage(m_hwndInplace, WM_KEYDOWN, wParam, 0L); |
| 838 | _InvalidateItem(m_iSelectedRow, m_iSelectedCol); |
| 839 | } |
| 840 | } |
| 841 | } |
| 842 | return 0; |
| 843 | } |
| 844 | bHandled = FALSE; |
| 845 | return 0; |
| 846 | } |
| 847 | |
| 848 | LRESULT OnChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled) |
| 849 | { |
nothing calls this directly
no test coverage detected