X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/766fc092881a3095587161c1a6c48f636a91de04..7d6a4d96961eac84d05db8bb24c64d39003f6e54:/src/generic/filectrlg.cpp?ds=sidebyside diff --git a/src/generic/filectrlg.cpp b/src/generic/filectrlg.cpp index 3ab54d312b..87c3fc7866 100644 --- a/src/generic/filectrlg.cpp +++ b/src/generic/filectrlg.cpp @@ -35,7 +35,7 @@ #include "wx/tokenzr.h" #include "wx/imaglist.h" -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #include "wx/msw/wrapwin.h" #endif @@ -53,7 +53,7 @@ // ---------------------------------------------------------------------------- static -int wxCALLBACK wxFileDataNameCompare( long data1, long data2, wxIntPtr sortOrder) +int wxCALLBACK wxFileDataNameCompare( wxIntPtr data1, wxIntPtr data2, wxIntPtr sortOrder) { wxFileData *fd1 = (wxFileData *)wxUIntToPtr(data1); wxFileData *fd2 = (wxFileData *)wxUIntToPtr(data2); @@ -71,7 +71,7 @@ int wxCALLBACK wxFileDataNameCompare( long data1, long data2, wxIntPtr sortOrder } static -int wxCALLBACK wxFileDataSizeCompare(long data1, long data2, wxIntPtr sortOrder) +int wxCALLBACK wxFileDataSizeCompare(wxIntPtr data1, wxIntPtr data2, wxIntPtr sortOrder) { wxFileData *fd1 = (wxFileData *)wxUIntToPtr(data1); wxFileData *fd2 = (wxFileData *)wxUIntToPtr(data2); @@ -93,7 +93,7 @@ int wxCALLBACK wxFileDataSizeCompare(long data1, long data2, wxIntPtr sortOrder) } static -int wxCALLBACK wxFileDataTypeCompare(long data1, long data2, wxIntPtr sortOrder) +int wxCALLBACK wxFileDataTypeCompare(wxIntPtr data1, wxIntPtr data2, wxIntPtr sortOrder) { wxFileData *fd1 = (wxFileData *)wxUIntToPtr(data1); wxFileData *fd2 = (wxFileData *)wxUIntToPtr(data2); @@ -115,7 +115,7 @@ int wxCALLBACK wxFileDataTypeCompare(long data1, long data2, wxIntPtr sortOrder) } static -int wxCALLBACK wxFileDataTimeCompare(long data1, long data2, wxIntPtr sortOrder) +int wxCALLBACK wxFileDataTimeCompare(wxIntPtr data1, wxIntPtr data2, wxIntPtr sortOrder) { wxFileData *fd1 = (wxFileData *)wxUIntToPtr(data1); wxFileData *fd2 = (wxFileData *)wxUIntToPtr(data2); @@ -377,7 +377,7 @@ void wxFileData::MakeItem( wxListItem &item ) if (IsLink()) { wxColour dg = wxTheColourDatabase->Find( wxT("MEDIUM GREY") ); - if ( dg.Ok() ) + if ( dg.IsOk() ) item.SetTextColour(dg); } item.m_data = wxPtrToUInt(this); @@ -677,14 +677,14 @@ void wxFileListCtrl::MakeDir() wxListItem item; item.m_itemId = 0; item.m_col = 0; - long id = Add( fd, item ); + long itemid = Add( fd, item ); - if (id != -1) + if (itemid != -1) { SortItems(m_sort_field, m_sort_forward); - id = FindItem( 0, wxPtrToUInt(fd) ); - EnsureVisible( id ); - EditLabel( id ); + itemid = FindItem( 0, wxPtrToUInt(fd) ); + EnsureVisible( itemid ); + EditLabel( itemid ); } else delete fd; @@ -883,9 +883,9 @@ wxFileListCtrl::~wxFileListCtrl() // wxGenericFileCtrl implementation /////////////////////////////////////////////////////////////////////////////// -IMPLEMENT_DYNAMIC_CLASS( wxGenericFileCtrl, wxPanel ) +IMPLEMENT_DYNAMIC_CLASS( wxGenericFileCtrl, wxNavigationEnabled ) -BEGIN_EVENT_TABLE( wxGenericFileCtrl, wxPanel ) +BEGIN_EVENT_TABLE( wxGenericFileCtrl, wxNavigationEnabled ) EVT_LIST_ITEM_SELECTED( ID_FILELIST_CTRL, wxGenericFileCtrl::OnSelected ) EVT_LIST_ITEM_ACTIVATED( ID_FILELIST_CTRL, wxGenericFileCtrl::OnActivated ) EVT_CHOICE( ID_CHOICE, wxGenericFileCtrl::OnChoiceFilter ) @@ -916,7 +916,11 @@ bool wxGenericFileCtrl::Create( wxWindow *parent, wxASSERT_MSG( !( ( m_style & wxFC_SAVE ) && ( m_style & wxFC_MULTIPLE ) ), wxT( "wxFC_MULTIPLE can't be used with wxFC_SAVE" ) ); - wxPanel::Create( parent, id, pos, size, wxTAB_TRAVERSAL, name ); + wxNavigationEnabled::Create( parent, id, + pos, size, + wxTAB_TRAVERSAL, + wxDefaultValidator, + name ); m_dir = defaultDirectory; @@ -1184,6 +1188,8 @@ void wxGenericFileCtrl::DoSetFilterIndex( int filterindex ) { m_filterExtension.clear(); } + + GenerateFilterChangedEvent( this, this ); } void wxGenericFileCtrl::SetWildcard( const wxString& wildCard )