Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEUndoListDialog.h
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// Dialog for show undo-list
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24#include <vector>
25#include <string>
26
27
28// ===========================================================================
29// class declarations
30// ===========================================================================
31
32class GNEUndoList;
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
38
43class GNEUndoListDialog : protected FXTopWindow {
45 FXDECLARE(GNEUndoListDialog)
46
47public:
50
53
55 void show();
56 using FXTopWindow::show; // to silence the warning C4266 about a hidden function
57
59 void hide();
60
62 bool shown() const;
63
65 void setFocus();
66
70 long onCmdClose(FXObject*, FXSelector, void*);
71
73 long onCmdSelectRow(FXObject*, FXSelector, void*);
74
76
77protected:
79 FOX_CONSTRUCTOR(GNEUndoListDialog)
80
81
82 void updateList();
83
85 void recalcList();
86
88 struct UndoListRow {
90 UndoListRow(const int index_, FXIcon* icon_, const std::string description_, const std::string timestamp_);
91
93 int index = 0;
94
96 FXIcon* icon = nullptr;
97
99 std::string description;
100
102 std::string timestamp;
103 };
104
106 class GUIRow {
107
108 public:
110 GUIRow(GNEUndoListDialog* undoListDialog, FXVerticalFrame* mainFrame, MFXStaticToolTip* staticToolTip);
111
113 ~GUIRow();
114
116 void update(const UndoListRow& row);
117
119 int getIndex() const;
120
122 const FXRadioButton* getRadioButton() const;
123
125 void setRedBackground();
126
128 void setBlueBackground();
129
131 void checkRow();
132
133 private:
135 FXRadioButton* myRadioButton;
136
138 int myIndex = 0;
139
141 FXLabel* myIcon = nullptr;
142
145
147 FXTextField* myTextFieldTimeStamp = nullptr;
148 };
149
152
154 FXVerticalFrame* myRowFrame = nullptr;
155
157 std::vector<GUIRow*> myGUIRows;
158
159private:
162
165};
The main window of Netedit.
row used for show GUI row elements
void checkRow()
check row and set background green
const FXRadioButton * getRadioButton() const
get radio button (read only)
MFXTextFieldTooltip * myTextFieldDescription
textField description
int getIndex() const
get index
void setBlueBackground()
set blue background
void setRedBackground()
set red background
FXTextField * myTextFieldTimeStamp
textField timeStamp
FXLabel * myIcon
label with icon
FXRadioButton * myRadioButton
radioButton
Dialog for edit rerouters.
void updateList()
FOX needs this.
long onCmdSelectRow(FXObject *, FXSelector, void *)
event after select row
~GNEUndoListDialog()
destructor
void show()
show window
long onCmdClose(FXObject *, FXSelector, void *)
bool shown() const
check if dialog is shown
void setFocus()
Move the focus to this window.
GNEUndoListDialog & operator=(const GNEUndoListDialog &)=delete
Invalidated assignment operator.
void hide()
hide window
GNEApplicationWindow * myGNEApp
pointer to GNEApplicationWindow
FXVerticalFrame * myRowFrame
frame for rows
std::vector< GUIRow * > myGUIRows
vector with rows
GNEUndoListDialog(const GNEUndoListDialog &)=delete
Invalidated copy constructor.
void recalcList()
recalc list destroying and creating rows
MFXStaticToolTip (based on FXToolTip)
int index
index uses for count undo/redos
FXIcon * icon
icon associated with undo/redo operation
std::string description
definition of undo/redo operation