void OCPNPlatform::ShowBusySpinner( void ) { #ifdef __OCPN__ANDROID__ androidShowBusyIcon(); #else if(! ::wxIsBusy() ){ ::wxBeginBusyCursor(); } #endif }
bool Piano::MouseEvent( wxMouseEvent& event ) { int x, y; event.GetPosition( &x, &y ); if(event.Leaving() || y < cc1->GetCanvasHeight() - GetHeight()) { if(m_bleaving) return false; m_bleaving = true; } else m_bleaving = false; // Check the regions int sel_index = -1; int sel_dbindex = -1; for( int i = 0; i < m_nRegions; i++ ) { if( KeyRect.Item( i ).Contains( x, 6 ) ) { sel_index = i; sel_dbindex = m_key_array.Item( i ); break; } } if(g_btouch){ if( event.LeftDown() ) { if( -1 != sel_index ){ m_action = DEFERRED_KEY_CLICK_DOWN; ShowBusy( true ); #ifdef __OCPN__ANDROID__ androidShowBusyIcon(); #endif m_eventTimer.Start(10, wxTIMER_ONE_SHOT); } } if( event.LeftUp() ) { if( -1 != sel_index ){ m_click_sel_index = sel_index; m_click_sel_dbindex = sel_dbindex; if(!m_eventTimer.IsRunning()){ m_action = DEFERRED_KEY_CLICK_UP; m_eventTimer.Start(10, wxTIMER_ONE_SHOT); } } } else if( event.RightDown() ) { if( sel_index != m_hover_last ) { gFrame->HandlePianoRollover( sel_index, sel_dbindex ); m_hover_last = sel_index; // m_action = INFOWIN_TIMEOUT; // m_eventTimer.Start(3000, wxTIMER_ONE_SHOT); } } else if( event.ButtonUp() ) { gFrame->HandlePianoRollover( -1, -1 ); ResetRollover(); } } else{ if( m_bleaving ) { gFrame->HandlePianoRollover( -1, -1 ); ResetRollover(); } else if( event.LeftDown() ) { if( -1 != sel_index ) { gFrame->HandlePianoClick( sel_index, sel_dbindex ); gFrame->Raise(); } else return false; } else if( event.RightDown() ) { if( -1 != sel_index ) { gFrame->HandlePianoRClick( x, y, sel_index, sel_dbindex ); gFrame->Raise(); } else return false; } else if(!event.ButtonUp()){ if( sel_index != m_hover_last ) { gFrame->HandlePianoRollover( sel_index, sel_dbindex ); m_hover_last = sel_index; } } } return true; /* Todo: Could do something like this to better encapsulate the pianowin Allows us to get rid of global statics... wxCommandEvent ev(MyPianoEvent); // Private event ..set up event to specify action...SelectChart, SetChartThumbnail, etc ::PostEvent(pEventReceiver, ev); // event receiver passed to ctor */ }