]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/dirctrlg.cpp
Fix typo in a closing "#endif" comment in the test.
[wxWidgets.git] / src / generic / dirctrlg.cpp
index 56349938d99e2ffc6b5be17eb32ff0455bf58690..f38afa7ce95ef62fac3397a542603d11be67d075 100644 (file)
@@ -106,7 +106,7 @@ bool wxIsDriveAvailable(const wxString& dirName);
 // events
 // ----------------------------------------------------------------------------
 
-wxDEFINE_EVENT( wxEVT_COMMAND_DIRCTRL_CHANGED, wxTreeEvent );
+wxDEFINE_EVENT( wxEVT_DIRCTRL_CHANGED, wxTreeEvent );
 
 // ----------------------------------------------------------------------------
 // wxGetAvailableDrives, for WINDOWS, DOS, OS2, MAC, UNIX (returns "/")
@@ -518,7 +518,7 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
     m_treeCtrl = CreateTreeCtrl(this, wxID_TREECTRL,
                                 wxPoint(0,0), GetClientSize(), treeStyle);
 
-    if (!filter.empty())
+    if (!filter.empty() && (style & wxDIRCTRL_SHOW_FILTERS))
         m_filterListCtrl = new wxDirFilterListCtrl(this, wxID_FILTERLISTCTRL);
 
     m_defaultPath = dir;
@@ -703,7 +703,7 @@ void wxGenericDirCtrl::OnEndEditItem(wxTreeEvent &event)
 
 void wxGenericDirCtrl::OnTreeSelChange(wxTreeEvent &event)
 {
-    wxTreeEvent changedEvent(wxEVT_COMMAND_DIRCTRL_CHANGED, GetId());
+    wxTreeEvent changedEvent(wxEVT_DIRCTRL_CHANGED, GetId());
 
     changedEvent.SetEventObject(this);
     changedEvent.SetItem(event.GetItem());
@@ -1251,7 +1251,7 @@ void wxGenericDirCtrl::SetFilter(const wxString& filter)
 {
     m_filter = filter;
 
-    if (!filter.empty() && !m_filterListCtrl)
+    if (!filter.empty() && !m_filterListCtrl && HasFlag(wxDIRCTRL_SHOW_FILTERS))
         m_filterListCtrl = new wxDirFilterListCtrl(this, wxID_FILTERLISTCTRL);
     else if (filter.empty() && m_filterListCtrl)
     {