extern WXDLLEXPORT_DATA(const wxChar) wxFileSelectorDefaultWildcardStr[];
//-----------------------------------------------------------------------------
-// wxFileData - a class to hold the file info for the wxFileList
+// wxFileData - a class to hold the file info for the wxFileListCtrl
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxFileData
// Get/Set the type of file, file/dir/drive/link
int GetType() const { return m_type; }
- // the wxFileList fields in report view
+ // the wxFileListCtrl fields in report view
enum fileListFieldType
{
FileList_Name,
FileList_Max
};
- // Get the entry for report view of wxFileList
+ // Get the entry for report view of wxFileListCtrl
wxString GetEntry( fileListFieldType num ) const;
// Get a string representation of the file info
};
//-----------------------------------------------------------------------------
-// wxFileList
+// wxFileListCtrl
//-----------------------------------------------------------------------------
-class WXDLLEXPORT wxFileList : public wxListCtrl
+class WXDLLEXPORT wxFileListCtrl : public wxListCtrl
{
public:
- wxFileList();
- wxFileList( wxWindow *win,
+ wxFileListCtrl();
+ wxFileListCtrl( wxWindow *win,
wxWindowID id,
const wxString &wild,
bool showHidden,
long style = wxLC_LIST,
const wxValidator &validator = wxDefaultValidator,
const wxString &name = wxT("filelist") );
- virtual ~wxFileList();
+ virtual ~wxFileListCtrl();
virtual void ChangeToListMode();
virtual void ChangeToReportMode();
wxFileData::fileListFieldType m_sort_field;
private:
- DECLARE_DYNAMIC_CLASS(wxFileList)
+ DECLARE_DYNAMIC_CLASS(wxFileListCtrl)
DECLARE_EVENT_TABLE()
};
void GoToParentDir();
void GoToHomeDir();
- wxFileList *GetFileList() { return m_list; }
+ wxFileListCtrl *GetFileList() { return m_list; }
void ChangeToReportMode() { m_list->ChangeToReportMode(); }
void ChangeToListMode() { m_list->ChangeToListMode(); }
int m_style;
- wxString m_filterExtension;
- wxChoice *m_choice;
- wxTextCtrl *m_text;
- wxFileList *m_list;
- wxCheckBox *m_check;
- wxStaticText *m_static;
+ wxString m_filterExtension;
+ wxChoice *m_choice;
+ wxTextCtrl *m_text;
+ wxFileListCtrl *m_list;
+ wxCheckBox *m_check;
+ wxStaticText *m_static;
- wxString m_dir;
- wxString m_fileName;
- wxString m_wildCard; // wild card in one string as passed to the object previously.
+ wxString m_dir;
+ wxString m_fileName;
+ wxString m_wildCard; // wild card in one string as we got it
int m_filterIndex;
- bool m_inSelected;
+ bool m_inSelected;
bool m_ignoreChanges;
- bool m_noSelChgEvent; // suppress selection changed events.
+ bool m_noSelChgEvent; // suppress selection changed events.
DECLARE_DYNAMIC_CLASS( wxGenericFileCtrl )
DECLARE_EVENT_TABLE()
}
//-----------------------------------------------------------------------------
-// wxFileList
+// wxFileListCtrl
//-----------------------------------------------------------------------------
static bool ignoreChanges = false;
-IMPLEMENT_DYNAMIC_CLASS(wxFileList,wxListCtrl)
+IMPLEMENT_DYNAMIC_CLASS(wxFileListCtrl,wxListCtrl)
-BEGIN_EVENT_TABLE(wxFileList,wxListCtrl)
- EVT_LIST_DELETE_ITEM(wxID_ANY, wxFileList::OnListDeleteItem)
- EVT_LIST_DELETE_ALL_ITEMS(wxID_ANY, wxFileList::OnListDeleteAllItems)
- EVT_LIST_END_LABEL_EDIT(wxID_ANY, wxFileList::OnListEndLabelEdit)
- EVT_LIST_COL_CLICK(wxID_ANY, wxFileList::OnListColClick)
+BEGIN_EVENT_TABLE(wxFileListCtrl,wxListCtrl)
+ EVT_LIST_DELETE_ITEM(wxID_ANY, wxFileListCtrl::OnListDeleteItem)
+ EVT_LIST_DELETE_ALL_ITEMS(wxID_ANY, wxFileListCtrl::OnListDeleteAllItems)
+ EVT_LIST_END_LABEL_EDIT(wxID_ANY, wxFileListCtrl::OnListEndLabelEdit)
+ EVT_LIST_COL_CLICK(wxID_ANY, wxFileListCtrl::OnListColClick)
END_EVENT_TABLE()
-wxFileList::wxFileList()
+wxFileListCtrl::wxFileListCtrl()
{
m_showHidden = false;
m_sort_foward = 1;
m_sort_field = wxFileData::FileList_Name;
}
-wxFileList::wxFileList(wxWindow *win,
+wxFileListCtrl::wxFileListCtrl(wxWindow *win,
wxWindowID id,
const wxString& wild,
bool showHidden,
ChangeToReportMode();
}
-void wxFileList::ChangeToListMode()
+void wxFileListCtrl::ChangeToListMode()
{
ClearAll();
SetSingleStyle( wxLC_LIST );
UpdateFiles();
}
-void wxFileList::ChangeToReportMode()
+void wxFileListCtrl::ChangeToReportMode()
{
ClearAll();
SetSingleStyle( wxLC_REPORT );
UpdateFiles();
}
-void wxFileList::ChangeToSmallIconMode()
+void wxFileListCtrl::ChangeToSmallIconMode()
{
ClearAll();
SetSingleStyle( wxLC_SMALL_ICON );
UpdateFiles();
}
-void wxFileList::ShowHidden( bool show )
+void wxFileListCtrl::ShowHidden( bool show )
{
m_showHidden = show;
UpdateFiles();
}
-long wxFileList::Add( wxFileData *fd, wxListItem &item )
+long wxFileListCtrl::Add( wxFileData *fd, wxListItem &item )
{
long ret = -1;
item.m_mask = wxLIST_MASK_TEXT + wxLIST_MASK_DATA + wxLIST_MASK_IMAGE;
return ret;
}
-void wxFileList::UpdateItem(const wxListItem &item)
+void wxFileListCtrl::UpdateItem(const wxListItem &item)
{
wxFileData *fd = (wxFileData*)GetItemData(item);
wxCHECK_RET(fd, wxT("invalid filedata"));
}
}
-void wxFileList::UpdateFiles()
+void wxFileListCtrl::UpdateFiles()
{
// don't do anything before ShowModal() call which sets m_dirName
if ( m_dirName == wxT("*") )
SortItems(m_sort_field, m_sort_foward);
}
-void wxFileList::SetWild( const wxString &wild )
+void wxFileListCtrl::SetWild( const wxString &wild )
{
if (wild.Find(wxT('|')) != wxNOT_FOUND)
return;
UpdateFiles();
}
-void wxFileList::MakeDir()
+void wxFileListCtrl::MakeDir()
{
wxString new_name( _("NewName") );
wxString path( m_dirName );
delete fd;
}
-void wxFileList::GoToParentDir()
+void wxFileListCtrl::GoToParentDir()
{
if (!IsTopMostDir(m_dirName))
{
}
}
-void wxFileList::GoToHomeDir()
+void wxFileListCtrl::GoToHomeDir()
{
wxString s = wxGetUserHome( wxString() );
GoToDir(s);
}
-void wxFileList::GoToDir( const wxString &dir )
+void wxFileListCtrl::GoToDir( const wxString &dir )
{
if (!wxDirExists(dir)) return;
EnsureVisible( 0 );
}
-void wxFileList::FreeItemData(wxListItem& item)
+void wxFileListCtrl::FreeItemData(wxListItem& item)
{
if ( item.m_data )
{
}
}
-void wxFileList::OnListDeleteItem( wxListEvent &event )
+void wxFileListCtrl::OnListDeleteItem( wxListEvent &event )
{
FreeItemData(event.m_item);
}
-void wxFileList::OnListDeleteAllItems( wxListEvent & WXUNUSED(event) )
+void wxFileListCtrl::OnListDeleteAllItems( wxListEvent & WXUNUSED(event) )
{
FreeAllItemsData();
}
-void wxFileList::FreeAllItemsData()
+void wxFileListCtrl::FreeAllItemsData()
{
wxListItem item;
item.m_mask = wxLIST_MASK_DATA;
}
}
-void wxFileList::OnListEndLabelEdit( wxListEvent &event )
+void wxFileListCtrl::OnListEndLabelEdit( wxListEvent &event )
{
wxFileData *fd = (wxFileData*)event.m_item.m_data;
wxASSERT( fd );
}
}
-void wxFileList::OnListColClick( wxListEvent &event )
+void wxFileListCtrl::OnListColClick( wxListEvent &event )
{
int col = event.GetColumn();
SortItems(m_sort_field, m_sort_foward);
}
-void wxFileList::SortItems(wxFileData::fileListFieldType field, bool forward)
+void wxFileListCtrl::SortItems(wxFileData::fileListFieldType field, bool forward)
{
m_sort_field = field;
m_sort_foward = forward;
}
}
-wxFileList::~wxFileList()
+wxFileListCtrl::~wxFileListCtrl()
{
// Normally the data are freed via an EVT_LIST_DELETE_ALL_ITEMS event and
- // wxFileList::OnListDeleteAllItems. But if the event is generated after
- // the destruction of the wxFileList we need to free any data here:
+ // wxFileListCtrl::OnListDeleteAllItems. But if the event is generated after
+ // the destruction of the wxFileListCtrl we need to free any data here:
FreeAllItemsData();
}
style2 |= wxSUNKEN_BORDER;
#endif
- m_list = new wxFileList( this, ID_FILELIST_CTRL,
- wxEmptyString, false,
- wxDefaultPosition, wxSize( 400, 140 ),
- style2 );
+ m_list = new wxFileListCtrl( this, ID_FILELIST_CTRL,
+ wxEmptyString, false,
+ wxDefaultPosition, wxSize( 400, 140 ),
+ style2 );
m_text = new wxTextCtrl( this, ID_TEXT, wxEmptyString,
wxDefaultPosition, wxDefaultSize,