Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEHelpAttributesDialog.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-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/****************************************************************************/
18// Help dialog used in netedit
19/****************************************************************************/
20
25
27
28// ===========================================================================
29// method definitions
30// ===========================================================================
31
33 const GNEAttributeCarrier* AC) :
34 GNEDialog(applicationWindow, TLF("Parameters of %", AC->getTagStr()).c_str(), GUIIcon::MODEINSPECT,
35 GNEDialog::Buttons::OK, OpenType::MODAL, ResizeMode::RESIZABLE) {
36 // Create FXTable
37 FXTable* myTable = new FXTable(myContentFrame, this, MID_TABLE, GUIDesignTableNotEditable);
38 // configure table
39 int sizeColumnDescription = 0;
40 int sizeColumnDefinitions = 0;
41 myTable->setVisibleRows((FXint)(AC->getTagProperty()->getNumberOfAttributes()));
42 myTable->setVisibleColumns(4);
43 myTable->setTableSize((FXint)(AC->getTagProperty()->getNumberOfAttributes()), 4);
44 myTable->setBackColor(GUIDesignBackgroundColorWhite);
45 myTable->setColumnText(0, TL("Attribute"));
46 myTable->setColumnText(1, TL("Category"));
47 myTable->setColumnText(2, TL("Description"));
48 myTable->setColumnText(3, TL("Definition"));
49 myTable->getRowHeader()->setWidth(0);
50 myTable->setColumnHeaderHeight(GUIDesignHeight);
51 // Iterate over vector of additional parameters
52 int itemIndex = 0;
53 for (const auto& attrProperty : AC->getTagProperty()->getAttributeProperties()) {
54 // Set attribute
55 FXTableItem* attributeItem = new FXTableItem(attrProperty->getAttrStr().c_str());
56 attributeItem->setJustify(FXTableItem::CENTER_X);
57 myTable->setItem(itemIndex, 0, attributeItem);
58 // Set description of element
59 FXTableItem* categoryItem = new FXTableItem("");
60 categoryItem->setText(attrProperty->getCategory().c_str());
61 categoryItem->setJustify(FXTableItem::CENTER_X);
62 myTable->setItem(itemIndex, 1, categoryItem);
63 // Set description of element
64 FXTableItem* descriptionItem = new FXTableItem("");
65 descriptionItem->setText(attrProperty->getDescription().c_str());
66 sizeColumnDescription = MAX2(sizeColumnDescription, (int)attrProperty->getDescription().size());
67 descriptionItem->setJustify(FXTableItem::CENTER_X);
68 myTable->setItem(itemIndex, 2, descriptionItem);
69 // Set definition
70 FXTableItem* definitionItem = new FXTableItem(attrProperty->getDefinition().c_str());
71 definitionItem->setJustify(FXTableItem::LEFT);
72 myTable->setItem(itemIndex, 3, definitionItem);
73 sizeColumnDefinitions = MAX2(sizeColumnDefinitions, (int)attrProperty->getDefinition().size());
74 itemIndex++;
75 }
76 myTable->fitRowsToContents(0, itemIndex);
77 // set header
78 FXHeader* header = myTable->getColumnHeader();
79 header->setItemJustify(0, JUSTIFY_CENTER_X);
80 header->setItemSize(0, 120);
81 header->setItemJustify(0, JUSTIFY_CENTER_X);
82 header->setItemSize(1, 100);
83 header->setItemJustify(1, JUSTIFY_CENTER_X);
84 header->setItemSize(2, sizeColumnDescription * 8);
85 header->setItemJustify(2, JUSTIFY_CENTER_X);
86 header->setItemSize(3, sizeColumnDefinitions * 6);
87 // open modal dialog
88 openDialog();
89}
90
91
94
95
96void
98 // nothing to do
99}
100
101/****************************************************************************/
@ MID_TABLE
The Table.
Definition GUIAppEnum.h:539
#define GUIDesignTableNotEditable
design for table extended over frame that cannot be edited
Definition GUIDesigns.h:644
#define GUIDesignBackgroundColorWhite
white background color (for valid text)
Definition GUIDesigns.h:47
GUIIcon
An enumeration of icons used by the gui applications.
Definition GUIIcons.h:33
#define TL(string)
Definition MsgHandler.h:305
#define TLF(string,...)
Definition MsgHandler.h:307
int GUIDesignHeight
the default height for GUI elements
Definition StdDefs.cpp:37
T MAX2(T a, T b)
Definition StdDefs.h:86
The main window of Netedit.
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
FXVerticalFrame * myContentFrame
content frame
Definition GNEDialog.h:135
void openDialog(FXWindow *focusableElement=nullptr)
open dialog
OpenType
Open dialog type.
Definition GNEDialog.h:55
void runInternalTest(const InternalTestStep::DialogArgument *dialogArgument)
run internal test
GNEHelpAttributesDialog(GNEApplicationWindow *applicationWindow, const GNEAttributeCarrier *AC)
Constructor.
int getNumberOfAttributes() const
get number of attributes
const std::vector< const GNEAttributeProperties * > & getAttributeProperties() const
get all attribute properties
dialog arguments, used for certain modal dialogs that can not be edited using tab