OpenCPN Partial API docs
Loading...
Searching...
No Matches
connections_dlg.h
Go to the documentation of this file.
1
2/***************************************************************************
3 * Copyright (C) 2025 Alec Leamas *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
17 **************************************************************************/
18
23#ifndef CONNECT_NEW_DLG__
24#define CONNECT_NEW_DLG__
25
26#include <vector>
27
28#include <wx/panel.h>
29#include <wx/scrolwin.h>
30
31#include "model/conn_params.h"
32#include "observable_evtvar.h"
33
38class ConnectionsDlg : public wxPanel {
39public:
45 ConnectionsDlg(wxWindow* parent,
46 const std::vector<ConnectionParams*>& connections);
47
51 void ApplySettings();
52
56 void CancelSettings();
57
63 void OnResize(const wxSize& size);
64
65private:
66 void DoApply(wxWindow* root);
67 void DoCancel(wxWindow* root);
68
69 const std::vector<ConnectionParams*>& m_connections;
70
72 EventVar m_evt_add_connection;
73};
74
75#endif // CONNECT_NEW_DLG__
Options | Connections tab implementaion, basically a UI for maintaining the list of connections.
void ApplySettings()
Make dialog's settings the active ones, usually by updating globals.
void OnResize(const wxSize &size)
Resize the connections tab.
void CancelSettings()
Restore dialog settings from currently used values, usually globals.
Generic event handling between MVC Model and Controller based on a shared EventVar variable.