- m_iFlags &= ~(wxPG_FL_IGNORE_NEXT_NAVKEY);
- event.Skip();
- return;
- }
-
- wxPGProperty* next = (wxPGProperty*) NULL;
-
- int dir = event.GetDirection()?1:-1;
-
- if ( m_selected )
- {
- if ( dir == 1 && (m_wndEditor || m_wndEditor2) )
- {
- wxWindow* focused = wxWindow::FindFocus();
-
- wxWindow* wndToCheck = GetEditorControl();
-
- // ODComboBox focus goes to its text ctrl, so we need to use it instead
- if ( wndToCheck && wndToCheck->IsKindOf(CLASSINFO(wxOwnerDrawnComboBox)) )
- {
- wxTextCtrl* comboTextCtrl = ((wxOwnerDrawnComboBox*)wndToCheck)->GetTextCtrl();
- if ( comboTextCtrl )
- wndToCheck = comboTextCtrl;
- }
-
- /*
- // Because of problems navigating from wxButton, do not go to it.
- if ( !wndToCheck )
- {
- // No primary, use secondary
- wndToCheck = m_wndEditor2;
- }
- // If it has editor button, focus to it after the primary editor.
- // NB: Doesn't work since wxButton on wxMSW doesn't seem to propagate
- // key events (yes, I'm using wxWANTS_CHARS with it, and yes I
- // have somewhat debugged in window.cpp itself).
- else if ( focused == wndToCheck &&
- m_wndEditor2 &&
- !(GetExtraStyle() & wxPG_EX_NO_TAB_TO_BUTTON) )
- {
- wndToCheck = m_wndEditor2;
- wxLogDebug(wxT("Exp1"));
- }
- */
-
- if ( focused != wndToCheck &&
- wndToCheck )
- {
- wndToCheck->SetFocus();
-
- // Select all text in wxTextCtrl etc.
- if ( m_wndEditor && wndToCheck == m_wndEditor )
- m_selected->GetEditorClass()->OnFocus(m_selected,wndToCheck);
-
- m_editorFocused = 1;
- next = m_selected;
- }
- }
-
- if ( !next )
- {
- next = wxPropertyGridIterator::OneStep(m_pState, wxPG_ITERATE_VISIBLE, m_selected, dir);
-
- if ( next )
- {
- // This allows preventing NavigateOut to occur
- DoSelectProperty( next, wxPG_SEL_FOCUS );
- }
- }