#include "wx/mimetype.h"
#include "wx/image.h"
#include "wx/choice.h"
-#include "wx/filedlg.h" // for wxFileDialogBase::ParseWildcard
#if wxUSE_STATLINE
#include "wx/statline.h"
wxBEGIN_PROPERTIES_TABLE(wxGenericDirCtrl)
wxHIDE_PROPERTY( Children )
- wxPROPERTY( DefaultPath , wxString , SetDefaultPath , GetDefaultPath , , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
- wxPROPERTY( Filter , wxString , SetFilter , GetFilter ,, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
- wxPROPERTY( DefaultFilter , int , SetFilterIndex, GetFilterIndex,, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
- wxPROPERTY_FLAGS( WindowStyle, wxGenericDirCtrlStyle, long, SetWindowStyleFlag, GetWindowStyleFlag, , 0, wxT("Helpstring"), wxT("group") )
+ wxPROPERTY( DefaultPath , wxString , SetDefaultPath , GetDefaultPath , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+ wxPROPERTY( Filter , wxString , SetFilter , GetFilter , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
+ wxPROPERTY( DefaultFilter , int , SetFilterIndex, GetFilterIndex, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
+ wxPROPERTY_FLAGS( WindowStyle, wxGenericDirCtrlStyle, long, SetWindowStyleFlag, GetWindowStyleFlag, EMPTY_MACROVALUE , 0, wxT("Helpstring"), wxT("group") )
wxEND_PROPERTIES_TABLE()
wxBEGIN_HANDLERS_TABLE(wxGenericDirCtrl)
#endif
BEGIN_EVENT_TABLE(wxGenericDirCtrl, wxControl)
- EVT_TREE_ITEM_EXPANDING (-1, wxGenericDirCtrl::OnExpandItem)
- EVT_TREE_ITEM_COLLAPSED (-1, wxGenericDirCtrl::OnCollapseItem)
- EVT_TREE_BEGIN_LABEL_EDIT (-1, wxGenericDirCtrl::OnBeginEditItem)
- EVT_TREE_END_LABEL_EDIT (-1, wxGenericDirCtrl::OnEndEditItem)
+ EVT_TREE_ITEM_EXPANDING (wxID_TREECTRL, wxGenericDirCtrl::OnExpandItem)
+ EVT_TREE_ITEM_COLLAPSED (wxID_TREECTRL, wxGenericDirCtrl::OnCollapseItem)
+ EVT_TREE_BEGIN_LABEL_EDIT (wxID_TREECTRL, wxGenericDirCtrl::OnBeginEditItem)
+ EVT_TREE_END_LABEL_EDIT (wxID_TREECTRL, wxGenericDirCtrl::OnEndEditItem)
EVT_SIZE (wxGenericDirCtrl::OnSize)
END_EVENT_TABLE()
if (!m_defaultPath.IsEmpty())
ExpandPath(m_defaultPath);
+ SetBestSize(size);
DoResize();
return TRUE;
bool wxGenericDirCtrl::ExtractWildcard(const wxString& filterStr, int n, wxString& filter, wxString& description)
{
wxArrayString filters, descriptions;
- int count = ParseFilter(filterStr, filters, descriptions);
+ int count = wxParseWildcard(filterStr, filters, descriptions);
if (count > 0 && n < count)
{
filter = filters[n];
return FALSE;
}
+#if WXWIN_COMPATIBILITY_2_4
// Parses the global filter, returning the number of filters.
// Returns 0 if none or if there's a problem.
// filterStr is in the form: "All files (*.*)|*.*|JPEG Files (*.jpeg)|*.jpg"
-
int wxGenericDirCtrl::ParseFilter(const wxString& filterStr, wxArrayString& filters, wxArrayString& descriptions)
{
- return wxFileDialogBase::ParseWildcard(filterStr, descriptions, filters );
+ return wxParseWildcard(filterStr, descriptions, filters );
}
+#endif // WXWIN_COMPATIBILITY_2_4
void wxGenericDirCtrl::DoResize()
{
{
Clear();
wxArrayString descriptions, filters;
- size_t n = (size_t) m_dirCtrl->ParseFilter(filter, filters, descriptions);
+ size_t n = (size_t) wxParseWildcard(filter, filters, descriptions);
if (n > 0 && defaultFilter < (int) n)
{
return m_smallImageList;
}
-#if wxUSE_MIMETYPE
+#if wxUSE_MIMETYPE && wxUSE_IMAGE
// VS: we don't need this function w/o wxMimeTypesManager because we'll only have
// one icon and we won't resize it
const unsigned int size = 16;
int id = m_smallImageList->GetImageCount();
- if ((bmp.GetWidth() == size) && (bmp.GetHeight() == size))
+ if ((bmp.GetWidth() == (int) size) && (bmp.GetHeight() == (int) size))
{
m_smallImageList->Add(bmp);
}
+#if wxUSE_IMAGE
else
{
wxImage img = bmp.ConvertToImage();
else
m_smallImageList->Add(CreateAntialiasedBitmap(img));
}
-
+#endif // wxUSE_IMAGE
+
m_HashTable->Put(extension, new wxFileIconEntry(id));
return id;