mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-07 16:34:50 -04:00
Add bookmark panel to appframe layout, implement some methods
This commit is contained in:
@@ -26,14 +26,14 @@ BookmarkPanel::BookmarkPanel( wxWindow* parent, wxWindowID id, const wxPoint& po
|
||||
|
||||
m_staticText1 = new wxStaticText( m_propPanel, wxID_ANY, wxT("Label"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText1->Wrap( -1 );
|
||||
fgPropSizer->Add( m_staticText1, 0, wxALIGN_RIGHT|wxALL, 5 );
|
||||
fgPropSizer->Add( m_staticText1, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_labelText = new wxTextCtrl( m_propPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgPropSizer->Add( m_labelText, 0, wxALL|wxEXPAND|wxLEFT|wxTOP, 5 );
|
||||
fgPropSizer->Add( m_labelText, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_frequencyLabel = new wxStaticText( m_propPanel, wxID_ANY, wxT("Freq"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_frequencyLabel->Wrap( -1 );
|
||||
fgPropSizer->Add( m_frequencyLabel, 0, wxALIGN_RIGHT|wxALL, 5 );
|
||||
fgPropSizer->Add( m_frequencyLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_frequencyVal = new wxStaticText( m_propPanel, wxID_ANY, wxT("FrequencyVal"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_frequencyVal->Wrap( -1 );
|
||||
@@ -41,7 +41,7 @@ BookmarkPanel::BookmarkPanel( wxWindow* parent, wxWindowID id, const wxPoint& po
|
||||
|
||||
m_bandwidthLabel = new wxStaticText( m_propPanel, wxID_ANY, wxT("BW"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_bandwidthLabel->Wrap( -1 );
|
||||
fgPropSizer->Add( m_bandwidthLabel, 0, wxALIGN_RIGHT|wxALL, 5 );
|
||||
fgPropSizer->Add( m_bandwidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_bandwidthVal = new wxStaticText( m_propPanel, wxID_ANY, wxT("BandwidthVal"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_bandwidthVal->Wrap( -1 );
|
||||
@@ -49,7 +49,7 @@ BookmarkPanel::BookmarkPanel( wxWindow* parent, wxWindowID id, const wxPoint& po
|
||||
|
||||
m_modulationLabel = new wxStaticText( m_propPanel, wxID_ANY, wxT("Type"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_modulationLabel->Wrap( -1 );
|
||||
fgPropSizer->Add( m_modulationLabel, 0, wxALIGN_RIGHT|wxALL, 5 );
|
||||
fgPropSizer->Add( m_modulationLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 );
|
||||
|
||||
m_typeVal = new wxStaticText( m_propPanel, wxID_ANY, wxT("TypeVal"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_typeVal->Wrap( -1 );
|
||||
@@ -62,10 +62,10 @@ BookmarkPanel::BookmarkPanel( wxWindow* parent, wxWindowID id, const wxPoint& po
|
||||
bSizer1->Add( m_propPanel, 1, wxBOTTOM|wxEXPAND|wxTOP, 5 );
|
||||
|
||||
m_bookmarkButton = new wxButton( this, wxID_ANY, wxT("Bookmark"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer1->Add( m_bookmarkButton, 0, wxALIGN_RIGHT|wxALL|wxEXPAND, 5 );
|
||||
bSizer1->Add( m_bookmarkButton, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_activateButton = new wxButton( this, wxID_ANY, wxT("Activate"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer1->Add( m_activateButton, 0, wxALIGN_RIGHT|wxALL|wxEXPAND, 5 );
|
||||
bSizer1->Add( m_activateButton, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_removeButton = new wxButton( this, wxID_ANY, wxT("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer1->Add( m_removeButton, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
@@ -277,7 +277,7 @@
|
||||
<property name="vgap">0</property>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_RIGHT|wxALL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -360,7 +360,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND|wxLEFT|wxTOP</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxTextCtrl" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -451,7 +451,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_RIGHT|wxALL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -617,7 +617,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_RIGHT|wxALL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -783,7 +783,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_RIGHT|wxALL</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -952,7 +952,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_RIGHT|wxALL|wxEXPAND</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
@@ -1040,7 +1040,7 @@
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_RIGHT|wxALL|wxEXPAND</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
||||
@@ -1,7 +1,29 @@
|
||||
#include "BookmarkView.h"
|
||||
#include "CubicSDR.h"
|
||||
|
||||
BookmarkView::BookmarkView( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : BookmarkPanel(parent, id, pos, size, style) {
|
||||
doUpdateActive = false;
|
||||
}
|
||||
|
||||
void BookmarkView::updateActiveList() {
|
||||
std::vector<DemodulatorInstance *> &demods = wxGetApp().getDemodMgr().getDemodulators();
|
||||
|
||||
DemodulatorInstance *activeDemodulator = wxGetApp().getDemodMgr().getActiveDemodulator();
|
||||
DemodulatorInstance *lastActiveDemodulator = wxGetApp().getDemodMgr().getLastActiveDemodulator();
|
||||
|
||||
m_treeView->Disable();
|
||||
m_treeView->DeleteAllItems();
|
||||
activeItems.erase(activeItems.begin(),activeItems.end());
|
||||
|
||||
activeBranch = m_treeView->AddRoot("Active");
|
||||
|
||||
for (auto demod_i : demods) {
|
||||
wxTreeItemId itm = m_treeView->AppendItem(activeBranch,demod_i->getLabel());
|
||||
activeItems[itm] = demod_i;
|
||||
}
|
||||
|
||||
m_treeView->Enable();
|
||||
m_treeView->ExpandAll();
|
||||
}
|
||||
|
||||
void BookmarkView::onTreeBeginLabelEdit( wxTreeEvent& event ) {
|
||||
|
||||
@@ -23,5 +23,7 @@ protected:
|
||||
void onActivate( wxCommandEvent& event );
|
||||
void onRemove( wxCommandEvent& event );
|
||||
|
||||
|
||||
bool doUpdateActive;
|
||||
wxTreeItemId activeBranch;
|
||||
std::map<wxTreeItemId, DemodulatorInstance *> activeItems;
|
||||
};
|
||||
Reference in New Issue
Block a user