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.dev/sumo
3 // Copyright (C) 2001-2024 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 
32 class GNEUndoList;
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
38 
43 class GNEUndoListDialog : protected FXTopWindow {
45  FXDECLARE(GNEUndoListDialog)
46 
47 public:
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 
76 protected:
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 description_, const std::string timestamp_);
90 
92  int index = 0;
93 
95  FXIcon* icon = nullptr;
96 
98  std::string description;
99 
101  std::string timestamp;
102  };
103 
105  class GUIRow {
106 
107  public:
109  GUIRow(GNEUndoListDialog* undoListDialog, FXVerticalFrame* mainFrame, MFXStaticToolTip* staticToolTip);
110 
112  ~GUIRow();
113 
115  void update(const UndoListRow& row);
116 
118  int getIndex() const;
119 
121  const FXRadioButton* getRadioButton() const;
122 
124  void setRedBackground();
125 
127  void setBlueBackground();
128 
130  void checkRow();
131 
132  private:
134  FXRadioButton* myRadioButton;
135 
137  int myIndex = 0;
138 
140  FXLabel* myIcon = nullptr;
141 
144 
146  FXTextField* myTextFieldTimeStamp = nullptr;
147  };
148 
151 
153  FXVerticalFrame* myRowFrame = nullptr;
154 
156  std::vector<GUIRow*> myGUIRows;
157 
158 private:
161 
164 };
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
GUIRow(GNEUndoListDialog *undoListDialog, FXVerticalFrame *mainFrame, MFXStaticToolTip *staticToolTip)
constructor
void update(const UndoListRow &row)
update row
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(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 description_, const std::string timestamp_)
constructor
std::string description
definition of undo/redo operation