Eclipse SUMO - Simulation of Urban MObility
GNEUndoListDialog.h
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// 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
58 void hide();
59
61 bool shown() const;
62
64 void setFocus();
65
69 long onCmdClose(FXObject*, FXSelector, void*);
70
72 long onCmdSelectRow(FXObject*, FXSelector, void*);
73
75
76protected:
78 FOX_CONSTRUCTOR(GNEUndoListDialog)
79
80
81 void updateList();
82
84 void recalcList();
85
87 struct UndoListRow {
89 UndoListRow(const int index_, FXIcon* icon_, const std::string text_);
90
92 int index = 0;
93
95 FXIcon* icon = nullptr;
96
98 std::string text;
99 };
100
102 class GUIRow {
103
104 public:
106 GUIRow(GNEUndoListDialog* undoListDialog, FXVerticalFrame* mainFrame, MFXStaticToolTip* staticToolTip);
107
109 ~GUIRow();
110
112 void update(const UndoListRow& row);
113
115 int getIndex() const;
116
118 const FXRadioButton* getRadioButton() const;
119
121 void setRedBackground();
122
124 void setBlueBackground();
125
127 void checkRow();
128
129 private:
131 FXRadioButton* myRadioButton;
132
134 int myIndex = 0;
135
137 FXLabel* myIcon = nullptr;
138
141 };
142
145
147 FXVerticalFrame* myRowFrame = nullptr;
148
150 std::vector<GUIRow*> myGUIRows;
151
152private:
155
158};
159
The main window of the 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)
int getIndex() const
get index
void setBlueBackground()
set blue blackground
void setRedBackground()
set red background
GUIRow(GNEUndoListDialog *undoListDialog, FXVerticalFrame *mainFrame, MFXStaticToolTip *staticToolTip)
constructor
void update(const UndoListRow &row)
update row
FXLabel * myIcon
label with icon
FXRadioButton * myRadioButton
radioButton
MFXTextFieldTooltip * myTextFieldTooltip
textField tooltip
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(GNEApplicationWindow *GNEApp)
FOX-declaration.
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
UndoListRow(const int index_, FXIcon *icon_, const std::string text_)
constructor
std::string text
definition of undo/redo operation