mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-04-03 18:18:36 -04:00
ifdef'd windows focus calls, remove unnecessary meter refreshes
This commit is contained in:
parent
a0d15026df
commit
ce1cd27007
@ -1779,10 +1779,11 @@ void AppFrame::refreshGainUI() {
|
||||
gainCanvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
bool AppFrame::canFocus() {
|
||||
return (!wxGetApp().isDeviceSelectorOpen() && (!modemProps || !modemProps->isMouseInView()));
|
||||
}
|
||||
#endif
|
||||
|
||||
FrequencyDialog::FrequencyDialogTarget AppFrame::getFrequencyDialogTarget() {
|
||||
FrequencyDialog::FrequencyDialogTarget target = FrequencyDialog::FrequencyDialogTarget::FDIALOG_TARGET_DEFAULT;
|
||||
|
@ -96,8 +96,10 @@ public:
|
||||
FrequencyDialog::FrequencyDialogTarget getFrequencyDialogTarget();
|
||||
void refreshGainUI();
|
||||
|
||||
#ifdef _WIN32
|
||||
bool canFocus();
|
||||
|
||||
#endif
|
||||
|
||||
private:
|
||||
void OnMenu(wxCommandEvent& event);
|
||||
void OnClose(wxCloseEvent& event);
|
||||
|
@ -126,18 +126,15 @@ void MeterCanvas::OnMouseDown(wxMouseEvent& event) {
|
||||
InteractiveCanvas::OnMouseDown(event);
|
||||
userInputValue = mouseTracker.getMouseY() * (level_max-level_min) + level_min;
|
||||
mouseTracker.setHorizDragLock(true);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MeterCanvas::OnMouseReleased(wxMouseEvent& event) {
|
||||
InteractiveCanvas::OnMouseReleased(event);
|
||||
userInputValue = mouseTracker.getMouseY() * (level_max-level_min) + level_min;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MeterCanvas::OnMouseRightDown(wxMouseEvent& event) {
|
||||
InteractiveCanvas::OnMouseRightDown(event);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MeterCanvas::OnMouseRightReleased(wxMouseEvent& event) {
|
||||
@ -145,7 +142,6 @@ void MeterCanvas::OnMouseRightReleased(wxMouseEvent& event) {
|
||||
if (showUserInput) {
|
||||
userInputValue = level - level * 0.02;
|
||||
}
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MeterCanvas::OnMouseWheelMoved(wxMouseEvent& event) {
|
||||
@ -169,8 +165,6 @@ void MeterCanvas::OnMouseWheelMoved(wxMouseEvent& event) {
|
||||
}
|
||||
|
||||
userInputValue = currentValue;
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MeterCanvas::OnMouseLeftWindow(wxMouseEvent& event) {
|
||||
@ -182,10 +176,11 @@ void MeterCanvas::OnMouseLeftWindow(wxMouseEvent& event) {
|
||||
void MeterCanvas::OnMouseEnterWindow(wxMouseEvent& event) {
|
||||
InteractiveCanvas::mouseTracker.OnMouseEnterWindow(event);
|
||||
SetCursor(wxCURSOR_CROSS);
|
||||
Refresh();
|
||||
#ifdef _WIN32
|
||||
if (wxGetApp().getAppFrame()->canFocus()) {
|
||||
this->SetFocus();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void MeterCanvas::setHelpTip(std::string tip) {
|
||||
|
@ -259,11 +259,13 @@ void SpectrumCanvas::OnMouseReleased(wxMouseEvent& event) {
|
||||
void SpectrumCanvas::OnMouseEnterWindow(wxMouseEvent& event) {
|
||||
InteractiveCanvas::OnMouseEnterWindow(event);
|
||||
SetCursor(wxCURSOR_SIZEWE);
|
||||
#ifdef _WIN32
|
||||
if (waterfallCanvas) {
|
||||
if (wxGetApp().getAppFrame()->canFocus()) {
|
||||
this->SetFocus();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void SpectrumCanvas::OnMouseLeftWindow(wxMouseEvent& event) {
|
||||
|
@ -410,9 +410,11 @@ void TuningCanvas::OnMouseEnterWindow(wxMouseEvent& event) {
|
||||
hoverIndex = 0;
|
||||
hoverState = TUNING_HOVER_NONE;
|
||||
lastPPM = currentPPM = wxGetApp().getPPM();
|
||||
#ifdef _WIN32
|
||||
if (wxGetApp().getAppFrame()->canFocus()) {
|
||||
this->SetFocus();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void TuningCanvas::setHelpTip(std::string tip) {
|
||||
|
@ -852,9 +852,11 @@ void WaterfallCanvas::OnMouseLeftWindow(wxMouseEvent& event) {
|
||||
void WaterfallCanvas::OnMouseEnterWindow(wxMouseEvent& event) {
|
||||
InteractiveCanvas::OnMouseEnterWindow(event);
|
||||
SetCursor(wxCURSOR_CROSS);
|
||||
#ifdef _WIN32
|
||||
if (wxGetApp().getAppFrame()->canFocus()) {
|
||||
this->SetFocus();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void WaterfallCanvas::OnMouseRightDown(wxMouseEvent& event) {
|
||||
|
Loading…
Reference in New Issue
Block a user