OpenCPN Partial API docs
Loading...
Searching...
No Matches
AISTargetListDialog.h
1/***************************************************************************
2 *
3 * Project: OpenCPN
4 *
5 ***************************************************************************
6 * Copyright (C) 2010 by David S. Register *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the *
20 * Free Software Foundation, Inc., *
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
22 ***************************************************************************
23 */
24
25#ifndef __AISTARGETLISTDIALOG_H__
26#define __AISTARGETLISTDIALOG_H__
27
28#include <memory>
29
30#include <wx/panel.h>
31#include <wx/checkbox.h>
32
33#define ID_AIS_TARGET_LIST 10003
34#define ID_RCLK_UNDOCK 7035
35
36class OCPNListCtrl;
37class AisDecoder;
38class AisTargetData;
39class wxWindow;
40class wxAuiManager;
41class wxButton;
42class wxStaticText;
43class wxSpinCtrl;
44class wxTextCtrl;
45class wxListEvent;
46class wxAuiManager;
47class wxAuiManagerEvent;
48
49WX_DEFINE_SORTED_ARRAY_INT(int, ArrayOfMMSI);
50
51class AISTargetListDialog : public wxPanel {
52 DECLARE_CLASS(AISTargetListDialog)
53
54public:
55 AISTargetListDialog(wxWindow *parent, wxAuiManager *auimgr,
56 AisDecoder *pdecoder);
58
59 void Shutdown(void);
60 void OnClose(wxCloseEvent &event);
61 void Disconnect_decoder();
62
63 void RecalculateSize(void);
64 void SetColorScheme();
65 void UpdateAISTargetList(); // Rebuild AIS target list
66 void UpdateNVAISTargetList();
67 void CopyMMSItoClipBoard(int);
68 void CenterToTarget(bool);
69 std::shared_ptr<AisTargetData> GetpTarget(unsigned int list_item);
70
71 OCPNListCtrl *m_pListCtrlAISTargets;
72 AisDecoder *m_pdecoder;
73
74 ArrayOfMMSI *m_pMMSI_array;
75
76private:
77 void CreateControls(void);
78
79 void OnPaneClose(wxAuiManagerEvent &event);
80 void UpdateButtons();
81 void OnTargetSelected(wxListEvent &event);
82 void DoTargetQuery(int mmsi);
83 void OnTargetDefaultAction(wxListEvent &event);
84 void OnTargetQuery(wxCommandEvent &event);
85 void OnTargetListColumnClicked(wxListEvent &event);
86 void OnTargetScrollTo(wxCommandEvent &event);
87 void OnTargetScrollToClose(wxCommandEvent &event);
88 void OnTargetCreateWpt(wxCommandEvent &event);
89 void OnShowAllTracks(wxCommandEvent &event);
90 void OnHideAllTracks(wxCommandEvent &event);
91 void OnToggleTrack(wxCommandEvent &event);
92 void OnCopyMMSI(wxCommandEvent &event);
93 void OnLimitRange(wxCommandEvent &event);
94 void OnCloseButton(wxCommandEvent &event);
95 void OnAutosortCB(wxCommandEvent &event);
96 void OnRightClickContext(wxCommandEvent &event);
97 void OnContextUndock(wxCommandEvent &event);
98
99 wxWindow *m_pparent;
100 wxAuiManager *m_pAuiManager;
101 wxButton *m_pButtonInfo;
102 wxButton *m_pButtonJumpTo;
103 wxButton *m_pButtonJumpTo_Close;
104 wxButton *m_pButtonCreateWpt;
105 wxButton *m_pButtonHideAllTracks;
106 wxButton *m_pButtonShowAllTracks;
107 wxButton *m_pButtonToggleTrack;
108 wxButton *m_pButtonCopyMMSI;
109 wxStaticText *m_pStaticTextRange;
110 wxSpinCtrl *m_pSpinCtrlRange;
111 wxStaticText *m_pStaticTextCount;
112 wxTextCtrl *m_pTextTargetCount;
113 wxButton *m_pButtonOK;
114 wxCheckBox *m_pCBAutosort;
115
116 bool m_bautosort_force;
117
118 DECLARE_EVENT_TABLE()
119};
120
121#endif