Path: blob/main/src/utils/gui/globjects/GUIGLObjectPopupMenu.h
169685 views
/****************************************************************************/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 GUIGLObjectPopupMenu.h14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @author Michael Behrisch17/// @date Sept 200218///19// The popup menu of a globject.20/****************************************************************************/21#pragma once22#include <config.h>2324#include <vector>25#include <utils/foxtools/fxheader.h>26#include <utils/geom/Position.h>272829// ===========================================================================30// class declarations31// ===========================================================================3233class GUISUMOAbstractView;34class GUIGlObject;35class GUIMainWindow;3637// ===========================================================================38// class definitions39// ===========================================================================40/**41* @class GUIGLObjectPopupMenu42* @brief The popup menu of a globject43*/44class GUIGLObjectPopupMenu : public FXMenuPane {45// FOX-declarations46FXDECLARE(GUIGLObjectPopupMenu)4748public:4950/// @name cursor dialog type51enum class PopupType {52ATTRIBUTES,53PROPERTIES,54SELECT_ELEMENT,55DELETE_ELEMENT,56FRONT_ELEMENT57};5859/** @brief Constructor60* @param[in] app The main window for instantiation of other windows61* @param[in] parent The parent view for changing it62* @param[in] o The object of interest63*/64GUIGLObjectPopupMenu(GUIMainWindow& app, GUISUMOAbstractView& parent, GUIGlObject* o);6566/** @brief Constructor67* @param[in] app The main window for instantiation of other windows68* @param[in] parent The parent view for changing it69*/70GUIGLObjectPopupMenu(GUIMainWindow* app, GUISUMOAbstractView* parent, PopupType popupType);7172/// @brief Destructor73virtual ~GUIGLObjectPopupMenu();7475/// @brief Insert a sub-menu pane in this GUIGLObjectPopupMenu76void insertMenuPaneChild(FXMenuPane* child);7778// @brief remove popup menu from objects79void removePopupFromObject();8081/// @brief return the real owner of this popup82GUISUMOAbstractView* getParentView();8384/// @brief The object that belongs to this popup-menu85GUIGlObject* getGLObject() const;8687/// @brief popup type;88PopupType getPopupType() const;8990/// @name FX Calls91/// @{92/// @brief Called if the assigned objects shall be centered93long onCmdCenter(FXObject*, FXSelector, void*);9495/// @brief Called if the name shall be copied to clipboard96long onCmdCopyName(FXObject*, FXSelector, void*);9798/// @brief Called if the typed name shall be copied to clipboard99long onCmdCopyTypedName(FXObject*, FXSelector, void*);100101/// @brief Called if the edge name shall be copied to clipboard (for lanes only)102long onCmdCopyEdgeName(FXObject*, FXSelector, void*);103104/// @brief Called if the test coordinates shall be copied to clipboard (only if gui-testing option is enabled)105long onCmdCopyTestCoordinates(FXObject*, FXSelector, void*);106107/// @brief Called if the cursor position shall be copied to clipboard108long onCmdCopyCursorPosition(FXObject*, FXSelector, void*);109110/// @brief Called if the cursor geo-position shall be copied to clipboard111long onCmdCopyCursorGeoPosition(FXObject*, FXSelector, void*);112113/// @brief Called if the current geo-boundary shall be copied to clipboard114long onCmdCopyViewGeoBoundary(FXObject*, FXSelector, void*);115116/// @brief Called if the cursor geo-position shall be shown online117long onCmdShowCursorGeoPositionOnline(FXObject*, FXSelector, void*);118119/// @brief Called if the parameter of this object shall be shown120long onCmdShowPars(FXObject*, FXSelector, void*);121122/// @brief Called if the type parameter of this object shall be shown123long onCmdShowTypePars(FXObject*, FXSelector, void*);124125/// @brief Called if the object shall be added to the list of selected objects126long onCmdAddSelected(FXObject*, FXSelector, void*);127128/// @brief Called if the object shall be removed from the list of selected objects129long onCmdRemoveSelected(FXObject*, FXSelector, void*);130131/// @}132133protected:134/// @brief FOX needs this135GUIGLObjectPopupMenu();136137/// @brief The parent window138GUISUMOAbstractView* myParent;139140/// @brief The object that belongs to this popup-menu141GUIGlObject* myObject;142143/// @brief The main application144GUIMainWindow* myApplication;145146/// @brief popup type;147const PopupType myPopupType;148149/// @brief The position within the network the cursor was above when instanting the popup150const Position myNetworkPosition;151152/// @brief The test coordinates position when instanting the popup153const std::string myTestCoordinates;154155/// @brief vector mit Sub-MenuPanes156std::vector<FXMenuPane*> myMenuPanes;157};158159160