OpenCPN Partial API docs
Loading...
Searching...
No Matches
rest_server_gui.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2010 by David S. Register *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
16 **************************************************************************/
17
24#ifndef RESTSERVERGUI_H_
25#define RESTSERVERGUI_H_
26
27#include <functional>
28#include <string>
29
30#include <wx/button.h>
31#include <wx/dialog.h>
32#include <wx/stattext.h>
33#include <wx/checkbox.h>
34
35#include "ocpn_frame.h"
36#include "model/rest_server.h"
37
38// Constants for Dialog
39#define ID_STGDIALOG 10005
40#define SYMBOL_STG_STYLE \
41 wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX
42
43#define SYMBOL_STG_TITLE _("Send to GPS")
44#define SYMBOL_STG_IDNAME ID_STGDIALOG
45#define SYMBOL_STG_SIZE wxSize(500, 500)
46#define SYMBOL_STG_POSITION wxDefaultPosition
47
51class AcceptObjectDialog : public wxDialog {
52 DECLARE_EVENT_TABLE()
53
54public:
56 AcceptObjectDialog(wxWindow* parent, const wxString& caption,
57 const wxString& msg1, const wxString msg2);
58 AcceptObjectDialog(wxWindow* parent, wxWindowID id, const wxString& caption,
59 const wxString& hint, const wxPoint& pos,
60 const wxSize& size, long style, const wxString& msg1,
61 const wxString& msg2);
63
64 bool Create(wxWindow* parent, wxWindowID id, const wxString& caption,
65 const wxString& hint, const wxPoint& pos, const wxSize& size,
66 long style, const wxString& msg1, const wxString& msg2);
67
68 void SetMessage(const wxString& message);
69 void SetCheck1Message(const wxString& message);
70
71 bool GetCheck1Value() { return m_pCheck1->GetValue(); }
72
73private:
74 void CreateControls(const wxString& hint, const wxString& msg1,
75 const wxString& msg);
76
77 void OnCancelClick(wxCommandEvent& event);
78 void OnOKClick(wxCommandEvent& event);
79
80 wxButton* m_CancelButton;
81 wxButton* m_OKButton;
82 wxStaticText* premtext;
83 wxCheckBox* m_pCheck1;
84 wxString m_checkbox1_msg;
85};
86
87class PINCreateDialog : public wxDialog {
88 DECLARE_EVENT_TABLE()
89
90public:
92
93 PINCreateDialog(wxWindow* parent, wxWindowID id, const wxString& caption,
94 const wxString& hint, const wxPoint& pos, const wxSize& size,
95 long style);
97
98 static RestServerDlgCtx GetDlgCtx();
99
100 wxDialog* Initiate(const std::string& msg, const std::string& text1);
101 void DeInit();
102
103 bool Create(wxWindow* parent, wxWindowID id = SYMBOL_STG_IDNAME,
104 const wxString& caption = SYMBOL_STG_TITLE,
105 const wxString& hint = SYMBOL_STG_TITLE,
106 const wxPoint& pos = SYMBOL_STG_POSITION,
107 const wxSize& size = SYMBOL_STG_SIZE,
108 long style = SYMBOL_STG_STYLE);
109 void SetMessage(const wxString& message);
110 void SetText1Message(const wxString& message);
111
112 wxString GetText1Value() { return m_pText1->GetValue(); }
113
114private:
115 void CreateControls(const wxString& hint);
116
117 void OnCancelClick(wxCommandEvent& event);
118 void OnOKClick(wxCommandEvent& event);
119
120 wxButton* m_CancelButton;
121 wxButton* m_OKButton;
122 wxStaticText* premtext;
123 wxTextCtrl* m_pText1;
124 wxString m_checkbox1_msg;
125};
126
127#endif
"Accept Object" Dialog Definition
Callbacks for handling dialogs and RouteManager updates.
Definition rest_server.h:87
OpenCPN top window.
REST API server.