about-dialog.cc
Go to the documentation of this file.
1 /*
2  * rcdiscover - the network discovery tool for Roboception devices
3  *
4  * Copyright (c) 2017 Roboception GmbH
5  * All rights reserved
6  *
7  * Author: Raphael Schaller
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright notice,
16  * this list of conditions and the following disclaimer in the documentation
17  * and/or other materials provided with the distribution.
18  *
19  * 3. Neither the name of the copyright holder nor the names of its contributors
20  * may be used to endorse or promote products derived from this software without
21  * specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 #include "about-dialog.h"
37 
38 #include <wx/panel.h>
39 #include <wx/sizer.h>
40 #include <wx/stattext.h>
41 #include <wx/textctrl.h>
42 
43 #include "resources/lgpl.h"
44 
45 #define STRINGIFY(x) #x
46 #define TOSTRING(x) STRINGIFY(x)
47 
48 static const std::string rc_copyright = "Copyright (c) 2017 Roboception GmbH";
49 static const std::string rc_license = "The source code of rcdiscover is available under the 3-clause BSD license.";
50 static const std::string wx_license = "This program contains code from the \
51 LGPLed library wxWidgets (http://www.wxwidgets.org/).";
52 
53 AboutDialog::AboutDialog(wxWindow *parent, wxWindowID id,
54  const wxPoint &pos,
55  long style,
56  const wxString &name) :
57  wxDialog(parent, id, "About rcdiscover", pos, wxSize(420, 400), style, name)
58 {
59  auto *panel = new wxPanel(this);
60  auto *vbox = new wxBoxSizer(wxVERTICAL);
61 
62  // title
63  auto *title_box = new wxBoxSizer(wxHORIZONTAL);
64  auto *title = new wxStaticText(panel, wxID_ANY, "rcdiscover " PACKAGE_VERSION,
65  wxDefaultPosition,
66  wxDefaultSize,
67  wxALIGN_CENTRE);
68  title->SetFont(wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
69  wxFONTWEIGHT_BOLD));
70  title_box->Add(title, 1, wxEXPAND | wxALL, 10);
71  vbox->Add(title_box, 0, wxALIGN_CENTER);
72 
73  // Roboception copyright
74  auto *copyright_box = new wxBoxSizer(wxHORIZONTAL);
75  auto *copyright = new wxStaticText(panel, wxID_ANY, rc_copyright);
76  copyright_box->Add(copyright, 1, wxEXPAND | wxALL, 10);
77  vbox->Add(copyright_box, 0, wxALIGN_CENTER);
78 
79  // Roboception license
80  auto *rclicense_box = new wxBoxSizer(wxHORIZONTAL);
81  auto *rclicense = new wxStaticText(panel, wxID_ANY, rc_license);
82  rclicense->Wrap(400);
83  rclicense_box->Add(rclicense, 1, wxEXPAND | wxALL, 10);
84  vbox->Add(rclicense_box, 0, wxALIGN_CENTER);
85 
86  // wxWidgets license
87  auto *licenses_box = new wxBoxSizer(wxHORIZONTAL);
88  auto *licenses = new wxStaticText(panel, wxID_ANY, wx_license);
89  licenses->Wrap(400);
90  licenses_box->Add(licenses, 1, wxEXPAND | wxALL, 10);
91  vbox->Add(licenses_box, 0);
92 
93  auto *lgpl_box = new wxBoxSizer(wxHORIZONTAL);
94  auto *lgpl = new wxTextCtrl(panel, wxID_ANY, wxEmptyString, wxDefaultPosition,
95  wxSize(400, -1), wxTE_MULTILINE | wxTE_READONLY);
96  lgpl->SetFont(
97  wxFont(7, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
98  lgpl->WriteText(lgpl_text);
99  lgpl_box->Add(lgpl, 1, wxEXPAND | wxALL, 10);
100  vbox->Add(lgpl_box, 1);
101 
102  panel->SetSizer(vbox);
103  Centre();
104 }
static const std::string wx_license
Definition: about-dialog.cc:50
static const char lgpl_text[]
Definition: lgpl.h:1
AboutDialog(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, long style=wxDEFAULT_DIALOG_STYLE, const wxString &name=wxDialogNameStr)
Definition: about-dialog.cc:53
static const std::string rc_license
Definition: about-dialog.cc:49
static const std::string rc_copyright
Definition: about-dialog.cc:48


rcdiscover
Author(s): Heiko Hirschmueller , Raphael Schaller
autogenerated on Sun Apr 18 2021 02:16:32