diff --git a/include/OCPNPlatform.h b/include/OCPNPlatform.h index 5da8d85ab9..20ab29ba74 100644 --- a/include/OCPNPlatform.h +++ b/include/OCPNPlatform.h @@ -86,8 +86,8 @@ class OCPNPlatform //-------------------------------------------------------------------------- // Platform Display Support //-------------------------------------------------------------------------- - void ShowBusySpinner( void ); - void HideBusySpinner( void ); + static void ShowBusySpinner( void ); + static void HideBusySpinner( void ); double getFontPointsperPixel( void ); wxSize getDisplaySize(); double GetDisplaySizeMM(); diff --git a/src/CM93DSlide.cpp b/src/CM93DSlide.cpp index 6750920636..cfe82c2917 100644 --- a/src/CM93DSlide.cpp +++ b/src/CM93DSlide.cpp @@ -29,6 +29,7 @@ #include "CM93DSlide.h" #include "chart1.h" #include "chcanv.h" +#include "OCPNPlatform.h" extern bool g_bShowCM93DetailSlider; extern CM93DSlide *pCM93DetailSlider; @@ -125,11 +126,11 @@ void CM93DSlide::OnChangeValue( wxScrollEvent& event ) { g_cm93_zoom_factor = m_pCM93DetailSlider->GetValue(); - ::wxBeginBusyCursor(); + OCPNPlatform::ShowBusySpinner(); cc1->ReloadVP(); cc1->Refresh( false ); - ::wxEndBusyCursor(); + OCPNPlatform::HideBusySpinner(); } diff --git a/src/OCPNPlatform.cpp b/src/OCPNPlatform.cpp index 9085be0549..c69fd05fcf 100644 --- a/src/OCPNPlatform.cpp +++ b/src/OCPNPlatform.cpp @@ -1056,7 +1056,7 @@ void OCPNPlatform::ShowBusySpinner( void ) #ifdef __OCPN__ANDROID__ androidShowBusyIcon(); #else - if(! ::wxIsBusy() ){ + if( !::wxIsBusy() ){ ::wxBeginBusyCursor(); } #endif @@ -1067,7 +1067,10 @@ void OCPNPlatform::HideBusySpinner( void ) #ifdef __OCPN__ANDROID__ androidHideBusyIcon(); #else - if( ::wxIsBusy() ){ + #if wxCHECK_VERSION(2, 9, 0 ) + if( ::wxIsBusy() ) + #endif + { ::wxEndBusyCursor(); } #endif diff --git a/src/chcanv.cpp b/src/chcanv.cpp index 2fd132211f..4642979acd 100644 --- a/src/chcanv.cpp +++ b/src/chcanv.cpp @@ -36,6 +36,7 @@ #include #include "dychart.h" +#include "OCPNPlatform.h" #include @@ -8117,7 +8118,7 @@ void ChartCanvas::ShowTrackPropertiesDialog( Route* selected ) void pupHandler_PasteWaypoint() { Kml* kml = new Kml(); - ::wxBeginBusyCursor(); + OCPNPlatform::ShowBusySpinner(); int pasteBuffer = kml->ParsePasteBuffer(); RoutePoint* pasted = kml->GetParsedRoutePoint(); @@ -8154,12 +8155,12 @@ void pupHandler_PasteWaypoint() { cc1->InvalidateGL(); cc1->Refresh( false ); delete kml; - ::wxEndBusyCursor(); + OCPNPlatform::HideBusySpinner(); } void pupHandler_PasteRoute() { Kml* kml = new Kml(); - ::wxBeginBusyCursor(); + OCPNPlatform::ShowBusySpinner(); int pasteBuffer = kml->ParsePasteBuffer(); Route* pasted = kml->GetParsedRoute(); @@ -8274,12 +8275,12 @@ void pupHandler_PasteRoute() { } delete kml; - ::wxEndBusyCursor(); + OCPNPlatform::HideBusySpinner(); } void pupHandler_PasteTrack() { Kml* kml = new Kml(); - ::wxBeginBusyCursor(); + OCPNPlatform::ShowBusySpinner(); int pasteBuffer = kml->ParsePasteBuffer(); Track* pasted = kml->GetParsedTrack(); @@ -8326,7 +8327,7 @@ void pupHandler_PasteTrack() { cc1->InvalidateGL(); cc1->Refresh( false ); delete kml; - ::wxEndBusyCursor(); + OCPNPlatform::HideBusySpinner(); } bool ChartCanvas::InvokeCanvasMenu(int x, int y, int seltype) diff --git a/src/cm93.cpp b/src/cm93.cpp index bbf3ac5010..9eba92d557 100644 --- a/src/cm93.cpp +++ b/src/cm93.cpp @@ -2217,7 +2217,7 @@ void cm93chart::SetVPParms ( const ViewPort &vpt ) } } if( s_b_busy_shown){ - ::wxEndBusyCursor(); + OCPNPlatform::HideBusySpinner(); s_b_busy_shown = false; } } @@ -6824,9 +6824,9 @@ void CM93OffsetDialog::UpdateOffsets ( void ) // Closing the current cell will record the offsets in the M_COVR cache file // Re-opening will then refresh the M_COVRs in the cover set - ::wxBeginBusyCursor(); + OCPNPlatform::ShowBusySpinner(); m_pcompchart->CloseandReopenCurrentSubchart(); - ::wxEndBusyCursor(); + OCPNPlatform::ShowBusySpinner(); if ( m_pparent ) { m_pparent->Refresh ( true ); diff --git a/src/s57chart.cpp b/src/s57chart.cpp index f3d16c7851..32dceac47b 100644 --- a/src/s57chart.cpp +++ b/src/s57chart.cpp @@ -35,6 +35,7 @@ #include #include "dychart.h" +#include "OCPNPlatform.h" #include "s52s57.h" #include "s52plib.h" @@ -2904,7 +2905,7 @@ InitReturn s57chart::Init( const wxString& name, ChartInitFlag flags ) if( fn.GetExt() == _T("000") ) { if( m_bbase_file_attr_known ) { - ::wxBeginBusyCursor(); + OCPNPlatform::ShowBusySpinner(); int sret = FindOrCreateSenc( name ); if( sret != BUILD_SENC_OK ) { @@ -2914,18 +2915,18 @@ InitReturn s57chart::Init( const wxString& name, ChartInitFlag flags ) } else ret_value = PostInit( flags, m_global_color_scheme ); - ::wxEndBusyCursor(); + OCPNPlatform::HideBusySpinner(); } } else if( fn.GetExt() == _T("S57") ) { - ::wxBeginBusyCursor(); + OCPNPlatform::ShowBusySpinner(); m_SENCFileName = name; ret_value = PostInit( flags, m_global_color_scheme ); - ::wxEndBusyCursor(); + OCPNPlatform::HideBusySpinner(); } @@ -4844,12 +4845,12 @@ int s57chart::BuildRAZFromSENCFile( const wxString& FullPath ) nGeo1000 = nGeoFeature / 500; #ifdef __WXMSW__ - wxBeginBusyCursor(); + // OCPNPlatform::ShowBusySpinner(); /* SENC_prog = new wxProgressDialog( _("OpenCPN S57 SENC File Load"), FullPath, nGeo1000, NULL, wxPD_AUTO_HIDE | wxPD_CAN_ABORT | wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME | wxPD_SMOOTH); */ - wxEndBusyCursor(); + // OCPNPlatform::HideBusySpinner(); #endif }