Generic dirctrl corrections

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7878 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2000-07-27 16:34:51 +00:00
parent d62653e63f
commit f9c165b1d6
2 changed files with 18 additions and 10 deletions

View File

@ -75,7 +75,7 @@ public:
const wxString &dir = wxDirDialogDefaultFolderStr, const wxString &dir = wxDirDialogDefaultFolderStr,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDIRCTRL_3D_INTERNAL, long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER,
const wxString& filter = wxEmptyString, const wxString& filter = wxEmptyString,
int defaultFilter = 0, int defaultFilter = 0,
const wxString& name = wxTreeCtrlNameStr ) const wxString& name = wxTreeCtrlNameStr )
@ -88,7 +88,7 @@ public:
const wxString &dir = wxDirDialogDefaultFolderStr, const wxString &dir = wxDirDialogDefaultFolderStr,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDIRCTRL_3D_INTERNAL, long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER,
const wxString& filter = wxEmptyString, const wxString& filter = wxEmptyString,
int defaultFilter = 0, int defaultFilter = 0,
const wxString& name = wxTreeCtrlNameStr ); const wxString& name = wxTreeCtrlNameStr );

View File

@ -722,6 +722,7 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)
wxDir d; wxDir d;
wxString eachFilename; wxString eachFilename;
wxLogNull log;
d.Open(dirName); d.Open(dirName);
if (d.IsOpened()) if (d.IsOpened())
@ -743,6 +744,8 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)
// Now do the filenames -- but only if we're allowed to // Now do the filenames -- but only if we're allowed to
if ((GetWindowStyle() & wxDIRCTRL_DIR_ONLY) == 0) if ((GetWindowStyle() & wxDIRCTRL_DIR_ONLY) == 0)
{ {
wxLogNull log;
d.Open(dirName); d.Open(dirName);
if (d.IsOpened()) if (d.IsOpened())
@ -783,14 +786,18 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)
options = wxDIR_DIRS; options = wxDIR_DIRS;
} }
wxDir dir2(path); wxLogNull log;
wxString str; wxDir dir2;
// Have to test for wxDIR_DIRS separately in case m_currentFilterStr is non-empty and if (dir2.Open(path))
// and filters out any directories
if (dir2.GetFirst(& str, m_currentFilterStr, options) || dir2.GetFirst(& str, wxEmptyString, wxDIR_DIRS))
{ {
m_treeCtrl->SetItemHasChildren(id); wxString str;
} // Have to test for wxDIR_DIRS separately in case m_currentFilterStr is non-empty and
// and filters out any directories
if (dir2.GetFirst(& str, m_currentFilterStr, options) || dir2.GetFirst(& str, wxEmptyString, wxDIR_DIRS))
{
m_treeCtrl->SetItemHasChildren(id);
}
}
} }
// Add the sorted filenames // Add the sorted filenames
@ -982,6 +989,7 @@ void wxGenericDirCtrl::FindChildFiles(wxTreeItemId id, int dirFlags, wxArrayStri
wxDir d; wxDir d;
wxString eachFilename; wxString eachFilename;
wxLogNull log;
d.Open(dirName); d.Open(dirName);
if (d.IsOpened()) if (d.IsOpened())
@ -1180,7 +1188,7 @@ wxGenericDirDialog::wxGenericDirDialog(wxWindow* parent, const wxString& title,
// 1) dir ctrl // 1) dir ctrl
m_dirCtrl = new wxGenericDirCtrl(this, ID_DIRCTRL, m_dirCtrl = new wxGenericDirCtrl(this, ID_DIRCTRL,
defaultPath, wxPoint(5, 5), defaultPath, wxPoint(5, 5),
wxSize(300, 200), wxDIRCTRL_DIR_ONLY); wxSize(300, 200), wxDIRCTRL_DIR_ONLY|wxSUNKEN_BORDER);
topsizer->Add( m_dirCtrl, 1, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, 10 ); topsizer->Add( m_dirCtrl, 1, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, 10 );