Eclipse SUMO - Simulation of Urban MObility
GNEAbout.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 // The "About" - dialog for NETEDIT, (adapted from GUIDialog_AboutSUMO)
15 /****************************************************************************/
16 
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 #include <config.h>
22 
23 #ifdef HAVE_VERSION_H
24 #include <version.h>
25 #endif
26 
31 
32 #include "GNEAbout.h"
33 
34 
35 // ===========================================================================
36 // method definitions
37 // ===========================================================================
38 GNEAbout::GNEAbout(FXWindow* parent) :
39  FXDialogBox(parent, "About Eclipse SUMO netedit", GUIDesignDialogBox) {
40  // set dialog icon
42 
43  // create frame for main info
44  FXHorizontalFrame* mainInfoFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
45 
46  // Netedit icon
47  new FXLabel(mainInfoFrame, "", GUIIconSubSys::getIcon(ICON_SUMO_LOGO), GUIDesignLabelIcon);
48 
49  // "SUMO <VERSION>"
50  FXVerticalFrame* descriptionFrame = new FXVerticalFrame(mainInfoFrame, GUIDesignLabelAboutInfo);
51  myHeadlineFont = new FXFont(getApp(), "Arial", 18, FXFont::Bold);
52  FXLabel* neteditLabel = new FXLabel(descriptionFrame, "SUMO netedit " VERSION_STRING, nullptr, GUIDesignLabelAboutInfo);
53  neteditLabel->setFont(myHeadlineFont);
54  new FXLabel(descriptionFrame, "Network editor for Eclipse SUMO, the Simulation of Urban MObility", nullptr, GUIDesignLabelAboutInfo);
55  new FXLabel(descriptionFrame, "Graphical editor for road networks and infrastructure.", nullptr, GUIDesignLabelAboutInfo);
56  new FXLabel(descriptionFrame, HAVE_ENABLED, nullptr, GUIDesignLabelAboutInfo);
57 
58  // write HAVE_ENABLED with the current modules (except Windows) in debug mode
59  std::string modules(HAVE_ENABLED);
60  while ((modules.size() > 0) && (modules.front() != ' ')) {
61  modules.erase(modules.begin());
62  }
63  WRITE_DEBUG(("Modules: " + modules).c_str());
64 
65  // copyright notice
66  new FXLabel(this, "Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.", nullptr, GUIDesignLabelAboutInfo);
67  new FXLabel(this, "This application is based on code provided by the Eclipse SUMO project.", nullptr, GUIDesignLabelAboutInfo);
68  new FXLabel(this, "These core components are available under the conditions of the Eclipse Public License v2.", nullptr, GUIDesignLabelAboutInfo);
69  (new FXLinkLabel(this, "SPDX-License-Identifier: EPL-2.0", nullptr, GUIDesignLabelAboutInfo))->setTipText("https://www.eclipse.org/legal/epl-v20.html");
70 
71  // link to homepage
72  (new FXLinkLabel(this, "https://sumo.dlr.de", nullptr, GUIDesignLabelCenter))->setTipText("https://sumo.dlr.de");
73 
74  // centered ok-button
75  FXHorizontalFrame* buttonFrame = new FXHorizontalFrame(this, GUIDesignHorizontalFrame);
76  new FXHorizontalFrame(buttonFrame, GUIDesignAuxiliarHorizontalFrame);
77  FXButton* OKButton = new FXButton(buttonFrame, "&OK\t\t", GUIIconSubSys::getIcon(ICON_ACCEPT), this, ID_ACCEPT, GUIDesignButtonOK);
78  new FXHorizontalFrame(buttonFrame, GUIDesignAuxiliarHorizontalFrame);
79 
80  // focus OK button
81  OKButton->setFocus();
82 }
83 
84 
85 void
87  FXDialogBox::create();
88 }
89 
90 
92  delete myHeadlineFont;
93 }
94 
95 
96 /****************************************************************************/
GUIDesignAuxiliarHorizontalFrame
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:273
ICON_ACCEPT
@ ICON_ACCEPT
Definition: GUIIcons.h:386
MsgHandler.h
HAVE_ENABLED
#define HAVE_ENABLED
Definition: config.h:29
GUIDesignButtonOK
#define GUIDesignButtonOK
Definition: GUIDesigns.h:98
ICON_SUMO_LOGO
@ ICON_SUMO_LOGO
Definition: GUIIcons.h:40
GUIDesigns.h
GUIIconSubSys::getIcon
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:609
GNEAbout::myHeadlineFont
FXFont * myHeadlineFont
Font for the widget.
Definition: GNEAbout.h:50
GUIDesignLabelAboutInfo
#define GUIDesignLabelAboutInfo
label extended over frame without thick and with text justify to left
Definition: GUIDesigns.h:176
GNEAbout::~GNEAbout
~GNEAbout()
Destructor.
Definition: GNEAbout.cpp:91
GNEAbout.h
GUIDesignHorizontalFrame
#define GUIDesignHorizontalFrame
Definition: GUIDesigns.h:224
ICON_NETEDIT
@ ICON_NETEDIT
Definition: GUIIcons.h:180
GUIDesignLabelIcon
#define GUIDesignLabelIcon
design for label with icon
Definition: GUIDesigns.h:188
GUIDesignLabelCenter
#define GUIDesignLabelCenter
label extended over frame without thick and with text justify to center and height of 23
Definition: GUIDesigns.h:155
GUIIconSubSys.h
GNEAbout::create
void create()
Creates the widget.
Definition: GNEAbout.cpp:86
config.h
VERSION_STRING
#define VERSION_STRING
Definition: config.h:210
GNEAbout::GNEAbout
GNEAbout(FXWindow *parent)
Constructor.
Definition: GNEAbout.cpp:38
WRITE_DEBUG
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:284
GUIDesignDialogBox
#define GUIDesignDialogBox
Definition: GUIDesigns.h:433