Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/dialogs/elements/GNEAttributeCarrierDialog.h
169684 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 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
/****************************************************************************/
14
/// @file GNEAttributeCarrierDialog.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Aug 2025
17
///
18
// Dialog for edit attribute carriers
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include "GNETemplateElementDialog.h"
24
25
// ===========================================================================
26
// class declaration
27
// ===========================================================================
28
29
class GNEAttributeCarrier;
30
class MFXTextFieldIcon;
31
32
// ===========================================================================
33
// class definitions
34
// ===========================================================================
35
36
class GNEAttributeCarrierDialog : public GNETemplateElementDialog<GNEAttributeCarrier> {
37
38
public:
39
/// @brief attribute text field
40
class AttributeTextField : public FXHorizontalFrame {
41
// FOX-declarations
42
FXDECLARE(AttributeTextField)
43
44
public:
45
/// @brief constructor
46
AttributeTextField(GNEAttributeCarrierDialog* ACDialog, FXVerticalFrame* verticalFrame,
47
const GNEAttributeProperties* attrProperty);
48
49
/// @name FOX-callbacks
50
/// @{
51
52
/// @brief event after edit text field
53
long onCmdSetAttribute(FXObject* obj, FXSelector, void*);
54
55
/// @brief called when user press "edit color" dialog
56
long onCmdOpenColorDialog(FXObject* sender, FXSelector, void* arg);
57
58
/// @brief called when user press vClass dialog
59
long onCmdOpenVClassDialog(FXObject*, FXSelector, void*);
60
61
/// @}
62
63
protected:
64
/// @brief FOX needs this
65
FOX_CONSTRUCTOR(AttributeTextField)
66
67
/// @brief pointer to ACDialog parent
68
GNEAttributeCarrierDialog* myACDialogParent = nullptr;
69
70
/// @brief attribute property
71
const GNEAttributeProperties* myAttrProperty = nullptr;
72
73
/// @brief attribute button (color or allow)
74
MFXButtonTooltip* myAttributeButton = nullptr;
75
76
/// @brief text field for attribute
77
MFXTextFieldIcon* myTextField = nullptr;
78
79
/// @brief check button for true/false
80
FXCheckButton* myCheckButton = nullptr;
81
82
private:
83
/// @brief Invalidated copy constructor.
84
AttributeTextField(const AttributeTextField&) = delete;
85
86
/// @brief Invalidated assignment operator.
87
AttributeTextField& operator=(const AttributeTextField&) = delete;
88
};
89
90
/// @brief constructor
91
GNEAttributeCarrierDialog(GNEAttributeCarrier* AC);
92
93
/// @brief destructor
94
~GNEAttributeCarrierDialog();
95
96
/// @brief run internal test
97
void runInternalTest(const InternalTestStep::DialogArgument* dialogArgument);
98
99
/// @name FOX-callbacks
100
/// @{
101
102
/// @brief event after press accept button
103
long onCmdAccept(FXObject*, FXSelector, void*);
104
105
/// @brief event after press reset button
106
long onCmdReset(FXObject*, FXSelector, void*);
107
108
/// @}
109
110
protected:
111
/// @brief list of attribute text fields
112
std::vector<AttributeTextField*> myAttributeTextFields;
113
114
private:
115
/// @brief Invalidated copy constructor.
116
GNEAttributeCarrierDialog(const GNEAttributeCarrierDialog&) = delete;
117
118
/// @brief Invalidated assignment operator.
119
GNEAttributeCarrierDialog& operator=(const GNEAttributeCarrierDialog&) = delete;
120
};
121
122