mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-07-31 12:52:25 -04:00
Cleanup: bookmark mgr
This commit is contained in:
parent
4605eaccf0
commit
296f7790f1
@ -5,7 +5,6 @@
|
|||||||
#include <wx/textdlg.h>
|
#include <wx/textdlg.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <wchar.h>
|
|
||||||
|
|
||||||
#include "BookmarkView.h"
|
#include "BookmarkView.h"
|
||||||
#include "CubicSDR.h"
|
#include "CubicSDR.h"
|
||||||
@ -25,10 +24,10 @@
|
|||||||
#define BOOKMARK_VIEW_STR_RENAME_GROUP "Rename Group"
|
#define BOOKMARK_VIEW_STR_RENAME_GROUP "Rename Group"
|
||||||
|
|
||||||
|
|
||||||
BookmarkViewVisualDragItem::BookmarkViewVisualDragItem(wxString labelValue) : wxDialog(NULL, wxID_ANY, L"", wxPoint(20,20), wxSize(-1,-1), wxFRAME_TOOL_WINDOW | wxNO_BORDER | wxSTAY_ON_TOP | wxALL ) {
|
BookmarkViewVisualDragItem::BookmarkViewVisualDragItem(const wxString& labelValue) : wxDialog(nullptr, wxID_ANY, L"", wxPoint(20,20), wxSize(-1,-1), wxFRAME_TOOL_WINDOW | wxNO_BORDER | wxSTAY_ON_TOP | wxALL ) {
|
||||||
|
|
||||||
wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
|
auto *sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
wxStaticText *label = new wxStaticText( this, wxID_ANY, labelValue, wxDefaultPosition, wxDefaultSize, wxEXPAND );
|
auto *label = new wxStaticText( this, wxID_ANY, labelValue, wxDefaultPosition, wxDefaultSize, wxEXPAND );
|
||||||
|
|
||||||
sizer->Add(label, 1, wxALL | wxEXPAND, 5);
|
sizer->Add(label, 1, wxALL | wxEXPAND, 5);
|
||||||
|
|
||||||
@ -38,12 +37,12 @@ BookmarkViewVisualDragItem::BookmarkViewVisualDragItem(wxString labelValue) : wx
|
|||||||
|
|
||||||
class ActionDialogRemoveBookmark : public ActionDialog {
|
class ActionDialogRemoveBookmark : public ActionDialog {
|
||||||
public:
|
public:
|
||||||
ActionDialogRemoveBookmark( BookmarkEntryPtr be ) : ActionDialog(wxGetApp().getAppFrame(), wxID_ANY, wxT("Remove Bookmark?")) {
|
explicit ActionDialogRemoveBookmark( BookmarkEntryPtr be ) : ActionDialog(wxGetApp().getAppFrame(), wxID_ANY, wxT("Remove Bookmark?")) {
|
||||||
subject = be;
|
subject = be;
|
||||||
m_questionText->SetLabelText(wxT("Are you sure you want to remove the bookmark\n '" + BookmarkMgr::getBookmarkEntryDisplayName(subject) + "'?"));
|
m_questionText->SetLabelText(wxT("Are you sure you want to remove the bookmark\n '" + BookmarkMgr::getBookmarkEntryDisplayName(subject) + "'?"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void doClickOK() {
|
void doClickOK() override {
|
||||||
wxGetApp().getBookmarkMgr().removeBookmark(subject);
|
wxGetApp().getBookmarkMgr().removeBookmark(subject);
|
||||||
wxGetApp().getBookmarkMgr().updateBookmarks();
|
wxGetApp().getBookmarkMgr().updateBookmarks();
|
||||||
}
|
}
|
||||||
@ -54,12 +53,12 @@ private:
|
|||||||
|
|
||||||
class ActionDialogRemoveGroup : public ActionDialog {
|
class ActionDialogRemoveGroup : public ActionDialog {
|
||||||
public:
|
public:
|
||||||
ActionDialogRemoveGroup( std::string groupName ) : ActionDialog(wxGetApp().getAppFrame(), wxID_ANY, wxT("Remove Group?")) {
|
explicit ActionDialogRemoveGroup( std::string groupName ) : ActionDialog(wxGetApp().getAppFrame(), wxID_ANY, wxT("Remove Group?")) {
|
||||||
subject = groupName;
|
subject = groupName;
|
||||||
m_questionText->SetLabelText(wxT("Warning: Are you sure you want to remove the group\n '" + subject + "' AND ALL BOOKMARKS WITHIN IT?"));
|
m_questionText->SetLabelText(wxT("Warning: Are you sure you want to remove the group\n '" + subject + "' AND ALL BOOKMARKS WITHIN IT?"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void doClickOK() {
|
void doClickOK() override {
|
||||||
wxGetApp().getBookmarkMgr().removeGroup(subject);
|
wxGetApp().getBookmarkMgr().removeGroup(subject);
|
||||||
wxGetApp().getBookmarkMgr().updateBookmarks();
|
wxGetApp().getBookmarkMgr().updateBookmarks();
|
||||||
}
|
}
|
||||||
@ -71,7 +70,7 @@ private:
|
|||||||
|
|
||||||
class ActionDialogRemoveRange : public ActionDialog {
|
class ActionDialogRemoveRange : public ActionDialog {
|
||||||
public:
|
public:
|
||||||
ActionDialogRemoveRange( BookmarkRangeEntryPtr rangeEnt ) : ActionDialog(wxGetApp().getAppFrame(), wxID_ANY, wxT("Remove Range?")) {
|
explicit ActionDialogRemoveRange( const BookmarkRangeEntryPtr& rangeEnt ) : ActionDialog(wxGetApp().getAppFrame(), wxID_ANY, wxT("Remove Range?")) {
|
||||||
subject = rangeEnt;
|
subject = rangeEnt;
|
||||||
|
|
||||||
std::wstring name = rangeEnt->label;
|
std::wstring name = rangeEnt->label;
|
||||||
@ -85,7 +84,7 @@ public:
|
|||||||
m_questionText->SetLabelText(L"Are you sure you want to remove the range\n '" + name + L"'?");
|
m_questionText->SetLabelText(L"Are you sure you want to remove the range\n '" + name + L"'?");
|
||||||
}
|
}
|
||||||
|
|
||||||
void doClickOK() {
|
void doClickOK() override {
|
||||||
wxGetApp().getBookmarkMgr().removeRange(subject);
|
wxGetApp().getBookmarkMgr().removeRange(subject);
|
||||||
wxGetApp().getBookmarkMgr().updateActiveList();
|
wxGetApp().getBookmarkMgr().updateActiveList();
|
||||||
}
|
}
|
||||||
@ -97,7 +96,7 @@ private:
|
|||||||
|
|
||||||
class ActionDialogUpdateRange : public ActionDialog {
|
class ActionDialogUpdateRange : public ActionDialog {
|
||||||
public:
|
public:
|
||||||
ActionDialogUpdateRange( BookmarkRangeEntryPtr rangeEnt ) : ActionDialog(wxGetApp().getAppFrame(), wxID_ANY, wxT("Update Range?")) {
|
explicit ActionDialogUpdateRange( const BookmarkRangeEntryPtr& rangeEnt ) : ActionDialog(wxGetApp().getAppFrame(), wxID_ANY, wxT("Update Range?")) {
|
||||||
subject = rangeEnt;
|
subject = rangeEnt;
|
||||||
|
|
||||||
std::wstring name = rangeEnt->label;
|
std::wstring name = rangeEnt->label;
|
||||||
@ -111,7 +110,7 @@ public:
|
|||||||
m_questionText->SetLabelText(L"Are you sure you want to update the range\n '" + name + L"' to the active range?");
|
m_questionText->SetLabelText(L"Are you sure you want to update the range\n '" + name + L"' to the active range?");
|
||||||
}
|
}
|
||||||
|
|
||||||
void doClickOK() {
|
void doClickOK() override {
|
||||||
BookmarkRangeEntryPtr ue = BookmarkView::makeActiveRangeEntry();
|
BookmarkRangeEntryPtr ue = BookmarkView::makeActiveRangeEntry();
|
||||||
|
|
||||||
subject->freq = ue->freq;
|
subject->freq = ue->freq;
|
||||||
@ -232,7 +231,7 @@ void BookmarkView::updateBookmarks() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BookmarkView::updateBookmarks(std::string group) {
|
void BookmarkView::updateBookmarks(const std::string& group) {
|
||||||
doUpdateBookmarkGroup.insert(group);
|
doUpdateBookmarkGroup.insert(group);
|
||||||
doUpdateBookmarks.store(true);
|
doUpdateBookmarks.store(true);
|
||||||
}
|
}
|
||||||
@ -241,7 +240,7 @@ bool BookmarkView::isKeywordMatch(std::wstring search_str, std::vector<std::wstr
|
|||||||
wstring str = search_str;
|
wstring str = search_str;
|
||||||
std::transform(str.begin(), str.end(), str.begin(), towlower);
|
std::transform(str.begin(), str.end(), str.begin(), towlower);
|
||||||
|
|
||||||
for (auto k : keywords) {
|
for (const auto& k : keywords) {
|
||||||
if (str.find(k) == wstring::npos) {
|
if (str.find(k) == wstring::npos) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -257,19 +256,19 @@ wxTreeItemId BookmarkView::refreshBookmarks() {
|
|||||||
TreeViewItem* prevSel = itemToTVI(m_treeView->GetSelection());
|
TreeViewItem* prevSel = itemToTVI(m_treeView->GetSelection());
|
||||||
TreeViewItem* prevSelCopy = nullptr;
|
TreeViewItem* prevSelCopy = nullptr;
|
||||||
|
|
||||||
if (prevSel != NULL) {
|
if (prevSel != nullptr) {
|
||||||
prevSelCopy = new TreeViewItem(*prevSel);
|
prevSelCopy = new TreeViewItem(*prevSel);
|
||||||
}
|
}
|
||||||
|
|
||||||
BookmarkNames groupNames;
|
BookmarkNames groupNameList;
|
||||||
wxGetApp().getBookmarkMgr().getGroups(groupNames);
|
wxGetApp().getBookmarkMgr().getGroups(groupNameList);
|
||||||
|
|
||||||
doUpdateBookmarkGroup.clear();
|
doUpdateBookmarkGroup.clear();
|
||||||
|
|
||||||
wxTreeItemId bmSelFound = nullptr;
|
wxTreeItemId bmSelFound = nullptr;
|
||||||
|
|
||||||
std::map<std::string, bool> groupExpandState;
|
std::map<std::string, bool> groupExpandState;
|
||||||
bool searchState = (searchKeywords.size() != 0);
|
bool searchState = !searchKeywords.empty();
|
||||||
|
|
||||||
groups.clear();
|
groups.clear();
|
||||||
|
|
||||||
@ -277,8 +276,8 @@ wxTreeItemId BookmarkView::refreshBookmarks() {
|
|||||||
|
|
||||||
bool bmExpandState = expandState["bookmark"];
|
bool bmExpandState = expandState["bookmark"];
|
||||||
|
|
||||||
for (auto gn_i : groupNames) {
|
for (const auto& gn_i : groupNameList) {
|
||||||
TreeViewItem* tvi = new TreeViewItem();
|
auto* tvi = new TreeViewItem();
|
||||||
tvi->type = TreeViewItem::TREEVIEW_ITEM_TYPE_GROUP;
|
tvi->type = TreeViewItem::TREEVIEW_ITEM_TYPE_GROUP;
|
||||||
tvi->groupName = gn_i;
|
tvi->groupName = gn_i;
|
||||||
wxTreeItemId group_itm = m_treeView->AppendItem(bookmarkBranch, gn_i);
|
wxTreeItemId group_itm = m_treeView->AppendItem(bookmarkBranch, gn_i);
|
||||||
@ -286,7 +285,7 @@ wxTreeItemId BookmarkView::refreshBookmarks() {
|
|||||||
groups[gn_i] = group_itm;
|
groups[gn_i] = group_itm;
|
||||||
if (prevSelCopy != nullptr && prevSelCopy->type == TreeViewItem::TREEVIEW_ITEM_TYPE_GROUP && gn_i == prevSelCopy->groupName) {
|
if (prevSelCopy != nullptr && prevSelCopy->type == TreeViewItem::TREEVIEW_ITEM_TYPE_GROUP && gn_i == prevSelCopy->groupName) {
|
||||||
bmSelFound = group_itm;
|
bmSelFound = group_itm;
|
||||||
} else if (nextGroup != "" && gn_i == nextGroup) {
|
} else if (!nextGroup.empty() && gn_i == nextGroup) {
|
||||||
bmSelFound = group_itm;
|
bmSelFound = group_itm;
|
||||||
nextGroup = "";
|
nextGroup = "";
|
||||||
}
|
}
|
||||||
@ -298,7 +297,7 @@ wxTreeItemId BookmarkView::refreshBookmarks() {
|
|||||||
m_treeView->Collapse(bookmarkBranch);
|
m_treeView->Collapse(bookmarkBranch);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto gn_i : groupNames) {
|
for (const auto& gn_i : groupNameList) {
|
||||||
wxTreeItemId groupItem = groups[gn_i];
|
wxTreeItemId groupItem = groups[gn_i];
|
||||||
|
|
||||||
bool groupExpanded = searchState || wxGetApp().getBookmarkMgr().getExpandState(gn_i);
|
bool groupExpanded = searchState || wxGetApp().getBookmarkMgr().getExpandState(gn_i);
|
||||||
@ -324,7 +323,7 @@ wxTreeItemId BookmarkView::refreshBookmarks() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeViewItem* tvi = new TreeViewItem();
|
auto* tvi = new TreeViewItem();
|
||||||
tvi->type = TreeViewItem::TREEVIEW_ITEM_TYPE_BOOKMARK;
|
tvi->type = TreeViewItem::TREEVIEW_ITEM_TYPE_BOOKMARK;
|
||||||
tvi->bookmarkEnt = bmEnt;
|
tvi->bookmarkEnt = bmEnt;
|
||||||
tvi->groupName = gn_i;
|
tvi->groupName = gn_i;
|
||||||
@ -361,7 +360,7 @@ void BookmarkView::doUpdateActiveList() {
|
|||||||
TreeViewItem* prevSel = itemToTVI(m_treeView->GetSelection());
|
TreeViewItem* prevSel = itemToTVI(m_treeView->GetSelection());
|
||||||
TreeViewItem* prevSelCopy = nullptr;
|
TreeViewItem* prevSelCopy = nullptr;
|
||||||
|
|
||||||
if (prevSel != NULL) {
|
if (prevSel != nullptr) {
|
||||||
prevSelCopy = new TreeViewItem(*prevSel);
|
prevSelCopy = new TreeViewItem(*prevSel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -369,10 +368,10 @@ void BookmarkView::doUpdateActiveList() {
|
|||||||
m_treeView->DeleteChildren(activeBranch);
|
m_treeView->DeleteChildren(activeBranch);
|
||||||
|
|
||||||
bool activeExpandState = expandState["active"];
|
bool activeExpandState = expandState["active"];
|
||||||
bool searchState = (searchKeywords.size() != 0);
|
bool searchState = !searchKeywords.empty();
|
||||||
|
|
||||||
wxTreeItemId selItem = nullptr;
|
wxTreeItemId selItem = nullptr;
|
||||||
for (auto demod_i : demods) {
|
for (const auto& demod_i : demods) {
|
||||||
wxString activeLabel = BookmarkMgr::getActiveDisplayName(demod_i);
|
wxString activeLabel = BookmarkMgr::getActiveDisplayName(demod_i);
|
||||||
|
|
||||||
if (searchState) {
|
if (searchState) {
|
||||||
@ -392,7 +391,7 @@ void BookmarkView::doUpdateActiveList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeViewItem* tvi = new TreeViewItem();
|
auto* tvi = new TreeViewItem();
|
||||||
tvi->type = TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE;
|
tvi->type = TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE;
|
||||||
tvi->demod = demod_i;
|
tvi->demod = demod_i;
|
||||||
|
|
||||||
@ -407,7 +406,7 @@ void BookmarkView::doUpdateActiveList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rangeExpandState = searchState?false:expandState["range"];
|
bool rangeExpandState = !searchState && expandState["range"];
|
||||||
|
|
||||||
//Ranges
|
//Ranges
|
||||||
BookmarkRangeList bmRanges = wxGetApp().getBookmarkMgr().getRanges();
|
BookmarkRangeList bmRanges = wxGetApp().getBookmarkMgr().getRanges();
|
||||||
@ -415,13 +414,13 @@ void BookmarkView::doUpdateActiveList() {
|
|||||||
m_treeView->DeleteChildren(rangeBranch);
|
m_treeView->DeleteChildren(rangeBranch);
|
||||||
|
|
||||||
for (auto &re_i: bmRanges) {
|
for (auto &re_i: bmRanges) {
|
||||||
TreeViewItem* tvi = new TreeViewItem();
|
auto* tvi = new TreeViewItem();
|
||||||
tvi->type = TreeViewItem::TREEVIEW_ITEM_TYPE_RANGE;
|
tvi->type = TreeViewItem::TREEVIEW_ITEM_TYPE_RANGE;
|
||||||
tvi->rangeEnt = re_i;
|
tvi->rangeEnt = re_i;
|
||||||
|
|
||||||
std::wstring labelVal = re_i->label;
|
std::wstring labelVal = re_i->label;
|
||||||
|
|
||||||
if (labelVal == L"") {
|
if (labelVal.empty()) {
|
||||||
std::string wstr = frequencyToStr(re_i->startFreq) + " - " + frequencyToStr(re_i->endFreq);
|
std::string wstr = frequencyToStr(re_i->startFreq) + " - " + frequencyToStr(re_i->endFreq);
|
||||||
|
|
||||||
labelVal = wxString(wstr).ToStdWstring();
|
labelVal = wxString(wstr).ToStdWstring();
|
||||||
@ -446,20 +445,20 @@ void BookmarkView::doUpdateActiveList() {
|
|||||||
m_treeView->DeleteChildren(recentBranch);
|
m_treeView->DeleteChildren(recentBranch);
|
||||||
|
|
||||||
for (auto &bmr_i: bmRecents) {
|
for (auto &bmr_i: bmRecents) {
|
||||||
TreeViewItem* tvi = new TreeViewItem();
|
auto* tvi = new TreeViewItem();
|
||||||
tvi->type = TreeViewItem::TREEVIEW_ITEM_TYPE_RECENT;
|
tvi->type = TreeViewItem::TREEVIEW_ITEM_TYPE_RECENT;
|
||||||
tvi->bookmarkEnt = bmr_i;
|
tvi->bookmarkEnt = bmr_i;
|
||||||
|
|
||||||
std::wstring labelVal;
|
std::wstring labelVal;
|
||||||
bmr_i->node->child("user_label")->element()->get(labelVal);
|
bmr_i->node->child("user_label")->element()->get(labelVal);
|
||||||
|
|
||||||
if (labelVal == L"") {
|
if (labelVal.empty()) {
|
||||||
std::string str = frequencyToStr(bmr_i->frequency) + " " + bmr_i->type;
|
std::string str = frequencyToStr(bmr_i->frequency) + " " + bmr_i->type;
|
||||||
|
|
||||||
labelVal = wxString(str).ToStdWstring();
|
labelVal = wxString(str).ToStdWstring();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (searchKeywords.size()) {
|
if (!searchKeywords.empty()) {
|
||||||
|
|
||||||
std::string freqStr = frequencyToStr(bmr_i->frequency);
|
std::string freqStr = frequencyToStr(bmr_i->frequency);
|
||||||
std::string bwStr = frequencyToStr(bmr_i->bandwidth);
|
std::string bwStr = frequencyToStr(bmr_i->bandwidth);
|
||||||
@ -559,7 +558,7 @@ void BookmarkView::onKeyUp( wxKeyEvent& event ) {
|
|||||||
void BookmarkView::onTreeActivate( wxTreeEvent& event ) {
|
void BookmarkView::onTreeActivate( wxTreeEvent& event ) {
|
||||||
|
|
||||||
wxTreeItemId itm = event.GetItem();
|
wxTreeItemId itm = event.GetItem();
|
||||||
TreeViewItem* tvi = dynamic_cast<TreeViewItem*>(m_treeView->GetItemData(itm));
|
auto* tvi = dynamic_cast<TreeViewItem*>(m_treeView->GetItemData(itm));
|
||||||
|
|
||||||
if (tvi == nullptr) {
|
if (tvi == nullptr) {
|
||||||
event.Skip();
|
event.Skip();
|
||||||
@ -588,7 +587,7 @@ void BookmarkView::onTreeActivate( wxTreeEvent& event ) {
|
|||||||
|
|
||||||
void BookmarkView::onTreeCollapse( wxTreeEvent& event ) {
|
void BookmarkView::onTreeCollapse( wxTreeEvent& event ) {
|
||||||
|
|
||||||
bool searchState = (searchKeywords.size() != 0);
|
bool searchState = !searchKeywords.empty();
|
||||||
|
|
||||||
if (searchState) {
|
if (searchState) {
|
||||||
event.Skip();
|
event.Skip();
|
||||||
@ -618,7 +617,7 @@ void BookmarkView::onTreeCollapse( wxTreeEvent& event ) {
|
|||||||
|
|
||||||
void BookmarkView::onTreeExpanded( wxTreeEvent& event ) {
|
void BookmarkView::onTreeExpanded( wxTreeEvent& event ) {
|
||||||
|
|
||||||
bool searchState = (searchKeywords.size() != 0);
|
bool searchState = !searchKeywords.empty();
|
||||||
|
|
||||||
if (searchState) {
|
if (searchState) {
|
||||||
event.Skip();
|
event.Skip();
|
||||||
@ -651,7 +650,7 @@ void BookmarkView::onTreeItemMenu( wxTreeEvent& /* event */ ) {
|
|||||||
if (m_treeView->GetSelection() == bookmarkBranch) {
|
if (m_treeView->GetSelection() == bookmarkBranch) {
|
||||||
wxMenu menu;
|
wxMenu menu;
|
||||||
menu.Append(wxCONTEXT_ADD_GROUP_ID, BOOKMARK_VIEW_STR_ADD_GROUP);
|
menu.Append(wxCONTEXT_ADD_GROUP_ID, BOOKMARK_VIEW_STR_ADD_GROUP);
|
||||||
menu.Connect(wxCONTEXT_ADD_GROUP_ID, wxEVT_MENU, (wxObjectEventFunction)&BookmarkView::onMenuItem, nullptr, this);
|
menu.Connect(wxCONTEXT_ADD_GROUP_ID, wxEVT_MENU, wxCommandEventHandler(BookmarkView::onMenuItem), nullptr, this);
|
||||||
PopupMenu(&menu);
|
PopupMenu(&menu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -676,12 +675,12 @@ bool BookmarkView::isMouseInView() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool BookmarkView::getExpandState(std::string branchName) {
|
bool BookmarkView::getExpandState(const std::string& branchName) {
|
||||||
return expandState[branchName];
|
return expandState[branchName];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BookmarkView::setExpandState(std::string branchName, bool state) {
|
void BookmarkView::setExpandState(const std::string& branchName, bool state) {
|
||||||
expandState[branchName] = state;
|
expandState[branchName] = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -741,29 +740,29 @@ void BookmarkView::refreshLayout() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wxButton *BookmarkView::makeButton(wxWindow * /* parent */, std::string labelVal, wxObjectEventFunction handler) {
|
wxButton *BookmarkView::makeButton(wxWindow * /* parent */, const std::string& labelVal, wxObjectEventFunction handler) {
|
||||||
wxButton *nButton = new wxButton( m_buttonPanel, wxID_ANY, labelVal);
|
auto *nButton = new wxButton( m_buttonPanel, wxID_ANY, labelVal);
|
||||||
nButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, handler, nullptr, this);
|
nButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, handler, nullptr, this);
|
||||||
|
|
||||||
return nButton;
|
return nButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wxButton *BookmarkView::addButton(wxWindow *parent, std::string labelVal, wxObjectEventFunction handler) {
|
wxButton *BookmarkView::addButton(wxWindow *parent, const std::string& labelVal, wxObjectEventFunction handler) {
|
||||||
wxButton *nButton = makeButton(parent, labelVal, handler);
|
wxButton *nButton = makeButton(parent, labelVal, handler);
|
||||||
parent->GetSizer()->Add( nButton, 0, wxEXPAND);
|
parent->GetSizer()->Add( nButton, 0, wxEXPAND);
|
||||||
return nButton;
|
return nButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BookmarkView::doBookmarkActive(std::string group, DemodulatorInstancePtr demod) {
|
void BookmarkView::doBookmarkActive(const std::string& group, const DemodulatorInstancePtr& demod) {
|
||||||
|
|
||||||
wxGetApp().getBookmarkMgr().addBookmark(group, demod);
|
wxGetApp().getBookmarkMgr().addBookmark(group, demod);
|
||||||
wxGetApp().getBookmarkMgr().updateBookmarks();
|
wxGetApp().getBookmarkMgr().updateBookmarks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BookmarkView::doBookmarkRecent(std::string group, BookmarkEntryPtr be) {
|
void BookmarkView::doBookmarkRecent(const std::string& group, const BookmarkEntryPtr& be) {
|
||||||
|
|
||||||
wxGetApp().getBookmarkMgr().addBookmark(group, be);
|
wxGetApp().getBookmarkMgr().addBookmark(group, be);
|
||||||
nextEnt = be;
|
nextEnt = be;
|
||||||
@ -773,7 +772,7 @@ void BookmarkView::doBookmarkRecent(std::string group, BookmarkEntryPtr be) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BookmarkView::doMoveBookmark(BookmarkEntryPtr be, std::string group) {
|
void BookmarkView::doMoveBookmark(const BookmarkEntryPtr& be, const std::string& group) {
|
||||||
wxGetApp().getBookmarkMgr().moveBookmark(be, group);
|
wxGetApp().getBookmarkMgr().moveBookmark(be, group);
|
||||||
nextEnt = be;
|
nextEnt = be;
|
||||||
wxGetApp().getBookmarkMgr().updateBookmarks();
|
wxGetApp().getBookmarkMgr().updateBookmarks();
|
||||||
@ -781,14 +780,14 @@ void BookmarkView::doMoveBookmark(BookmarkEntryPtr be, std::string group) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BookmarkView::doRemoveActive(DemodulatorInstancePtr demod) {
|
void BookmarkView::doRemoveActive(const DemodulatorInstancePtr& demod) {
|
||||||
|
|
||||||
wxGetApp().getBookmarkMgr().removeActive(demod);
|
wxGetApp().getBookmarkMgr().removeActive(demod);
|
||||||
wxGetApp().getBookmarkMgr().updateActiveList();
|
wxGetApp().getBookmarkMgr().updateActiveList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BookmarkView::doRemoveRecent(BookmarkEntryPtr be) {
|
void BookmarkView::doRemoveRecent(const BookmarkEntryPtr& be) {
|
||||||
wxGetApp().getBookmarkMgr().removeRecent(be);
|
wxGetApp().getBookmarkMgr().removeRecent(be);
|
||||||
wxGetApp().getBookmarkMgr().updateActiveList();
|
wxGetApp().getBookmarkMgr().updateActiveList();
|
||||||
}
|
}
|
||||||
@ -814,7 +813,7 @@ void BookmarkView::addBookmarkChoice(wxWindow *parent) {
|
|||||||
updateBookmarkChoices();
|
updateBookmarkChoices();
|
||||||
bookmarkChoice = new wxChoice(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, bookmarkChoices, wxEXPAND, wxDefaultValidator, "Bookmark");
|
bookmarkChoice = new wxChoice(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, bookmarkChoices, wxEXPAND, wxDefaultValidator, "Bookmark");
|
||||||
bookmarkChoice->Select(0);
|
bookmarkChoice->Select(0);
|
||||||
bookmarkChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction)&BookmarkView::onBookmarkChoice, nullptr, this);
|
bookmarkChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(BookmarkView::onBookmarkChoice), nullptr, this);
|
||||||
parent->GetSizer()->Add(bookmarkChoice, 0, wxALL | wxEXPAND);
|
parent->GetSizer()->Add(bookmarkChoice, 0, wxALL | wxEXPAND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -838,7 +837,7 @@ void BookmarkView::onBookmarkChoice( wxCommandEvent & /* event */ ) {
|
|||||||
stringVal = bookmarkChoices[sel];
|
stringVal = bookmarkChoices[sel];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stringVal == "") {
|
if (stringVal.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -855,7 +854,7 @@ void BookmarkView::onBookmarkChoice( wxCommandEvent & /* event */ ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookmarkView::activeSelection(DemodulatorInstancePtr dsel) {
|
void BookmarkView::activeSelection(const DemodulatorInstancePtr& dsel) {
|
||||||
|
|
||||||
if (dsel == nullptr) {
|
if (dsel == nullptr) {
|
||||||
hideProps();
|
hideProps();
|
||||||
@ -901,7 +900,7 @@ void BookmarkView::activeSelection(DemodulatorInstancePtr dsel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BookmarkView::activateBookmark(BookmarkEntryPtr bmEnt) {
|
void BookmarkView::activateBookmark(const BookmarkEntryPtr& bmEnt) {
|
||||||
|
|
||||||
wxTreeItemId selItem = m_treeView->GetSelection();
|
wxTreeItemId selItem = m_treeView->GetSelection();
|
||||||
if (selItem) {
|
if (selItem) {
|
||||||
@ -942,7 +941,7 @@ void BookmarkView::activateBookmark(BookmarkEntryPtr bmEnt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BookmarkView::activateRange(BookmarkRangeEntryPtr rangeEnt) {
|
void BookmarkView::activateRange(const BookmarkRangeEntryPtr& rangeEnt) {
|
||||||
|
|
||||||
//the following oly works if rangeEnt->freq is the middle of [rangeEnt->startFreq ; rangeEnt->startFreq]
|
//the following oly works if rangeEnt->freq is the middle of [rangeEnt->startFreq ; rangeEnt->startFreq]
|
||||||
wxGetApp().setFrequency(rangeEnt->freq);
|
wxGetApp().setFrequency(rangeEnt->freq);
|
||||||
@ -952,7 +951,7 @@ void BookmarkView::activateRange(BookmarkRangeEntryPtr rangeEnt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BookmarkView::bookmarkSelection(BookmarkEntryPtr bmSel) {
|
void BookmarkView::bookmarkSelection(const BookmarkEntryPtr& bmSel) {
|
||||||
|
|
||||||
m_frequencyVal->SetLabelText(frequencyToStr(bmSel->frequency));
|
m_frequencyVal->SetLabelText(frequencyToStr(bmSel->frequency));
|
||||||
m_bandwidthVal->SetLabelText(frequencyToStr(bmSel->bandwidth));
|
m_bandwidthVal->SetLabelText(frequencyToStr(bmSel->bandwidth));
|
||||||
@ -985,7 +984,7 @@ void BookmarkView::bookmarkSelection(BookmarkEntryPtr bmSel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BookmarkView::recentSelection(BookmarkEntryPtr bmSel) {
|
void BookmarkView::recentSelection(const BookmarkEntryPtr& bmSel) {
|
||||||
|
|
||||||
m_frequencyVal->SetLabelText(frequencyToStr(bmSel->frequency));
|
m_frequencyVal->SetLabelText(frequencyToStr(bmSel->frequency));
|
||||||
m_bandwidthVal->SetLabelText(frequencyToStr(bmSel->bandwidth));
|
m_bandwidthVal->SetLabelText(frequencyToStr(bmSel->bandwidth));
|
||||||
@ -1017,7 +1016,7 @@ void BookmarkView::recentSelection(BookmarkEntryPtr bmSel) {
|
|||||||
refreshLayout();
|
refreshLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookmarkView::groupSelection(std::string groupName) {
|
void BookmarkView::groupSelection(const std::string& groupName) {
|
||||||
|
|
||||||
clearButtons();
|
clearButtons();
|
||||||
|
|
||||||
@ -1037,7 +1036,7 @@ void BookmarkView::groupSelection(std::string groupName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BookmarkView::rangeSelection(BookmarkRangeEntryPtr re) {
|
void BookmarkView::rangeSelection(const BookmarkRangeEntryPtr& re) {
|
||||||
|
|
||||||
clearButtons();
|
clearButtons();
|
||||||
hideProps(false);
|
hideProps(false);
|
||||||
@ -1118,7 +1117,7 @@ void BookmarkView::onTreeSelect( wxTreeEvent& event ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxTreeItemId itm = event.GetItem();
|
wxTreeItemId itm = event.GetItem();
|
||||||
TreeViewItem* tvi = dynamic_cast<TreeViewItem*>(m_treeView->GetItemData(itm));
|
auto* tvi = dynamic_cast<TreeViewItem*>(m_treeView->GetItemData(itm));
|
||||||
|
|
||||||
if (!tvi) {
|
if (!tvi) {
|
||||||
|
|
||||||
@ -1196,7 +1195,7 @@ void BookmarkView::onLabelText( wxCommandEvent& /* event */ ) {
|
|||||||
} else if (curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_GROUP) {
|
} else if (curSel->type == TreeViewItem::TREEVIEW_ITEM_TYPE_GROUP) {
|
||||||
std::string newGroupName = m_labelText->GetValue().ToStdString();
|
std::string newGroupName = m_labelText->GetValue().ToStdString();
|
||||||
|
|
||||||
if (newGroupName != "" && newGroupName != curSel->groupName) {
|
if (!newGroupName.empty() && newGroupName != curSel->groupName) {
|
||||||
wxGetApp().getBookmarkMgr().renameGroup(curSel->groupName, newGroupName);
|
wxGetApp().getBookmarkMgr().renameGroup(curSel->groupName, newGroupName);
|
||||||
nextGroup = newGroupName;
|
nextGroup = newGroupName;
|
||||||
wxGetApp().getBookmarkMgr().updateBookmarks();
|
wxGetApp().getBookmarkMgr().updateBookmarks();
|
||||||
@ -1313,8 +1312,7 @@ void BookmarkView::onRemoveRecent ( wxCommandEvent& /* event */ ) {
|
|||||||
|
|
||||||
//let removeRecent() + updateActiveList() refresh the tree
|
//let removeRecent() + updateActiveList() refresh the tree
|
||||||
//and delete the recent node properly...
|
//and delete the recent node properly...
|
||||||
wxGetApp().getBookmarkMgr().removeRecent(bookmarkEntToRemove);
|
doRemoveRecent(bookmarkEntToRemove);
|
||||||
wxGetApp().getBookmarkMgr().updateActiveList();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1326,7 +1324,7 @@ void BookmarkView::onClearRecents ( wxCommandEvent& /* event */ ) {
|
|||||||
void BookmarkView::onAddGroup( wxCommandEvent& /* event */ ) {
|
void BookmarkView::onAddGroup( wxCommandEvent& /* event */ ) {
|
||||||
|
|
||||||
wxString stringVal = wxGetTextFromUser(BOOKMARK_VIEW_STR_ADD_GROUP_DESC, BOOKMARK_VIEW_STR_ADD_GROUP, "");
|
wxString stringVal = wxGetTextFromUser(BOOKMARK_VIEW_STR_ADD_GROUP_DESC, BOOKMARK_VIEW_STR_ADD_GROUP, "");
|
||||||
if (stringVal.ToStdString() != "") {
|
if (!stringVal.ToStdString().empty()) {
|
||||||
wxGetApp().getBookmarkMgr().addGroup(stringVal.ToStdString());
|
wxGetApp().getBookmarkMgr().addGroup(stringVal.ToStdString());
|
||||||
wxGetApp().getBookmarkMgr().updateBookmarks();
|
wxGetApp().getBookmarkMgr().updateBookmarks();
|
||||||
}
|
}
|
||||||
@ -1375,7 +1373,7 @@ void BookmarkView::onRenameRange( wxCommandEvent& /* event */ ) {
|
|||||||
|
|
||||||
std::string newGroupName = stringVal.Trim().ToStdString();
|
std::string newGroupName = stringVal.Trim().ToStdString();
|
||||||
|
|
||||||
if (newGroupName != "") {
|
if (!newGroupName.empty()) {
|
||||||
wxGetApp().getBookmarkMgr().renameGroup(curSel->groupName, newGroupName);
|
wxGetApp().getBookmarkMgr().renameGroup(curSel->groupName, newGroupName);
|
||||||
wxGetApp().getBookmarkMgr().updateBookmarks();
|
wxGetApp().getBookmarkMgr().updateBookmarks();
|
||||||
}
|
}
|
||||||
@ -1481,7 +1479,7 @@ void BookmarkView::onTreeEndDrag( wxTreeEvent& event ) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_GROUP) {
|
if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_GROUP || tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_BOOKMARK) {
|
||||||
if (dragItem && dragItem->type == TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE) { // Active -> Group Item
|
if (dragItem && dragItem->type == TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE) { // Active -> Group Item
|
||||||
doBookmarkActive(tvi->groupName, dragItem->demod);
|
doBookmarkActive(tvi->groupName, dragItem->demod);
|
||||||
} else if (dragItem && dragItem->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RECENT) { // Recent -> Group Item
|
} else if (dragItem && dragItem->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RECENT) { // Recent -> Group Item
|
||||||
@ -1490,15 +1488,6 @@ void BookmarkView::onTreeEndDrag( wxTreeEvent& event ) {
|
|||||||
} else if (dragItem && dragItem->type == TreeViewItem::TREEVIEW_ITEM_TYPE_BOOKMARK) { // Bookmark -> Group Item
|
} else if (dragItem && dragItem->type == TreeViewItem::TREEVIEW_ITEM_TYPE_BOOKMARK) { // Bookmark -> Group Item
|
||||||
doMoveBookmark(dragItem->bookmarkEnt, tvi->groupName);
|
doMoveBookmark(dragItem->bookmarkEnt, tvi->groupName);
|
||||||
}
|
}
|
||||||
} else if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_BOOKMARK) {
|
|
||||||
if (dragItem && dragItem->type == TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE) { // Active -> Same Group
|
|
||||||
doBookmarkActive(tvi->groupName, dragItem->demod);
|
|
||||||
} else if (dragItem && dragItem->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RECENT) { // Recent -> Same Group
|
|
||||||
doBookmarkRecent(tvi->groupName, dragItem->bookmarkEnt);
|
|
||||||
m_treeView->Delete(dragItemId);
|
|
||||||
} else if (dragItem && dragItem->type == TreeViewItem::TREEVIEW_ITEM_TYPE_BOOKMARK) { // Bookmark -> Same Group
|
|
||||||
doMoveBookmark(dragItem->bookmarkEnt, tvi->groupName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1541,7 +1530,7 @@ void BookmarkView::onMotion( wxMouseEvent& event ) {
|
|||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookmarkView::setStatusText(std::string statusText) {
|
void BookmarkView::setStatusText(const std::string& statusText) {
|
||||||
//make tooltips active on the tree view.
|
//make tooltips active on the tree view.
|
||||||
wxGetApp().getAppFrame()->setStatusText(m_treeView, statusText);
|
wxGetApp().getAppFrame()->setStatusText(m_treeView, statusText);
|
||||||
}
|
}
|
||||||
@ -1599,10 +1588,10 @@ void BookmarkView::onSearchText( wxCommandEvent& /* event */ ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (searchKeywords.size() != 0 && !m_clearSearchButton->IsShown()) {
|
if (!searchKeywords.empty() && !m_clearSearchButton->IsShown()) {
|
||||||
m_clearSearchButton->Show();
|
m_clearSearchButton->Show();
|
||||||
refreshLayout();
|
refreshLayout();
|
||||||
} else if (searchKeywords.size() == 0 && m_clearSearchButton->IsShown()) {
|
} else if (searchKeywords.empty() && m_clearSearchButton->IsShown()) {
|
||||||
m_clearSearchButton->Hide();
|
m_clearSearchButton->Hide();
|
||||||
refreshLayout();
|
refreshLayout();
|
||||||
}
|
}
|
||||||
@ -1641,10 +1630,8 @@ BookmarkRangeEntryPtr BookmarkView::makeActiveRangeEntry() {
|
|||||||
void BookmarkView::SetTreeItemData(const wxTreeItemId& item, wxTreeItemData *data) {
|
void BookmarkView::SetTreeItemData(const wxTreeItemId& item, wxTreeItemData *data) {
|
||||||
|
|
||||||
TreeViewItem *itemData = itemToTVI(item);
|
TreeViewItem *itemData = itemToTVI(item);
|
||||||
if (itemData != NULL) {
|
// cleanup previous data, if any
|
||||||
//cleanup previous data, if any
|
delete itemData;
|
||||||
delete itemData;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_treeView->SetItemData(item, data);
|
m_treeView->SetItemData(item, data);
|
||||||
}
|
}
|
||||||
|
@ -34,9 +34,7 @@ public:
|
|||||||
groupName = src.groupName;
|
groupName = src.groupName;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual ~TreeViewItem() {
|
~TreeViewItem() override = default;;
|
||||||
//
|
|
||||||
};
|
|
||||||
|
|
||||||
TreeViewItemType type;
|
TreeViewItemType type;
|
||||||
|
|
||||||
@ -50,16 +48,16 @@ public:
|
|||||||
|
|
||||||
class BookmarkViewVisualDragItem : public wxDialog {
|
class BookmarkViewVisualDragItem : public wxDialog {
|
||||||
public:
|
public:
|
||||||
BookmarkViewVisualDragItem(wxString labelValue = L"Popup");
|
explicit BookmarkViewVisualDragItem(const wxString& labelValue = L"Popup");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class BookmarkView : public BookmarkPanel {
|
class BookmarkView : public BookmarkPanel {
|
||||||
public:
|
public:
|
||||||
BookmarkView( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1, -1 ), long style = wxTAB_TRAVERSAL );
|
explicit BookmarkView( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1, -1 ), long style = wxTAB_TRAVERSAL );
|
||||||
|
|
||||||
virtual ~BookmarkView();
|
~BookmarkView() override;
|
||||||
|
|
||||||
//order an asynchronous refresh/rebuild of the whole tree,
|
//order an asynchronous refresh/rebuild of the whole tree,
|
||||||
//will take effect at the next onUpdateTimer() occurence.
|
//will take effect at the next onUpdateTimer() occurence.
|
||||||
@ -68,7 +66,7 @@ public:
|
|||||||
//order asynchronous updates of the bookmarks,
|
//order asynchronous updates of the bookmarks,
|
||||||
//will take effect at the next onUpdateTimer() occurence.
|
//will take effect at the next onUpdateTimer() occurence.
|
||||||
void updateBookmarks();
|
void updateBookmarks();
|
||||||
void updateBookmarks(std::string group);
|
void updateBookmarks(const std::string& group);
|
||||||
|
|
||||||
bool isKeywordMatch(std::wstring str, std::vector<std::wstring> &keywords);
|
bool isKeywordMatch(std::wstring str, std::vector<std::wstring> &keywords);
|
||||||
|
|
||||||
@ -77,21 +75,21 @@ public:
|
|||||||
void onMenuItem(wxCommandEvent& event);
|
void onMenuItem(wxCommandEvent& event);
|
||||||
bool isMouseInView();
|
bool isMouseInView();
|
||||||
|
|
||||||
bool getExpandState(std::string branchName);
|
bool getExpandState(const std::string& branchName);
|
||||||
void setExpandState(std::string branchName, bool state);
|
void setExpandState(const std::string& branchName, bool state);
|
||||||
|
|
||||||
static BookmarkRangeEntryPtr makeActiveRangeEntry();
|
static BookmarkRangeEntryPtr makeActiveRangeEntry();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void activeSelection(DemodulatorInstancePtr dsel);
|
void activeSelection(const DemodulatorInstancePtr& dsel);
|
||||||
void bookmarkSelection(BookmarkEntryPtr bmSel);
|
void bookmarkSelection(const BookmarkEntryPtr& bmSel);
|
||||||
void rangeSelection(BookmarkRangeEntryPtr re);
|
void rangeSelection(const BookmarkRangeEntryPtr& re);
|
||||||
|
|
||||||
void activateBookmark(BookmarkEntryPtr bmEnt);
|
void activateBookmark(const BookmarkEntryPtr& bmEnt);
|
||||||
|
|
||||||
void activateRange(BookmarkRangeEntryPtr rangeEnt);
|
void activateRange(const BookmarkRangeEntryPtr& rangeEnt);
|
||||||
void recentSelection(BookmarkEntryPtr bmSel);
|
void recentSelection(const BookmarkEntryPtr& bmSel);
|
||||||
void groupSelection(std::string groupName);
|
void groupSelection(const std::string& groupName);
|
||||||
void bookmarkBranchSelection();
|
void bookmarkBranchSelection();
|
||||||
void recentBranchSelection();
|
void recentBranchSelection();
|
||||||
void rangeBranchSelection();
|
void rangeBranchSelection();
|
||||||
@ -101,45 +99,45 @@ protected:
|
|||||||
void hideProps(bool hidePanel = true);
|
void hideProps(bool hidePanel = true);
|
||||||
void showProps();
|
void showProps();
|
||||||
|
|
||||||
void onUpdateTimer( wxTimerEvent& event );
|
void onUpdateTimer( wxTimerEvent& event ) override;
|
||||||
|
|
||||||
//refresh / rebuild the whole tree item immediatly
|
//refresh / rebuild the whole tree item immediatly
|
||||||
void doUpdateActiveList();
|
void doUpdateActiveList();
|
||||||
|
|
||||||
void onKeyUp( wxKeyEvent& event );
|
void onKeyUp( wxKeyEvent& event ) override;
|
||||||
void onTreeActivate( wxTreeEvent& event );
|
void onTreeActivate( wxTreeEvent& event ) override;
|
||||||
void onTreeCollapse( wxTreeEvent& event );
|
void onTreeCollapse( wxTreeEvent& event ) override;
|
||||||
void onTreeExpanded( wxTreeEvent& event );
|
void onTreeExpanded( wxTreeEvent& event ) override;
|
||||||
void onTreeItemMenu( wxTreeEvent& event );
|
void onTreeItemMenu( wxTreeEvent& event ) override;
|
||||||
void onTreeSelect( wxTreeEvent& event );
|
void onTreeSelect( wxTreeEvent& event ) override;
|
||||||
void onTreeSelectChanging( wxTreeEvent& event );
|
void onTreeSelectChanging( wxTreeEvent& event ) override;
|
||||||
void onLabelKillFocus(wxFocusEvent& event );
|
void onLabelKillFocus(wxFocusEvent& event ) override;
|
||||||
void onLabelText( wxCommandEvent& event );
|
void onLabelText( wxCommandEvent& event ) override;
|
||||||
void onDoubleClickFreq( wxMouseEvent& event );
|
void onDoubleClickFreq( wxMouseEvent& event ) override;
|
||||||
void onDoubleClickBandwidth( wxMouseEvent& event );
|
void onDoubleClickBandwidth( wxMouseEvent& event ) override;
|
||||||
void onTreeBeginDrag( wxTreeEvent& event );
|
void onTreeBeginDrag( wxTreeEvent& event ) override;
|
||||||
void onTreeEndDrag( wxTreeEvent& event );
|
void onTreeEndDrag( wxTreeEvent& event ) override;
|
||||||
void onTreeItemGetTooltip( wxTreeEvent& event );
|
void onTreeItemGetTooltip( wxTreeEvent& event ) override;
|
||||||
void onEnterWindow( wxMouseEvent& event );
|
void onEnterWindow( wxMouseEvent& event ) override;
|
||||||
void onLeaveWindow( wxMouseEvent& event );
|
void onLeaveWindow( wxMouseEvent& event ) override;
|
||||||
void onMotion( wxMouseEvent& event );
|
void onMotion( wxMouseEvent& event ) override;
|
||||||
|
|
||||||
void onSearchTextFocus( wxMouseEvent& event );
|
void onSearchTextFocus( wxMouseEvent& event ) override;
|
||||||
void onSearchText( wxCommandEvent& event );
|
void onSearchText( wxCommandEvent& event ) override;
|
||||||
void onClearSearch( wxCommandEvent& event );
|
void onClearSearch( wxCommandEvent& event ) override;
|
||||||
|
|
||||||
void clearButtons();
|
void clearButtons();
|
||||||
void showButtons();
|
void showButtons();
|
||||||
void refreshLayout();
|
void refreshLayout();
|
||||||
|
|
||||||
wxButton *makeButton(wxWindow *parent, std::string labelVal, wxObjectEventFunction handler);
|
wxButton *makeButton(wxWindow *parent, const std::string& labelVal, wxObjectEventFunction handler);
|
||||||
wxButton *addButton(wxWindow *parent, std::string labelVal, wxObjectEventFunction handler);
|
wxButton *addButton(wxWindow *parent, const std::string& labelVal, wxObjectEventFunction handler);
|
||||||
|
|
||||||
void doBookmarkActive(std::string group, DemodulatorInstancePtr demod);
|
void doBookmarkActive(const std::string& group, const DemodulatorInstancePtr& demod);
|
||||||
void doBookmarkRecent(std::string group, BookmarkEntryPtr be);
|
void doBookmarkRecent(const std::string& group, const BookmarkEntryPtr& be);
|
||||||
void doMoveBookmark(BookmarkEntryPtr be, std::string group);
|
void doMoveBookmark(const BookmarkEntryPtr& be, const std::string& group);
|
||||||
void doRemoveActive(DemodulatorInstancePtr demod);
|
void doRemoveActive(const DemodulatorInstancePtr& demod);
|
||||||
void doRemoveRecent(BookmarkEntryPtr be);
|
void doRemoveRecent(const BookmarkEntryPtr& be);
|
||||||
void doClearRecents();
|
void doClearRecents();
|
||||||
|
|
||||||
void updateBookmarkChoices();
|
void updateBookmarkChoices();
|
||||||
@ -184,7 +182,6 @@ protected:
|
|||||||
// Bookmarks
|
// Bookmarks
|
||||||
std::atomic_bool doUpdateBookmarks;
|
std::atomic_bool doUpdateBookmarks;
|
||||||
std::set< std::string > doUpdateBookmarkGroup;
|
std::set< std::string > doUpdateBookmarkGroup;
|
||||||
BookmarkNames groupNames;
|
|
||||||
std::map<std::string, wxTreeItemId> groups;
|
std::map<std::string, wxTreeItemId> groups;
|
||||||
wxArrayString bookmarkChoices;
|
wxArrayString bookmarkChoices;
|
||||||
wxChoice *bookmarkChoice;
|
wxChoice *bookmarkChoice;
|
||||||
@ -201,6 +198,6 @@ protected:
|
|||||||
// Search
|
// Search
|
||||||
std::vector<std::wstring> searchKeywords;
|
std::vector<std::wstring> searchKeywords;
|
||||||
|
|
||||||
void setStatusText(std::string statusText);
|
void setStatusText(const std::string& statusText);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user