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 "model/rest_server.h"
36
37// Constants for Dialog
38#define ID_STGDIALOG 10005
39#define SYMBOL_STG_STYLE \
40 wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX
41
42#define SYMBOL_STG_TITLE _("Send to GPS")
43#define SYMBOL_STG_IDNAME ID_STGDIALOG
44#define SYMBOL_STG_SIZE wxSize(500, 500)
45#define SYMBOL_STG_POSITION wxDefaultPosition
46
50class AcceptObjectDialog : public wxDialog {
51 DECLARE_EVENT_TABLE()
52
53public:
55 AcceptObjectDialog(wxWindow* parent, const wxString& caption,
56 const wxString& msg1, const wxString msg2);
57 AcceptObjectDialog(wxWindow* parent, wxWindowID id, const wxString& caption,
58 const wxString& hint, const wxPoint& pos,
59 const wxSize& size, long style, const wxString& msg1,
60 const wxString& msg2);
62
63 bool Create(wxWindow* parent, wxWindowID id, const wxString& caption,
64 const wxString& hint, const wxPoint& pos, const wxSize& size,
65 long style, const wxString& msg1, const wxString& msg2);
66
67 void SetMessage(const wxString& message);
68 void SetCheck1Message(const wxString& message);
69
70 bool GetCheck1Value() { return m_pCheck1->GetValue(); }
71
72private:
73 void CreateControls(const wxString& hint, const wxString& msg1,
74 const wxString& msg);
75
76 void OnCancelClick(wxCommandEvent& event);
77 void OnOKClick(wxCommandEvent& event);
78
79 wxButton* m_CancelButton;
80 wxButton* m_OKButton;
81 wxStaticText* premtext;
82 wxCheckBox* m_pCheck1;
83 wxString m_checkbox1_msg;
84};
85
86class PINCreateDialog : public wxDialog {
87 DECLARE_EVENT_TABLE()
88
89public:
91
92 PINCreateDialog(wxWindow* parent, wxWindowID id, const wxString& caption,
93 const wxString& hint, const wxPoint& pos, const wxSize& size,
94 long style);
96
97 static RestServerDlgCtx GetDlgCtx();
98
99 wxDialog* Initiate(const std::string& msg, const std::string& text1);
100 void DeInit();
101
102 bool Create(wxWindow* parent, wxWindowID id = SYMBOL_STG_IDNAME,
103 const wxString& caption = SYMBOL_STG_TITLE,
104 const wxString& hint = SYMBOL_STG_TITLE,
105 const wxPoint& pos = SYMBOL_STG_POSITION,
106 const wxSize& size = SYMBOL_STG_SIZE,
107 long style = SYMBOL_STG_STYLE);
108 void SetMessage(const wxString& message);
109 void SetText1Message(const wxString& message);
110
111 wxString GetText1Value() { return m_pText1->GetValue(); }
112
113private:
114 void CreateControls(const wxString& hint);
115
116 void OnCancelClick(wxCommandEvent& event);
117 void OnOKClick(wxCommandEvent& event);
118
119 wxButton* m_CancelButton;
120 wxButton* m_OKButton;
121 wxStaticText* premtext;
122 wxTextCtrl* m_pText1;
123 wxString m_checkbox1_msg;
124};
125
126#endif
"Accept Object" Dialog Definition
Callbacks for handling dialogs and RouteManager updates.
Definition rest_server.h:87
REST API server.