Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General ux fixes #745

Merged
merged 5 commits into from
Jul 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")

SET(CUBICSDR_VERSION_MAJOR "0")
SET(CUBICSDR_VERSION_MINOR "2")
SET(CUBICSDR_VERSION_PATCH "5")
SET(CUBICSDR_VERSION_SUFFIX "")
SET(CUBICSDR_VERSION_PATCH "6")
SET(CUBICSDR_VERSION_SUFFIX "a")
SET(CUBICSDR_VERSION "${CUBICSDR_VERSION_MAJOR}.${CUBICSDR_VERSION_MINOR}.${CUBICSDR_VERSION_PATCH}${CUBICSDR_VERSION_SUFFIX}")

SET(CPACK_PACKAGE_VERSION "${CUBICSDR_VERSION_MAJOR}.${CUBICSDR_VERSION_MINOR}.${CUBICSDR_VERSION_PATCH}")
Expand Down
Binary file modified external/msvc/x64/vc_redist.x64.exe
Binary file not shown.
Binary file modified external/msvc/x86/vc_redist.x86.exe
Binary file not shown.
38 changes: 27 additions & 11 deletions src/AppFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2769,15 +2769,19 @@ FrequencyDialog::FrequencyDialogTarget AppFrame::getFrequencyDialogTarget() {
return target;
}

void AppFrame::gkNudgeLeft(DemodulatorInstancePtr demod, int snap) {
void AppFrame::gkNudge(DemodulatorInstancePtr demod, int snap) {
if (demod) {
demod->setFrequency(demod->getFrequency()-snap);
demod->updateLabel(demod->getFrequency());
}
}
auto demodFreq = demod->getFrequency()+snap;
auto demodBw = demod->getBandwidth();

auto ctr = wxGetApp().getFrequency();
auto bw = wxGetApp().getSampleRate();

// Don't let it get nudged out of view.
if (ctr - (bw / 2) > (demodFreq - demodBw / 2) || ctr + (bw / 2) < (demodFreq + demodBw / 2)) {
wxGetApp().setFrequency(ctr+(snap*2));
}

void AppFrame::gkNudgeRight(DemodulatorInstancePtr demod, int snap) {
if (demod) {
demod->setFrequency(demod->getFrequency()+snap);
demod->updateLabel(demod->getFrequency());
}
Expand Down Expand Up @@ -2821,10 +2825,10 @@ int AppFrame::OnGlobalKeyDown(wxKeyEvent &event) {
#ifdef wxHAS_RAW_KEY_CODES
switch (event.GetRawKeyCode()) {
case 30:
gkNudgeRight(lastDemod, snap);
gkNudge(lastDemod, snap);
return 1;
case 33:
gkNudgeLeft(lastDemod, snap);
gkNudge(lastDemod, -snap);
return 1;
}
#endif
Expand All @@ -2844,10 +2848,10 @@ int AppFrame::OnGlobalKeyDown(wxKeyEvent &event) {
case 'V':
return 1;
case ']':
gkNudgeRight(lastDemod, snap);
gkNudge(lastDemod, snap);
return 1;
case '[':
gkNudgeLeft(lastDemod, snap);
gkNudge(lastDemod, -snap);
return 1;
case 'A':
case 'F':
Expand All @@ -2858,6 +2862,18 @@ int AppFrame::OnGlobalKeyDown(wxKeyEvent &event) {
case 'M':
case 'R':
return 1;
case WXK_NUMPAD0:
case WXK_NUMPAD1:
case WXK_NUMPAD2:
case WXK_NUMPAD3:
case WXK_NUMPAD4:
case WXK_NUMPAD5:
case WXK_NUMPAD6:
case WXK_NUMPAD7:
case WXK_NUMPAD8:
case WXK_NUMPAD9:
wxGetApp().showFrequencyInput(getFrequencyDialogTarget(), std::to_string(event.GetKeyCode() - WXK_NUMPAD0));
return 1;
case '0':
case '1':
case '2':
Expand Down
3 changes: 1 addition & 2 deletions src/AppFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ class AppFrame: public wxFrame {
/**
* Keyboard handlers
*/
void gkNudgeLeft(DemodulatorInstancePtr demod, int snap);
void gkNudgeRight(DemodulatorInstancePtr demod, int snap);
void gkNudge(DemodulatorInstancePtr demod, int snap);

void toggleActiveDemodRecording();
void toggleAllActiveDemodRecording();
Expand Down
9 changes: 5 additions & 4 deletions src/CubicSDR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -945,11 +945,12 @@ void CubicSDR::showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetM
const wxString gainTitle("Gain Entry: "+wxGetApp().getActiveGainEntry());

wxString title;

auto activeModem = demodMgr.getActiveContextModem();

switch (targetMode) {
case FrequencyDialog::FDIALOG_TARGET_DEFAULT:
case FrequencyDialog::FDIALOG_TARGET_FREQ:
title = demodMgr.getActiveContextModem()?demodTitle:freqTitle;
title = activeModem ?demodTitle:freqTitle;
break;
case FrequencyDialog::FDIALOG_TARGET_BANDWIDTH:
title = bwTitle;
Expand All @@ -969,8 +970,8 @@ void CubicSDR::showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetM
default:
break;
}
FrequencyDialog fdialog(appframe, -1, title, demodMgr.getActiveContextModem(), wxPoint(-100,-100), wxSize(350, 75), wxDEFAULT_DIALOG_STYLE, targetMode, initString);

FrequencyDialog fdialog(appframe, -1, title, activeModem, wxPoint(-100,-100), wxSize(350, 75), wxDEFAULT_DIALOG_STYLE, targetMode, initString);
fdialog.ShowModal();
}

Expand Down
12 changes: 9 additions & 3 deletions src/FrequencyDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,24 @@ void FrequencyDialog::OnChar(wxKeyEvent& event) {
}
}

if (targetMode == FDIALOG_TARGET_DEFAULT) {
if (targetMode == FDIALOG_TARGET_DEFAULT || targetMode == FDIALOG_TARGET_FREQ) {
if (ranged) {
freq = strToFrequency(strValue);
freq2 = strToFrequency(strValue2);
} else {
freq = strToFrequency(strValue);
}
if (activeDemod) {
activeDemod->setTracking(true);
activeDemod->setFollow(true);
activeDemod->setFrequency(freq);
activeDemod->updateLabel(freq);

freq_ctr = wxGetApp().getFrequency();
range_bw = wxGetApp().getSampleRate();

if (freq_ctr - (range_bw / 2) > freq || freq_ctr + (range_bw / 2) < freq) {
wxGetApp().setFrequency(freq);
}

} else {
if (ranged && (freq || freq2)) {
if (freq > freq2) {
Expand Down
2 changes: 2 additions & 0 deletions src/forms/Bookmark/BookmarkPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ BookmarkPanel::BookmarkPanel( wxWindow* parent, wxWindowID id, const wxPoint& po
m_searchText->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BookmarkPanel::onSearchText ), NULL, this );
m_clearSearchButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BookmarkPanel::onClearSearch ), NULL, this );
m_treeView->Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( BookmarkPanel::onEnterWindow ), NULL, this );
m_treeView->Connect( wxEVT_KEY_UP, wxKeyEventHandler( BookmarkPanel::onKeyUp ), NULL, this );
m_treeView->Connect( wxEVT_LEAVE_WINDOW, wxMouseEventHandler( BookmarkPanel::onLeaveWindow ), NULL, this );
m_treeView->Connect( wxEVT_MOTION, wxMouseEventHandler( BookmarkPanel::onMotion ), NULL, this );
m_treeView->Connect( wxEVT_COMMAND_TREE_BEGIN_DRAG, wxTreeEventHandler( BookmarkPanel::onTreeBeginDrag ), NULL, this );
Expand Down Expand Up @@ -120,6 +121,7 @@ BookmarkPanel::~BookmarkPanel()
m_searchText->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BookmarkPanel::onSearchText ), NULL, this );
m_clearSearchButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BookmarkPanel::onClearSearch ), NULL, this );
m_treeView->Disconnect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( BookmarkPanel::onEnterWindow ), NULL, this );
m_treeView->Disconnect( wxEVT_KEY_UP, wxKeyEventHandler( BookmarkPanel::onKeyUp ), NULL, this );
m_treeView->Disconnect( wxEVT_LEAVE_WINDOW, wxMouseEventHandler( BookmarkPanel::onLeaveWindow ), NULL, this );
m_treeView->Disconnect( wxEVT_MOTION, wxMouseEventHandler( BookmarkPanel::onMotion ), NULL, this );
m_treeView->Disconnect( wxEVT_COMMAND_TREE_BEGIN_DRAG, wxTreeEventHandler( BookmarkPanel::onTreeBeginDrag ), NULL, this );
Expand Down
31 changes: 16 additions & 15 deletions src/forms/Bookmark/BookmarkPanel.fbp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<property name="ui_table">UI</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1">
<object class="Panel" expanded="0">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
Expand All @@ -52,16 +52,16 @@
<event name="OnEnterWindow">onEnterWindow</event>
<event name="OnLeaveWindow">onLeaveWindow</event>
<event name="OnMotion">onMotion</event>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">bSizer1</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
Expand Down Expand Up @@ -123,11 +123,11 @@
<event name="OnText">onSearchText</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
Expand Down Expand Up @@ -196,11 +196,11 @@
<event name="OnButtonClick">onClearSearch</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxTreeCtrl" expanded="1">
<object class="wxTreeCtrl" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
Expand Down Expand Up @@ -253,6 +253,7 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnEnterWindow">onEnterWindow</event>
<event name="OnKeyUp">onKeyUp</event>
<event name="OnLeaveWindow">onLeaveWindow</event>
<event name="OnMotion">onMotion</event>
<event name="OnTreeBeginDrag">onTreeBeginDrag</event>
Expand All @@ -266,11 +267,11 @@
<event name="OnTreeSelChanging">onTreeSelectChanging</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="1">
<object class="wxStaticLine" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
Expand Down Expand Up @@ -324,11 +325,11 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxPanel" expanded="1">
<object class="wxPanel" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
Expand Down Expand Up @@ -888,11 +889,11 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxPanel" expanded="1">
<object class="wxPanel" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
Expand Down Expand Up @@ -952,7 +953,7 @@
</object>
</object>
</object>
<object class="wxTimer" expanded="1">
<object class="wxTimer" expanded="0">
<property name="enabled">0</property>
<property name="id">wxID_ANY</property>
<property name="name">m_updateTimer</property>
Expand Down
1 change: 1 addition & 0 deletions src/forms/Bookmark/BookmarkPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class BookmarkPanel : public wxPanel
virtual void onSearchTextFocus( wxMouseEvent& event ) { event.Skip(); }
virtual void onSearchText( wxCommandEvent& event ) { event.Skip(); }
virtual void onClearSearch( wxCommandEvent& event ) { event.Skip(); }
virtual void onKeyUp( wxKeyEvent& event ) { event.Skip(); }
virtual void onTreeBeginDrag( wxTreeEvent& event ) { event.Skip(); }
virtual void onTreeEndDrag( wxTreeEvent& event ) { event.Skip(); }
virtual void onTreeActivate( wxTreeEvent& event ) { event.Skip(); }
Expand Down
Loading