X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a35701127e3e8d2c7fb433d85c7b3954ccbfc9f..0ce5a3a853f2eaa7fe58e494aa0605918531ff3b:/src/generic/dirdlgg.cpp?ds=inline diff --git a/src/generic/dirdlgg.cpp b/src/generic/dirdlgg.cpp index 8d27c3320b..a07fbd497e 100644 --- a/src/generic/dirdlgg.cpp +++ b/src/generic/dirdlgg.cpp @@ -204,7 +204,7 @@ wxGenericDirDialog::wxGenericDirDialog(wxWindow* parent, const wxString& title, #endif // !__SMARTPHONE__ - m_dirCtrl->SetFocus(); + m_input->SetFocus(); SetAutoLayout( true ); SetSizer( topsizer ); @@ -278,7 +278,13 @@ void wxGenericDirDialog::OnTreeSelected( wxTreeEvent &event ) if (!m_dirCtrl) return; - wxDirItemData *data = (wxDirItemData*)m_dirCtrl->GetTreeCtrl()->GetItemData(event.GetItem()); + wxTreeItemId item = event.GetItem(); + + wxDirItemData *data = NULL; + + if(item.IsOk()) + data = (wxDirItemData*)m_dirCtrl->GetTreeCtrl()->GetItemData(item); + if (data) m_input->SetValue( data->m_path ); };