Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEAbout.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// The "About" - dialog for netedit, (adapted from GUIDialog_AboutSUMO)
19/****************************************************************************/
20#include <config.h>
21
22#ifdef HAVE_VERSION_H
23#include <version.h>
24#endif
25
30
31#include "GNEAbout.h"
32
33
34// ===========================================================================
35// method definitions
36// ===========================================================================
37GNEAbout::GNEAbout(FXWindow* parent) :
38 FXDialogBox(parent, TL("About Eclipse SUMO netedit"), GUIDesignDialogBox) {
39 // set dialog icon
41
42 // create frame for main info
43 FXHorizontalFrame* mainInfoFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
44
45 // Netedit icon
46 new FXLabel(mainInfoFrame, "", GUIIconSubSys::getIcon(GUIIcon::SUMO_LOGO), GUIDesignLabelIcon);
47
48 // "SUMO <VERSION>"
49 FXVerticalFrame* descriptionFrame = new FXVerticalFrame(mainInfoFrame, GUIDesignLabelAboutInfo);
50 myHeadlineFont = new FXFont(getApp(), "Arial", 18, FXFont::Bold);
51 FXLabel* neteditLabel = new FXLabel(descriptionFrame, "SUMO netedit " VERSION_STRING, nullptr, GUIDesignLabelAboutInfo);
52 neteditLabel->setFont(myHeadlineFont);
53 new FXLabel(descriptionFrame, TL("Network editor for Eclipse SUMO, the Simulation of Urban MObility"), nullptr, GUIDesignLabelAboutInfo);
54 new FXLabel(descriptionFrame, TL("Graphical editor for road networks and infrastructure."), nullptr, GUIDesignLabelAboutInfo);
55 // show modules
56 new FXLabel(descriptionFrame, HAVE_ENABLED, nullptr, GUIDesignLabelAboutInfo);
57 // write HAVE_ENABLED with the current modules (except Windows) in debug mode
58 std::string modules(HAVE_ENABLED);
59 while ((modules.size() > 0) && (modules.front() != ' ')) {
60 modules.erase(modules.begin());
61 }
62 WRITE_DEBUG(("Modules: " + modules).c_str());
63 // SUMO_HOME
64 new FXLabel(descriptionFrame, std::string("SUMO_HOME: " + std::string(getenv("SUMO_HOME"))).c_str(), nullptr, GUIDesignLabelAboutInfo);
65 // copyright notice
66 new FXLabel(this, "Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.", nullptr, GUIDesignLabelAboutInfo);
67 new FXLabel(this, TL("This application is based on code provided by the Eclipse SUMO project."), nullptr, GUIDesignLabelAboutInfo);
68 new FXLabel(this, TL("These core components are available under the conditions of the Eclipse Public License v2."), nullptr, GUIDesignLabelAboutInfo);
69 (new MFXLinkLabel(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 MFXLinkLabel(this, "https://www.eclipse.dev/sumo", nullptr, GUIDesignLabel(JUSTIFY_NORMAL)))->setTipText("https://www.eclipse.dev/sumo");
73
74 // centered ok-button
75 FXHorizontalFrame* buttonFrame = new FXHorizontalFrame(this, GUIDesignHorizontalFrame);
76 new FXHorizontalFrame(buttonFrame, GUIDesignAuxiliarHorizontalFrame);
77 FXButton* OKButton = GUIDesigns::buildFXButton(buttonFrame, TL("&OK"), "", "", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), this, ID_ACCEPT, GUIDesignButtonOK);
78 new FXHorizontalFrame(buttonFrame, GUIDesignAuxiliarHorizontalFrame);
79
80 // focus OK button
81 OKButton->setFocus();
82}
83
84
85void
87 FXDialogBox::create();
88}
89
90
94
95
96/****************************************************************************/
#define GUIDesignLabelIcon
design for label with icon
Definition GUIDesigns.h:279
#define GUIDesignLabelAboutInfo
label extended over frame without thick and with text justify to left
Definition GUIDesigns.h:264
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:405
#define GUIDesignDialogBox
Definition GUIDesigns.h:602
#define GUIDesignLabel(justify)
Definition GUIDesigns.h:249
#define GUIDesignButtonOK
Definition GUIDesigns.h:159
#define GUIDesignHorizontalFrame
Horizontal frame extended over frame parent with padding and spacing.
Definition GUIDesigns.h:334
@ NETEDIT_MINI
#define WRITE_DEBUG(msg)
Definition MsgHandler.h:306
#define TL(string)
Definition MsgHandler.h:315
GNEAbout(FXWindow *parent)
Constructor.
Definition GNEAbout.cpp:37
~GNEAbout()
Destructor.
Definition GNEAbout.cpp:91
void create()
Creates the widget.
Definition GNEAbout.cpp:86
FXFont * myHeadlineFont
Font for the widget.
Definition GNEAbout.h:48
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon