2016-09-13 22:59:21 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "BookmarkPanel.h"
|
|
|
|
|
2016-09-14 19:46:57 -04:00
|
|
|
#include "BookmarkMgr.h"
|
|
|
|
|
2016-10-10 22:28:48 -04:00
|
|
|
class TreeViewItem : public wxTreeItemData {
|
|
|
|
public:
|
|
|
|
enum TreeViewItemType {
|
|
|
|
TREEVIEW_ITEM_TYPE_GROUP,
|
|
|
|
TREEVIEW_ITEM_TYPE_ACTIVE,
|
|
|
|
TREEVIEW_ITEM_TYPE_RECENT,
|
|
|
|
TREEVIEW_ITEM_TYPE_BOOKMARK
|
|
|
|
};
|
|
|
|
|
|
|
|
TreeViewItem() {
|
|
|
|
bookmarkEnt = nullptr;
|
|
|
|
demod = nullptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
TreeViewItemType type;
|
|
|
|
BookmarkEntry *bookmarkEnt;
|
|
|
|
DemodulatorInstance *demod;
|
|
|
|
std::string groupName;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-09-13 22:59:21 -04:00
|
|
|
class BookmarkView : public BookmarkPanel {
|
|
|
|
public:
|
|
|
|
BookmarkView( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1, -1 ), long style = wxTAB_TRAVERSAL );
|
|
|
|
|
|
|
|
void updateActiveList();
|
2016-10-06 22:27:12 -04:00
|
|
|
void updateBookmarks();
|
|
|
|
void updateBookmarks(std::string group);
|
2016-09-28 20:37:39 -04:00
|
|
|
void activeSelection(DemodulatorInstance *dsel);
|
2016-10-05 19:10:01 -04:00
|
|
|
void bookmarkSelection(BookmarkEntry *bmSel);
|
|
|
|
void activateBookmark(BookmarkEntry *bmEnt);
|
|
|
|
void recentSelection(BookmarkEntry *bmSel);
|
2016-10-06 22:27:12 -04:00
|
|
|
wxTreeItemId refreshBookmarks();
|
2016-09-29 21:57:23 -04:00
|
|
|
void updateTheme();
|
2016-10-06 21:08:45 -04:00
|
|
|
void onMenuItem(wxCommandEvent& event);
|
2016-10-13 00:41:35 -04:00
|
|
|
bool isMouseInView();
|
|
|
|
|
2016-09-13 22:59:21 -04:00
|
|
|
|
|
|
|
protected:
|
2016-09-28 20:37:39 -04:00
|
|
|
|
|
|
|
void hideProps();
|
|
|
|
|
2016-09-14 22:49:32 -04:00
|
|
|
void onUpdateTimer( wxTimerEvent& event );
|
|
|
|
void doUpdateActiveList();
|
|
|
|
|
2016-09-13 22:59:21 -04:00
|
|
|
void onTreeBeginLabelEdit( wxTreeEvent& event );
|
|
|
|
void onTreeEndLabelEdit( wxTreeEvent& event );
|
|
|
|
void onTreeActivate( wxTreeEvent& event );
|
|
|
|
void onTreeCollapse( wxTreeEvent& event );
|
|
|
|
void onTreeExpanded( wxTreeEvent& event );
|
2016-10-06 21:08:45 -04:00
|
|
|
void onTreeItemMenu( wxTreeEvent& event );
|
2016-09-13 22:59:21 -04:00
|
|
|
void onTreeSelect( wxTreeEvent& event );
|
|
|
|
void onTreeSelectChanging( wxTreeEvent& event );
|
|
|
|
void onLabelText( wxCommandEvent& event );
|
2016-09-29 20:47:38 -04:00
|
|
|
void onDoubleClickFreq( wxMouseEvent& event );
|
|
|
|
void onDoubleClickBandwidth( wxMouseEvent& event );
|
2016-09-13 22:59:21 -04:00
|
|
|
void onBookmark( wxCommandEvent& event );
|
|
|
|
void onActivate( wxCommandEvent& event );
|
|
|
|
void onRemove( wxCommandEvent& event );
|
2016-10-13 00:41:35 -04:00
|
|
|
void onTreeBeginDrag( wxTreeEvent& event );
|
|
|
|
void onTreeEndDrag( wxTreeEvent& event );
|
|
|
|
void onTreeDeleteItem( wxTreeEvent& event );
|
|
|
|
void onTreeItemGetTooltip( wxTreeEvent& event );
|
|
|
|
void onEnterWindow( wxMouseEvent& event );
|
|
|
|
void onLeaveWindow( wxMouseEvent& event );
|
|
|
|
|
|
|
|
std::atomic_bool mouseInView;
|
2016-09-14 19:46:57 -04:00
|
|
|
|
2016-10-05 19:10:01 -04:00
|
|
|
wxTreeItemId rootBranch, activeBranch, bookmarkBranch, recentBranch;
|
2016-10-06 21:08:45 -04:00
|
|
|
|
2016-10-13 00:41:35 -04:00
|
|
|
TreeViewItem *dragItem;
|
|
|
|
wxTreeItemId dragItemId;
|
|
|
|
|
2016-10-06 21:08:45 -04:00
|
|
|
// Bookmarks
|
2016-10-06 22:27:12 -04:00
|
|
|
std::atomic_bool doUpdateBookmarks;
|
|
|
|
std::set< std::string > doUpdateBookmarkGroup;
|
2016-10-06 21:08:45 -04:00
|
|
|
BookmarkNames groupNames;
|
2016-09-29 20:47:38 -04:00
|
|
|
std::map<std::string, wxTreeItemId> groups;
|
2016-10-06 21:08:45 -04:00
|
|
|
BookmarkEntry *bookmarkSel;
|
2016-09-29 20:47:38 -04:00
|
|
|
|
2016-10-06 22:27:12 -04:00
|
|
|
|
2016-10-06 21:08:45 -04:00
|
|
|
// Active
|
2016-10-06 22:27:12 -04:00
|
|
|
std::atomic_bool doUpdateActive;
|
2016-09-28 20:37:39 -04:00
|
|
|
DemodulatorInstance *activeSel;
|
2016-10-06 21:08:45 -04:00
|
|
|
|
|
|
|
// Recent
|
2016-10-10 22:28:48 -04:00
|
|
|
BookmarkEntry *recentSel;
|
|
|
|
};
|