Eclipse SUMO - Simulation of Urban MObility
GNEToolDialogElements.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-2022 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// Elements used in GNEToolDialog
19/****************************************************************************/
20
24
26#include "GNEToolDialog.h"
27
28
29// ============================================-===============================
30// member method definitions
31// ===========================================================================
32
33GNEToolDialogElements::Argument::Argument(GNEToolDialog* _toolDialogParent, const std::string name, const std::string parameter_) :
34 toolDialogParent(_toolDialogParent),
35 argumentName(name),
36 parameter(parameter_) {
37 // add argument in GNEToolDialog parent
38 _toolDialogParent->addArgument(this);
39}
40
41
43
44
46
47
48GNEToolDialogElements::FileNameArgument::FileNameArgument(FXComposite* parent, GNEToolDialog* toolDialogParent, const std::string name, const std::string parameter) :
49 FXVerticalFrame(parent, GUIDesignAuxiliarHorizontalFrame),
50 Argument(toolDialogParent, name, parameter) {
51 new FXLabel(this, parameter.empty() ? name.c_str() : (name + " (" + parameter + ")").c_str(), nullptr, GUIDesignLabelLeftThick);
52 // Create Open button
53 auto horizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
54 myFilenameButton = new FXButton(horizontalFrame, "\t\tSelect filename", GUIIconSubSys::getIcon(GUIIcon::OPEN_NET), this, FXDialogBox::ID_ACCEPT, GUIDesignButtonIcon);
56}
57
58
59std::string
61 return "";
62}
63
64
65void
67 myFilenameTextField->setText("");
68}
69
70
71GNEToolDialogElements::Separator::Separator(FXComposite* parent, const std::string name) :
72 FXVerticalFrame(parent, GUIDesignAuxiliarHorizontalFrame) {
73 new FXLabel(this, name.c_str(), nullptr, GUIDesignLabelCenterThick);
74}
75
76/****************************************************************************/
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:870
#define GUIDesignButtonIcon
button only with icon
Definition: GUIDesigns.h:86
#define GUIDesignTextField
Definition: GUIDesigns.h:48
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:397
#define GUIDesignLabelLeftThick
label extended over frame with thick and with text justify to left
Definition: GUIDesigns.h:229
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:69
#define GUIDesignLabelCenterThick
label extended over frame with thick and with text justify to center
Definition: GUIDesigns.h:235
const std::string parameter
parameter
FileNameArgument(FXComposite *parent, GNEToolDialog *toolDialogParent, const std::string name, const std::string parameter)
constructor
std::string getArgument() const
get argument (parameter and value)
FXTextField * myFilenameTextField
filename Textfield
Separator(FXComposite *parent, const std::string name)
constructor
Abstract dialog for tools.
Definition: GNEToolDialog.h:40
void addArgument(GNEToolDialogElements::Argument *argument)
add argument
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon