MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / ForwardMouseEvent

Method ForwardMouseEvent

src/audio_display.cpp:1124–1167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1122}
1123
1124bool AudioDisplay::ForwardMouseEvent(wxMouseEvent &event) {
1125 // Handle any ongoing drag
1126 if (dragged_object && HasCapture())
1127 {
1128 if (!dragged_object->OnMouseEvent(event))
1129 {
1130 scroll_timer.Stop();
1131 SetDraggedObject(nullptr);
1132 SetCursor(wxNullCursor);
1133 }
1134 return true;
1135 }
1136 else
1137 {
1138 // Something is wrong, we might have lost capture somehow.
1139 // Fix state and pretend it didn't happen.
1140 SetDraggedObject(nullptr);
1141 SetCursor(wxNullCursor);
1142 }
1143
1144 const wxPoint mousepos = event.GetPosition();
1145 AudioDisplayInteractionObject *new_obj = nullptr;
1146 // Check for scrollbar action
1147 if (scrollbar->GetBounds().Contains(mousepos))
1148 {
1149 new_obj = scrollbar.get();
1150 }
1151 // Check for timeline action
1152 else if (timeline->GetBounds().Contains(mousepos))
1153 {
1154 SetCursor(wxCursor(wxCURSOR_SIZEWE));
1155 new_obj = timeline.get();
1156 }
1157 else
1158 {
1159 return false;
1160 }
1161
1162 if (!controller->IsPlaying())
1163 RemoveTrackCursor();
1164 if (new_obj->OnMouseEvent(event))
1165 SetDraggedObject(new_obj);
1166 return true;
1167}
1168
1169void AudioDisplay::OnKeyDown(wxKeyEvent& event)
1170{

Callers

nothing calls this directly

Calls 5

OnMouseEventMethod · 0.45
StopMethod · 0.45
GetPositionMethod · 0.45
getMethod · 0.45
IsPlayingMethod · 0.45

Tested by

no test coverage detected