From 40c7c7f4732b4bb234a222d0a7b4bfdc67a26f7e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 16 May 2013 14:33:01 +0000 Subject: [PATCH] Rename wxEVT_DIRCTRL_CHANGED to wxEVT_DIRCTRL_SELECTIONCHANGED. This is more consistent with the existing wxEVT_FILECTRL_SELECTIONCHANGED. Closes #15209. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 2 +- include/wx/generic/dirctrlg.h | 10 ++++++---- interface/wx/dirctrl.h | 6 +++--- samples/widgets/dirctrl.cpp | 2 +- src/generic/dirctrlg.cpp | 4 ++-- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index b16eb57c18..c7c93b4643 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -634,7 +634,7 @@ All (GUI): - Close wxLogWindow automatically if it's the last remaining top level window. - Implement clipping for wxSVGFileDC (Steve Benbow). - Add wxDirCtrl::GetPath() (troelsk). -- Add wxEVT_COMMAND_DIRCTRL_CHANGED event (troelsk). +- Add wxEVT_DIRCTRL_SELECTIONCHANGED event (troelsk). - Add wxControl::GetSizeFromTextSize() (Manuel Martin). - Optionally allow showing tooltips for disabled ribbon buttons (wxBen). - Add wxTL_NO_HEADER style to wxTreeListCtrl (robboto). diff --git a/include/wx/generic/dirctrlg.h b/include/wx/generic/dirctrlg.h index de3e380522..6d625ba67a 100644 --- a/include/wx/generic/dirctrlg.h +++ b/include/wx/generic/dirctrlg.h @@ -209,10 +209,12 @@ private: wxDECLARE_NO_COPY_CLASS(wxGenericDirCtrl); }; -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DIRCTRL_CHANGED, wxTreeEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DIRCTRL_SELECTIONCHANGED, wxTreeEvent ); -#define EVT_DIRCTRL_CHANGED(id, fn) \ - wx__DECLARE_EVT1(wxEVT_DIRCTRL_CHANGED, id, wxTreeEventHandler(fn)) +#define wx__DECLARE_DIRCTRL_EVT(evt, id, fn) \ + wx__DECLARE_EVT1(wxEVT_DIRCTRL_ ## evt, id, wxTreeEventHandler(fn)) + +#define EVT_DIRCTRL_SELECTIONCHANGED(id, fn) wx__DECLARE_DIRCTRL_EVT(SELECTIONCHANGED, id, fn) //----------------------------------------------------------------------------- // wxDirFilterListCtrl @@ -307,7 +309,7 @@ extern WXDLLIMPEXP_DATA_CORE(wxFileIconsTable *) wxTheFileIconsTable; #endif // wxUSE_DIRDLG || wxUSE_FILEDLG || wxUSE_FILECTRL // old wxEVT_COMMAND_* constants -#define wxEVT_COMMAND_DIRCTRL_CHANGED wxEVT_DIRCTRL_CHANGED +#define wxEVT_COMMAND_DIRCTRL_SELECTIONCHANGED wxEVT_DIRCTRL_SELECTIONCHANGED #endif // _WX_DIRCTRLG_H_ diff --git a/interface/wx/dirctrl.h b/interface/wx/dirctrl.h index 2583497d9c..65f0592c18 100644 --- a/interface/wx/dirctrl.h +++ b/interface/wx/dirctrl.h @@ -51,9 +51,9 @@ enum @library{wxcore} @category{ctrl} @appearance{genericdirctrl} - @event{EVT_DIRCTRL_CHANGED(id, func)} + @event{EVT_DIRCTRL_SELECTIONCHANGED(id, func)} Selected directory has changed. - Processes a @c wxEVT_DIRCTRL_CHANGED event type. + Processes a @c wxEVT_DIRCTRL_SELECTIONCHANGED event type. Notice that this event is generated even for the changes done by the program itself and not only those done by the user. @since 2.9.5 @@ -278,4 +278,4 @@ public: void FillFilterList(const wxString& filter, int defaultFilter); }; -wxEventType wxEVT_DIRCTRL_CHANGED; +wxEventType wxEVT_DIRCTRL_SELECTIONCHANGED; diff --git a/samples/widgets/dirctrl.cpp b/samples/widgets/dirctrl.cpp index ff3b96cf3e..27bcb2cd56 100644 --- a/samples/widgets/dirctrl.cpp +++ b/samples/widgets/dirctrl.cpp @@ -156,7 +156,7 @@ BEGIN_EVENT_TABLE(DirCtrlWidgetsPage, WidgetsPage) EVT_BUTTON(DirCtrlPage_SetPath, DirCtrlWidgetsPage::OnButtonSetPath) EVT_CHECKBOX(wxID_ANY, DirCtrlWidgetsPage::OnCheckBox) EVT_RADIOBOX(wxID_ANY, DirCtrlWidgetsPage::OnRadioBox) - EVT_DIRCTRL_CHANGED(DirCtrlPage_Ctrl, DirCtrlWidgetsPage::OnSelChanged) + EVT_DIRCTRL_SELECTIONCHANGED(DirCtrlPage_Ctrl, DirCtrlWidgetsPage::OnSelChanged) END_EVENT_TABLE() // ============================================================================ diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index f38afa7ce9..824c836942 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -106,7 +106,7 @@ bool wxIsDriveAvailable(const wxString& dirName); // events // ---------------------------------------------------------------------------- -wxDEFINE_EVENT( wxEVT_DIRCTRL_CHANGED, wxTreeEvent ); +wxDEFINE_EVENT( wxEVT_DIRCTRL_SELECTIONCHANGED, wxTreeEvent ); // ---------------------------------------------------------------------------- // wxGetAvailableDrives, for WINDOWS, DOS, OS2, MAC, UNIX (returns "/") @@ -703,7 +703,7 @@ void wxGenericDirCtrl::OnEndEditItem(wxTreeEvent &event) void wxGenericDirCtrl::OnTreeSelChange(wxTreeEvent &event) { - wxTreeEvent changedEvent(wxEVT_DIRCTRL_CHANGED, GetId()); + wxTreeEvent changedEvent(wxEVT_DIRCTRL_SELECTIONCHANGED, GetId()); changedEvent.SetEventObject(this); changedEvent.SetItem(event.GetItem());