rename wxFileList to wxFileListCtrl

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48746 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-09-17 10:01:00 +00:00
parent d0007107fc
commit 16a6b53ddc
2 changed files with 56 additions and 56 deletions

View File

@@ -26,7 +26,7 @@ class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
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
@@ -83,7 +83,7 @@ public:
// 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,
@@ -96,7 +96,7 @@ public:
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
@@ -121,14 +121,14 @@ private:
};
//-----------------------------------------------------------------------------
// 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,
@@ -137,7 +137,7 @@ public:
long style = wxLC_LIST,
const wxValidator &validator = wxDefaultValidator,
const wxString &name = wxT("filelist") );
virtual ~wxFileList();
virtual ~wxFileListCtrl();
virtual void ChangeToListMode();
virtual void ChangeToReportMode();
@@ -177,7 +177,7 @@ protected:
wxFileData::fileListFieldType m_sort_field;
private:
DECLARE_DYNAMIC_CLASS(wxFileList)
DECLARE_DYNAMIC_CLASS(wxFileListCtrl)
DECLARE_EVENT_TABLE()
};
@@ -242,7 +242,7 @@ public:
void GoToParentDir();
void GoToHomeDir();
wxFileList *GetFileList() { return m_list; }
wxFileListCtrl *GetFileList() { return m_list; }
void ChangeToReportMode() { m_list->ChangeToReportMode(); }
void ChangeToListMode() { m_list->ChangeToListMode(); }
@@ -265,21 +265,21 @@ private:
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()

View File

@@ -390,29 +390,29 @@ void wxFileData::MakeItem( wxListItem &item )
}
//-----------------------------------------------------------------------------
// 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,
@@ -439,14 +439,14 @@ wxFileList::wxFileList(wxWindow *win,
ChangeToReportMode();
}
void wxFileList::ChangeToListMode()
void wxFileListCtrl::ChangeToListMode()
{
ClearAll();
SetSingleStyle( wxLC_LIST );
UpdateFiles();
}
void wxFileList::ChangeToReportMode()
void wxFileListCtrl::ChangeToReportMode()
{
ClearAll();
SetSingleStyle( wxLC_REPORT );
@@ -473,20 +473,20 @@ void wxFileList::ChangeToReportMode()
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;
@@ -505,7 +505,7 @@ long wxFileList::Add( wxFileData *fd, wxListItem &item )
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"));
@@ -522,7 +522,7 @@ void wxFileList::UpdateItem(const wxListItem &item)
}
}
void wxFileList::UpdateFiles()
void wxFileListCtrl::UpdateFiles()
{
// don't do anything before ShowModal() call which sets m_dirName
if ( m_dirName == wxT("*") )
@@ -629,7 +629,7 @@ void wxFileList::UpdateFiles()
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;
@@ -638,7 +638,7 @@ void wxFileList::SetWild( const wxString &wild )
UpdateFiles();
}
void wxFileList::MakeDir()
void wxFileListCtrl::MakeDir()
{
wxString new_name( _("NewName") );
wxString path( m_dirName );
@@ -686,7 +686,7 @@ void wxFileList::MakeDir()
delete fd;
}
void wxFileList::GoToParentDir()
void wxFileListCtrl::GoToParentDir()
{
if (!IsTopMostDir(m_dirName))
{
@@ -717,13 +717,13 @@ void wxFileList::GoToParentDir()
}
}
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;
@@ -737,7 +737,7 @@ void wxFileList::GoToDir( const wxString &dir )
EnsureVisible( 0 );
}
void wxFileList::FreeItemData(wxListItem& item)
void wxFileListCtrl::FreeItemData(wxListItem& item)
{
if ( item.m_data )
{
@@ -748,17 +748,17 @@ void wxFileList::FreeItemData(wxListItem& item)
}
}
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;
@@ -772,7 +772,7 @@ void wxFileList::FreeAllItemsData()
}
}
void wxFileList::OnListEndLabelEdit( wxListEvent &event )
void wxFileListCtrl::OnListEndLabelEdit( wxListEvent &event )
{
wxFileData *fd = (wxFileData*)event.m_item.m_data;
wxASSERT( fd );
@@ -820,7 +820,7 @@ void wxFileList::OnListEndLabelEdit( wxListEvent &event )
}
}
void wxFileList::OnListColClick( wxListEvent &event )
void wxFileListCtrl::OnListColClick( wxListEvent &event )
{
int col = event.GetColumn();
@@ -841,7 +841,7 @@ void wxFileList::OnListColClick( wxListEvent &event )
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;
@@ -868,11 +868,11 @@ void wxFileList::SortItems(wxFileData::fileListFieldType field, bool 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();
}
@@ -959,10 +959,10 @@ bool wxGenericFileCtrl::Create( wxWindow *parent,
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,