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
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
@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}
wxCheckBox *m_chkDirOnly,
*m_chk3D,
*m_chkFirst,
+ *m_chkFilters,
*m_chkLabels,
*m_chkMulti;
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());
( 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)
);
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;
{
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)
{
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();