bool PawsManager::HandleEvent( iEvent &event ) { if (event.Name == MouseMove) return HandleMouseMove (event); if (event.Name == MouseDown) return HandleMouseDown (event); if (event.Name == MouseDoubleClick) return HandleDoubleClick (event); if (event.Name == MouseUp) return HandleMouseUp (event); if (event.Name == KeyboardDown || event.Name == KeyboardUp) return HandleKeyDown( event ); return false; }
void TExportZone::MouseDown(BPoint where) { // Do nothing if we are playing if ( IsPlaying() ) return; // Activate cue sheet Window()->Activate(true); // Reset cue drag flag static_cast<MuseumApp *>(be_app)->m_IsCueDrag = false; // Reset drag type m_DragType = kNoDrag; // Check to see which button is down uint32 buttons = 0; Window()->CurrentMessage()->FindInt32("buttons", (int32 *)&buttons); uint32 type; int32 count = 0; BMessage *message = Window()->CurrentMessage(); // Determine which button has been clicked switch(buttons) { case B_PRIMARY_MOUSE_BUTTON: if (B_OK == message->GetInfo("clicks", &type, &count) ) { int32 clickCount = message->FindInt32("clicks", count-1); // Handle double click if ( (clickCount == 2) ) { HandleDoubleClick(where); } // Determine where mouse click occured else { HandleClick(where); } } break; default: break; } }