X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0b98a2524ef29bad7a644bfd329e335d6db3bde8..7b70a3257f24daa4d574afd03c82e65631af1f2b:/src/generic/filedlgg.cpp diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index ca936c346b..6f301a8f23 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -23,7 +23,7 @@ #if wxUSE_FILEDLG // NOTE : it probably also supports MAC, untested -#if !defined(__UNIX__) && !defined(__DOS__) && !defined(__WIN32__) +#if !defined(__UNIX__) && !defined(__DOS__) && !defined(__WIN32__) && !defined(__OS2__) #error wxGenericFileDialog currently only supports Unix, win32 and DOS #endif @@ -82,7 +82,7 @@ // ---------------------------------------------------------------------------- static -int wxFileDataNameCompare( long data1, long data2, long data) +int wxCALLBACK wxFileDataNameCompare( long data1, long data2, long data) { wxFileData *fd1 = (wxFileData*)data1; wxFileData *fd2 = (wxFileData*)data2; @@ -94,7 +94,7 @@ int wxFileDataNameCompare( long data1, long data2, long data) } static -int wxFileDataSizeCompare( long data1, long data2, long data) +int wxCALLBACK wxFileDataSizeCompare( long data1, long data2, long data) { wxFileData *fd1 = (wxFileData*)data1; wxFileData *fd2 = (wxFileData*)data2; @@ -108,7 +108,7 @@ int wxFileDataSizeCompare( long data1, long data2, long data) } static -int wxFileDataTypeCompare( long data1, long data2, long data) +int wxCALLBACK wxFileDataTypeCompare( long data1, long data2, long data) { wxFileData *fd1 = (wxFileData*)data1; wxFileData *fd2 = (wxFileData*)data2; @@ -122,7 +122,7 @@ int wxFileDataTypeCompare( long data1, long data2, long data) } static -int wxFileDataTimeCompare( long data1, long data2, long data) +int wxCALLBACK wxFileDataTimeCompare( long data1, long data2, long data) { wxFileData *fd1 = (wxFileData*)data1; wxFileData *fd2 = (wxFileData*)data2; @@ -134,11 +134,11 @@ int wxFileDataTimeCompare( long data1, long data2, long data) return fd1->GetDateTime().IsLaterThan(fd2->GetDateTime()) ? int(data) : -int(data); } -#ifdef __UNIX__ +#if defined(__UNIX__) && !defined(__OS2__) #define IsTopMostDir(dir) (dir == wxT("/")) #endif -#if defined(__DOS__) || defined(__WINDOWS__) +#if defined(__DOS__) || defined(__WINDOWS__) || defined (__OS2__) #define IsTopMostDir(dir) (dir.IsEmpty()) #endif @@ -183,7 +183,7 @@ void wxFileData::ReadData() return; } -#if defined(__DOS__) || defined(__WINDOWS__) +#if defined(__DOS__) || defined(__WINDOWS__) || defined(__OS2__) // c:\.. is a drive don't stat it if ((m_fileName == wxT("..")) && (m_filePath.length() <= 5)) { @@ -195,7 +195,7 @@ void wxFileData::ReadData() wxStructStat buff; -#if defined(__UNIX__) && (!defined( __EMX__ ) && !defined(__VMS)) +#if defined(__UNIX__) && (!defined( __OS2__ ) && !defined(__VMS)) lstat( m_filePath.fn_str(), &buff ); m_type |= S_ISLNK( buff.st_mode ) != 0 ? is_link : 0; #else // no lstat() @@ -343,8 +343,9 @@ void wxFileData::MakeItem( wxListItem &item ) if (IsLink()) { - wxColour *dg = wxTheColourDatabase->FindColour( _T("MEDIUM GREY") ); - item.SetTextColour(*dg); + wxColour dg = wxTheColourDatabase->Find( _T("MEDIUM GREY") ); + if ( dg.Ok() ) + item.SetTextColour(dg); } item.m_data = (long)this; } @@ -490,12 +491,11 @@ void wxFileCtrl::UpdateFiles() FreeAllItemsData(); DeleteAllItems(); - wxFileData *fd = (wxFileData *) NULL; wxListItem item; item.m_itemId = 0; item.m_col = 0; -#if defined(__WINDOWS__) || defined(__DOS__) || defined(__WXMAC__) || defined(__WXPM__) +#if defined(__WINDOWS__) || defined(__DOS__) || defined(__WXMAC__) || defined(__OS2__) if ( IsTopMostDir(m_dirName) ) { wxArrayString names, paths; @@ -504,7 +504,7 @@ void wxFileCtrl::UpdateFiles() for (n=0; nEnable(enable); -#if defined(__DOS__) || defined(__WINDOWS__) +#if defined(__DOS__) || defined(__WINDOWS__) || defined(__OS2__) m_newDirButton->Enable(enable); -#endif // defined(__DOS__) || defined(__WINDOWS__) +#endif // defined(__DOS__) || defined(__WINDOWS__) || defined(__OS2__) } #ifdef USE_GENERIC_FILEDIALOG