]> git.saurik.com Git - wxWidgets.git/commitdiff
Restore wxDIRCTRL_SHOW_FILTERS flag of wxDirCtrl.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 9 Mar 2013 15:07:49 +0000 (15:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 9 Mar 2013 15:07:49 +0000 (15:07 +0000)
Closes #8572.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/dirctrlg.h
interface/wx/dirctrl.h
samples/widgets/dirctrl.cpp
src/generic/dirctrlg.cpp
src/xrc/xh_gdctl.cpp

index af6ab5de586830f2d29b63fd095f093e68cd0ca5..815ff2554bc10c15f1249ad9feb7e6c1508c789d 100644 (file)
@@ -39,10 +39,8 @@ enum
     wxDIRCTRL_DIR_ONLY       = 0x0010,
     // When setting the default path, select the first file in the directory
     wxDIRCTRL_SELECT_FIRST   = 0x0020,
-#if WXWIN_COMPATIBILITY_2_8
-    // Unused, for compatibility only
+    // Show the filter list
     wxDIRCTRL_SHOW_FILTERS   = 0x0040,
-#endif // WXWIN_COMPATIBILITY_2_8
     // Use 3D borders on internal controls
     wxDIRCTRL_3D_INTERNAL    = 0x0080,
     // Editable labels
index 37c96d45a058be783324ec76799033d5c9eabb34..e650643106056534b28bf3ecf06c170d4edd17b3 100644 (file)
@@ -12,6 +12,8 @@ enum
     wxDIRCTRL_DIR_ONLY       = 0x0010,
     // When setting the default path, select the first file in the directory
     wxDIRCTRL_SELECT_FIRST   = 0x0020,
+    // Show the filter list
+    wxDIRCTRL_SHOW_FILTERS   = 0x0040,
     // Use 3D borders on internal controls
     wxDIRCTRL_3D_INTERNAL    = 0x0080,
     // Editable labels
@@ -38,6 +40,8 @@ enum
     @style{wxDIRCTRL_SELECT_FIRST}
            When setting the default path, select the first file in the
            directory.
+    @style{wxDIRCTRL_SHOW_FILTERS}
+           Show the drop-down filter list.
     @style{wxDIRCTRL_EDIT_LABELS}
            Allow the folder and file labels to be editable.
     @style{wxDIRCTRL_MULTIPLE}
index 6a55991d552bc040cb4fdc11099618aff40dda0d..ff3b96cf3ec9ab38066fe0a13b9fbaf9b290e662 100644 (file)
@@ -135,6 +135,7 @@ protected:
     wxCheckBox *m_chkDirOnly,
                *m_chk3D,
                *m_chkFirst,
+               *m_chkFilters,
                *m_chkLabels,
                *m_chkMulti;
 
@@ -190,6 +191,7 @@ void DirCtrlWidgetsPage::CreateContent()
     m_chkDirOnly = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_DIR_ONLY"));
     m_chk3D      = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_3D_INTERNAL"));
     m_chkFirst   = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_SELECT_FIRST"));
+    m_chkFilters = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_SHOW_FILTERS"));
     m_chkLabels  = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_EDIT_LABELS"));
     m_chkMulti   = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_MULTIPLE"));
     sizerLeft->Add(sizerUseFlags, wxSizerFlags().Expand().Border());
@@ -252,6 +254,7 @@ void DirCtrlWidgetsPage::CreateDirCtrl()
         ( m_chkDirOnly->IsChecked() ? wxDIRCTRL_DIR_ONLY : 0 ) |
         ( m_chk3D->IsChecked() ? wxDIRCTRL_3D_INTERNAL : 0 ) |
         ( m_chkFirst->IsChecked() ? wxDIRCTRL_SELECT_FIRST : 0 ) |
+        ( m_chkFilters->IsChecked() ? wxDIRCTRL_SHOW_FILTERS : 0 ) |
         ( m_chkLabels->IsChecked() ? wxDIRCTRL_EDIT_LABELS : 0 ) |
         ( m_chkMulti->IsChecked() ? wxDIRCTRL_MULTIPLE : 0)
     );
index 56349938d99e2ffc6b5be17eb32ff0455bf58690..78f8ffc2529a39b3dcecff52ee41e5759ce16fd0 100644 (file)
@@ -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;
@@ -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)
     {
index 367ab6048954f0a1e002b9ec042e132969dc5286..74a0977fd162a9b9ae993ee592ffedbf702ef3e7 100644 (file)
@@ -33,6 +33,7 @@ wxGenericDirCtrlXmlHandler::wxGenericDirCtrlXmlHandler()
     XRC_ADD_STYLE(wxDIRCTRL_DIR_ONLY);
     XRC_ADD_STYLE(wxDIRCTRL_3D_INTERNAL);
     XRC_ADD_STYLE(wxDIRCTRL_SELECT_FIRST);
+    XRC_ADD_STYLE(wxDIRCTRL_SHOW_FILTERS);
     XRC_ADD_STYLE(wxDIRCTRL_EDIT_LABELS);
     XRC_ADD_STYLE(wxDIRCTRL_MULTIPLE);
     AddWindowStyles();