/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file GNEUndoListDialog.h14/// @author Pablo Alvarez Lopez15/// @date Oct 202116///17// Dialog for show undo-list18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNEDialog.h"2324// ===========================================================================25// class declarations26// ===========================================================================2728class MFXTextFieldIcon;2930// ===========================================================================31// class definitions32// ===========================================================================3334class GNEUndoListDialog : public GNEDialog {35/// @brief FOX-declaration36FXDECLARE(GNEUndoListDialog)3738public:39/// @brief Constructor40GNEUndoListDialog(GNEApplicationWindow* applicationWindow);4142/// @brief destructor43~GNEUndoListDialog();4445/// @brief run internal test46void runInternalTest(const InternalTestStep::DialogArgument* dialogArgument);4748/// @name FOX-callbacks49/// @{5051/// @brief event after select row52long onCmdSelectRow(FXObject*, FXSelector, void*);5354/// @}5556protected:57/// @struct class for keep every row value58struct UndoListRow {59/// @brief constructor60UndoListRow(const int index_, FXIcon* icon_, const std::string description_, const std::string timestamp_);6162/// @brief index uses for count undo/redos63int index = 0;6465/// @brief icon associated with undo/redo operation66FXIcon* icon = nullptr;6768/// @brief definition of undo/redo operation69std::string description;7071/// @brief timestamp72std::string timestamp;73};7475/// @brief row used for show GUI row elements76class GUIRow {7778public:79/// @brief constructor80GUIRow(GNEUndoListDialog* undoListDialog, FXVerticalFrame* mainFrame, MFXStaticToolTip* staticToolTip);8182/// @brief destructor83~GUIRow();8485/// @brief update row86void update(const UndoListRow& row);8788/// @brief get index89int getIndex() const;9091/// @brief get radio button (read only)92const FXRadioButton* getRadioButton() const;9394/// @brief set red background95void setRedBackground();9697/// @brief set blue background98void setBlueBackground();99100/// @brief check row and set background green101void checkRow();102103private:104/// @brief radioButton105FXRadioButton* myRadioButton;106107/// @brief index108int myIndex = 0;109110/// @brief label with icon111FXLabel* myIcon = nullptr;112113/// @brief textField description114MFXTextFieldIcon* myTextFieldDescription = nullptr;115116/// @brief textField timeStamp117FXTextField* myTextFieldTimeStamp = nullptr;118};119120/// @brief FOX needs this121FOX_CONSTRUCTOR(GNEUndoListDialog)122123/// @brief update list destroying and creating rows124void updateList();125126/// @brief frame for rows127FXVerticalFrame* myRowFrame = nullptr;128129/// @brief vector with rows130std::vector<GUIRow*> myGUIRows;131132private:133/// @brief Invalidated copy constructor.134GNEUndoListDialog(const GNEUndoListDialog&) = delete;135136/// @brief Invalidated assignment operator.137GNEUndoListDialog& operator=(const GNEUndoListDialog&) = delete;138};139140141