OpenCPN Partial API docs
priority_gui.h
1 /******************************************************************************
2  *
3  * Project: OpenCPN
4  * Purpose:
5  * Author: David Register
6  *
7  ***************************************************************************
8  * Copyright (C) 2022 by David S. Register *
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  * This program is distributed in the hope that it will be useful, *
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18  * GNU General Public License for more details. *
19  * *
20  * You should have received a copy of the GNU General Public License *
21  * along with this program; if not, write to the *
22  * Free Software Foundation, Inc., *
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
24  ***************************************************************************
25  */
26 
27 #ifndef _PRIORITY_DIALOG_H
28 #define _PRIORITY_DIALOG_H
29 
30 #include <vector>
31 #include <wx/checkbox.h>
32 #include <wx/listctrl.h>
33 #include <wx/radiobut.h>
34 #include <wx/stattext.h>
35 #include <wx/timer.h>
36 #include <wx/treectrl.h>
37 
38 class PriorityDlg : public wxDialog {
39 public:
40  PriorityDlg(wxWindow *parent);
41  virtual ~PriorityDlg();
42 
43 private:
44  void OnMoveUpClick(wxCommandEvent& event);
45  void OnMoveDownClick(wxCommandEvent& event);
46  void OnRefreshClick(wxCommandEvent& event);
47  void OnClearClick(wxCommandEvent& event);
48  void OnItemSelected(wxCommandEvent& event);
49 
50  void ProcessMove(wxTreeItemId, int dir);
51 
52  void Populate();
53  void AddLeaves(const std::vector<std::string> &map_list,
54  size_t map_index, std::string map_name,
55  wxTreeItemId leaf_parent);
56  void AdjustSatPriority();
57  void AdjustCOGSOGPriority();
58 
59  wxButton *btnMoveUp, *btnMoveDown;
60  wxButton *btnRefresh, *btnClear;
61  wxTreeCtrl *m_prioTree;
62  std::vector<std::string> m_map;
63 
64  size_t m_selmap_index;
65  size_t m_selIndex;
66 
67  int m_maxStringLength;
68  wxString m_max_string;
69  wxFont *m_pF;
70 };
71 
72 
73 #endif //_PRIORITY_DIALOG_H