MCPcopy Create free account
hub / github.com/cjcliffe/CubicSDR / OnMouseMoved

Method OnMouseMoved

src/visual/SpectrumCanvas.cpp:230–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void SpectrumCanvas::OnMouseMoved(wxMouseEvent& event) {
231 InteractiveCanvas::OnMouseMoved(event);
232 if (mouseTracker.mouseDown()) {
233 int freqChange = mouseTracker.getDeltaMouseX() * getBandwidth();
234
235 if (freqChange != 0) {
236 moveCenterFrequency(freqChange);
237 }
238 }
239 else if (scaleFactorEnabled && mouseTracker.mouseRightDown()) {
240
241 updateScaleFactorFromYMove(mouseTracker.getDeltaMouseY());
242
243 } else {
244 if (scaleFactorEnabled) {
245 setStatusText("Drag horizontal to adjust center frequency. Arrow keys or wheel to navigate/zoom bandwidth. Right-drag or SHIFT+UP/DOWN to adjust visual gain, right-click to reset it. 'B' to toggle decibels display.");
246 } else {
247 setStatusText("Displaying spectrum of active demodulator.");
248 }
249 }
250}
251
252void SpectrumCanvas::OnMouseDown(wxMouseEvent& event) {
253 SetCursor(wxCURSOR_SIZEWE);

Callers

nothing calls this directly

Calls 4

mouseDownMethod · 0.80
getDeltaMouseXMethod · 0.80
mouseRightDownMethod · 0.80
getDeltaMouseYMethod · 0.80

Tested by

no test coverage detected