Add wxEVT_DIRCTRL_FILEACTIVATED wxDirCtrl event.
Allow processing double clicks on the files in the directory control. Closes #15208. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74003 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user