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.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 // ===========================================================================
37 GNEAbout::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  new FXLabel(descriptionFrame, HAVE_ENABLED, nullptr, GUIDesignLabelAboutInfo);
56 
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 
64  // copyright notice
65  new FXLabel(this, "Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.", nullptr, GUIDesignLabelAboutInfo);
66  new FXLabel(this, TL("This application is based on code provided by the Eclipse SUMO project."), nullptr, GUIDesignLabelAboutInfo);
67  new FXLabel(this, TL("These core components are available under the conditions of the Eclipse Public License v2."), nullptr, GUIDesignLabelAboutInfo);
68  (new MFXLinkLabel(this, "SPDX-License-Identifier: EPL-2.0", nullptr, GUIDesignLabelAboutInfo))->setTipText("https://www.eclipse.org/legal/epl-v20.html");
69 
70  // link to homepage
71  (new MFXLinkLabel(this, "https://www.eclipse.dev/sumo", nullptr, GUIDesignLabel(JUSTIFY_NORMAL)))->setTipText("https://www.eclipse.dev/sumo");
72 
73  // centered ok-button
74  FXHorizontalFrame* buttonFrame = new FXHorizontalFrame(this, GUIDesignHorizontalFrame);
75  new FXHorizontalFrame(buttonFrame, GUIDesignAuxiliarHorizontalFrame);
76  FXButton* OKButton = GUIDesigns::buildFXButton(buttonFrame, TL("&OK"), "", "", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), this, ID_ACCEPT, GUIDesignButtonOK);
77  new FXHorizontalFrame(buttonFrame, GUIDesignAuxiliarHorizontalFrame);
78 
79  // focus OK button
80  OKButton->setFocus();
81 }
82 
83 
84 void
86  FXDialogBox::create();
87 }
88 
89 
91  delete myHeadlineFont;
92 }
93 
94 
95 /****************************************************************************/
#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:90
void create()
Creates the widget.
Definition: GNEAbout.cpp:85
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
Definition: GUIDesigns.cpp:128
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon