X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/40c7c7f4732b4bb234a222d0a7b4bfdc67a26f7e..2d5efafe74f3788bfd3b3d8b1e8e13135a595ed5:/samples/widgets/dirctrl.cpp diff --git a/samples/widgets/dirctrl.cpp b/samples/widgets/dirctrl.cpp index 27bcb2cd56..485c247c34 100644 --- a/samples/widgets/dirctrl.cpp +++ b/samples/widgets/dirctrl.cpp @@ -113,6 +113,7 @@ protected: void OnCheckBox(wxCommandEvent& event); void OnRadioBox(wxCommandEvent& event); void OnSelChanged(wxTreeEvent& event); + void OnFileActivated(wxTreeEvent& event); // reset the control parameters void Reset(); @@ -157,6 +158,7 @@ BEGIN_EVENT_TABLE(DirCtrlWidgetsPage, WidgetsPage) EVT_CHECKBOX(wxID_ANY, DirCtrlWidgetsPage::OnCheckBox) EVT_RADIOBOX(wxID_ANY, DirCtrlWidgetsPage::OnRadioBox) EVT_DIRCTRL_SELECTIONCHANGED(DirCtrlPage_Ctrl, DirCtrlWidgetsPage::OnSelChanged) + EVT_DIRCTRL_FILEACTIVATED(DirCtrlPage_Ctrl, DirCtrlWidgetsPage::OnFileActivated) END_EVENT_TABLE() // ============================================================================ @@ -377,4 +379,15 @@ void DirCtrlWidgetsPage::OnSelChanged(wxTreeEvent& event) event.Skip(); } +void DirCtrlWidgetsPage::OnFileActivated(wxTreeEvent& event) +{ + if ( m_dirCtrl ) + { + wxLogMessage("File activated \"%s\"", + m_dirCtrl->GetPath(event.GetItem())); + } + + event.Skip(); +} + #endif // wxUSE_DIRDLG