Restore wxDIRCTRL_SHOW_FILTERS flag of wxDirCtrl.

Closes #8572.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-03-09 15:07:49 +00:00
parent b09857ae00
commit aa9453d6f4
5 changed files with 11 additions and 5 deletions

View 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

View 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}

View 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)
);

View 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)
{

View 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();