void BookmarkView::rangeSelection(BookmarkRangeEntryPtr re) { clearButtons(); hideProps(); m_labelText->SetValue(re->label); m_labelText->Show(); m_labelLabel->Show(); m_frequencyVal->Show(); m_frequencyLabel->Show(); std::string strFreq = frequencyToStr(re->startFreq) + "-" + frequencyToStr(re->endFreq); m_frequencyVal->SetLabelText(wxString(strFreq)); showProps(); addButton(m_buttonPanel, "Go to Range", wxCommandEventHandler( BookmarkView::onActivateRange )); addButton(m_buttonPanel, "Update Range", wxCommandEventHandler( BookmarkView::onUpdateRange ))->SetToolTip("Update range by setting it to the active range."); addButton(m_buttonPanel, "Remove Range", wxCommandEventHandler( BookmarkView::onRemoveRange )); showButtons(); refreshLayout(); }
void BookmarkView::recentSelection(BookmarkEntryPtr bmSel) { m_frequencyVal->SetLabelText(frequencyToStr(bmSel->frequency)); m_bandwidthVal->SetLabelText(frequencyToStr(bmSel->bandwidth)); m_modulationVal->SetLabelText(bmSel->type); m_labelText->SetValue(bmSel->label); hideProps(); m_frequencyVal->Show(); m_frequencyLabel->Show(); m_bandwidthVal->Show(); m_bandwidthLabel->Show(); m_modulationVal->Show(); m_modulationLabel->Show(); m_labelText->Show(); m_labelLabel->Show(); clearButtons(); addBookmarkChoice(m_buttonPanel); addButton(m_buttonPanel, "Activate Recent", wxCommandEventHandler( BookmarkView::onActivateRecent )); addButton(m_buttonPanel, "Remove Recent", wxCommandEventHandler( BookmarkView::onRemoveRecent )); showProps(); showButtons(); refreshLayout(); }
BookmarkView::BookmarkView( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : BookmarkPanel(parent, id, pos, size, style) { rootBranch = m_treeView->AddRoot("Root"); activeBranch = m_treeView->AppendItem(rootBranch, "Active"); rangeBranch = m_treeView->AppendItem(rootBranch, "View Ranges"); bookmarkBranch = m_treeView->AppendItem(rootBranch, "Bookmarks"); recentBranch = m_treeView->AppendItem(rootBranch, "Recents"); expandState["active"] = true; expandState["range"] = false; expandState["bookmark"] = true; expandState["recent"] = true; doUpdateActive.store(true); doUpdateBookmarks.store(true); bookmarkChoice = nullptr; dragItem = nullptr; dragItemId = nullptr; editingLabel = false; m_clearSearchButton->Hide(); hideProps(); m_updateTimer.Start(500); visualDragItem = nullptr; nextEnt = nullptr; nextDemod = nullptr; nextGroup = ""; mouseTracker.setTarget(this); }
void BookmarkView::onTreeSelect( wxTreeEvent& event ) { if (skipEvents()) { return; } wxTreeItemId itm = event.GetItem(); TreeViewItem* tvi = dynamic_cast<TreeViewItem*>(m_treeView->GetItemData(itm)); if (!tvi) { if (itm == bookmarkBranch) { bookmarkBranchSelection(); } else if (itm == activeBranch) { activeBranchSelection(); } else if (itm == recentBranch) { recentBranchSelection(); } else if (itm == rangeBranch) { rangeBranchSelection(); } else { hideProps(); this->Layout(); } return; } if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_ACTIVE) { activeSelection(tvi->demod); if (tvi->demod->isActive()) { wxGetApp().getDemodMgr().setActiveDemodulator(nullptr, true); wxGetApp().getDemodMgr().setActiveDemodulator(tvi->demod, false); tvi->demod->setTracking(true); } } else if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RECENT) { recentSelection(tvi->bookmarkEnt); } else if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_BOOKMARK) { bookmarkSelection(tvi->bookmarkEnt); } else if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_GROUP) { groupSelection(tvi->groupName); } else if (tvi->type == TreeViewItem::TREEVIEW_ITEM_TYPE_RANGE) { rangeSelection(tvi->rangeEnt); } else { hideProps(); this->Layout(); } }
void BookmarkView::activeSelection(DemodulatorInstancePtr dsel) { if (dsel == nullptr) { hideProps(); clearButtons(); showProps(); showButtons(); refreshLayout(); return; } m_frequencyVal->SetLabelText(frequencyToStr(dsel->getFrequency())); m_bandwidthVal->SetLabelText(frequencyToStr(dsel->getBandwidth())); m_modulationVal->SetLabelText(dsel->getDemodulatorType()); m_labelText->SetValue(dsel->getDemodulatorUserLabel()); hideProps(); m_frequencyVal->Show(); m_frequencyLabel->Show(); m_bandwidthVal->Show(); m_bandwidthLabel->Show(); m_modulationVal->Show(); m_modulationLabel->Show(); m_labelText->Show(); m_labelLabel->Show(); clearButtons(); addBookmarkChoice(m_buttonPanel); if (!(dsel->isRecording())) { addButton(m_buttonPanel, "Start Recording", wxCommandEventHandler(BookmarkView::onStartRecording)); } else { addButton(m_buttonPanel, "Stop Recording", wxCommandEventHandler(BookmarkView::onStopRecording)); } addButton(m_buttonPanel, "Remove Active", wxCommandEventHandler( BookmarkView::onRemoveActive )); showProps(); showButtons(); refreshLayout(); }
void BookmarkView::bookmarkBranchSelection() { clearButtons(); hideProps(); addButton(m_buttonPanel, BOOKMARK_VIEW_STR_ADD_GROUP, wxCommandEventHandler( BookmarkView::onAddGroup )); showButtons(); refreshLayout(); }
void BookmarkView::recentBranchSelection() { clearButtons(); hideProps(); addButton(m_buttonPanel, BOOKMARK_VIEW_STR_CLEAR_RECENT, wxCommandEventHandler( BookmarkView::onClearRecents )); showButtons(); refreshLayout(); this->Layout(); }
/** * 展示基本控件 */ void PropDialog::show(UIBase *base) { hideProps(); this->setVisible(true); if (base->uiType == UIBase::UI_BUTTON) { show((UIButton*) base); } if (base->uiType == UIBase::UI_PANEL) { show((UIPanel*)base); } }
void BookmarkView::rangeBranchSelection() { clearButtons(); hideProps(); m_labelText->SetValue(wxT("")); m_labelText->Show(); m_labelLabel->Show(); showProps(); addButton(m_buttonPanel, "Add Active Range", wxCommandEventHandler( BookmarkView::onAddRange )); showButtons(); refreshLayout(); this->Layout(); }
void BookmarkView::groupSelection(std::string groupName) { clearButtons(); hideProps(); m_labelText->SetValue(groupName); m_labelText->Show(); m_labelLabel->Show(); addButton(m_buttonPanel, "Remove Group", wxCommandEventHandler( BookmarkView::onRemoveGroup )); showProps(); showButtons(); refreshLayout(); }
void BookmarkView::activeBranchSelection() { hideProps(); this->Layout(); }