/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2026 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 GNEFrame.h14/// @author Pablo Alvarez Lopez15/// @date Jun 201616///17// Abstract class for lateral frames in NetEdit18/****************************************************************************/19#pragma once20#include <config.h>2122#include <string>23#include <vector>2425#include <utils/foxtools/fxheader.h>26#include <utils/xml/SUMOXMLDefinitions.h>2728// ===========================================================================29// class declaration30// ===========================================================================3132class GNEAttributeCarrier;33class GNEViewNet;34class GNEViewParent;3536// ===========================================================================37// class definitions38// ===========================================================================3940class GNEFrame : public FXVerticalFrame {4142public:43/**@brief Constructor44* @brief viewParent GNEViewParent in which this GNEFrame is placed45* @brief viewNet viewNet that uses this GNEFrame46* @brief frameLabel label of the frame47*/48GNEFrame(GNEViewParent* viewParent, GNEViewNet* viewNet, const std::string& frameLabel);4950/// @brief destructor51~GNEFrame();5253/// @brief focus upper element of frame54void focusUpperElement();5556/**@brief show Frame57* @note some GNEFrames needs a re-implementation58*/59virtual void show();6061/**@brief hide Frame62* @note some GNEFrames needs a re-implementation63*/64virtual void hide();6566/// @brief set width of GNEFrame67void setFrameWidth(const int newWidth);6869/// @brief get view net70GNEViewNet* getViewNet() const;7172/// @brief get vertical frame that holds all widgets of frame73FXVerticalFrame* getContentFrame() const;7475/// @brief get the label for the frame's header76FXLabel* getFrameHeaderLabel() const;7778/// @brief get font of the header's frame79FXFont* getFrameHeaderFont() const;8081/// @brief get scrollBar width (zero if is hidden)82int getScrollBarWidth() const;8384/// @brief Open help attributes dialog85void openHelpAttributesDialog(const GNEAttributeCarrier* AC) const;8687/// @brief function called after undo/redo in the current frame (can be reimplemented in frame children)88virtual void updateFrameAfterUndoRedo();8990/// @brief function called after setting new width in current frame (can be reimplemented in frame children)91virtual void frameWidthUpdated();9293/// @name functions called by moduls that can be reimplemented in frame children (note: reimplement as protected, just for safety)94/// @{9596/// @brief Tag selected in GNETagSelector97virtual void tagSelected();9899/// @brief selected demand element in DemandElementSelector100virtual void demandElementSelected();101102/// @brief build a shaped element using the drawed shape103virtual bool shapeDrawed();104105/// @brief function called after set a valid attribute in AttributeCreator/AttributeEditor/ParametersEditor/...106virtual void attributeUpdated(SumoXMLAttr attribute);107108/// @brief open GNEAttributesCreator extended dialog109virtual void selectedOverlappedElement(GNEAttributeCarrier* AC);110111/// @brief create path between two elements112virtual bool createPath(const bool useLastRoute);113114/// @}115116protected:117/// @brief FOX need this118FOX_CONSTRUCTOR(GNEFrame)119120/// @brief View Net121GNEViewNet* myViewNet = nullptr;122123/// @brief Vertical frame that holds all widgets of frame124FXVerticalFrame* myContentFrame = nullptr;125126/// @brief fame for header elements127FXHorizontalFrame* myHeaderFrame = nullptr;128129/// @brief fame for left header elements130FXHorizontalFrame* myHeaderLeftFrame = nullptr;131132/// @brief fame for right header elements133FXHorizontalFrame* myHeaderRightFrame = nullptr;134135/// @brief get predefinedTagsMML136const std::vector<std::string>& getPredefinedTagsMML() const;137138/// @brief build rainbow in frame modul139static FXLabel* buildRainbow(FXComposite* parent);140141private:142/// @brief scroll windows that holds the content frame143FXScrollWindow* myScrollWindowsContents = nullptr;144145/// @brief static Font for the Header (it's common for all headers, then create only one time)146static FXFont* myFrameHeaderFont;147148/// @brief the label for the frame's header149FXLabel* myFrameHeaderLabel = nullptr;150151/// @brief Map of attribute ids to their (readable) string-representation (needed for SUMOSAXAttributesImpl_Cached)152std::vector<std::string> myPredefinedTagsMML;153154/// @brief Invalidated copy constructor.155GNEFrame(const GNEFrame&) = delete;156157/// @brief Invalidated assignment operator.158GNEFrame& operator=(const GNEFrame&) = delete;159};160161162