Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/utils/gui/globjects/GUICursorDialog.h
169685 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 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
/****************************************************************************/
14
/// @file GUICursorDialog.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Sep 2022
17
///
18
// Dialog for edit element under cursor
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <utils/foxtools/MFXMenuHeader.h>
24
#include <utils/gui/images/GUIIconSubSys.h>
25
26
#include "GUIGLObjectPopupMenu.h"
27
28
29
// ===========================================================================
30
// class definitions
31
// ===========================================================================
32
33
/**
34
* @class GUICursorDialog
35
* @brief Dialog for edit rerouter intervals
36
*/
37
38
class GUICursorDialog : public GUIGLObjectPopupMenu {
39
/// @brief FOX-declaration
40
FXDECLARE(GUICursorDialog)
41
42
public:
43
/// @brief constructor used for Pop-up dialogs
44
GUICursorDialog(GUIGLObjectPopupMenu::PopupType type, GUISUMOAbstractView* view, const std::vector<GUIGlObject*>& objects);
45
46
/// @brief destructor
47
~GUICursorDialog();
48
49
/// @name FOX-callbacks
50
/// @{
51
52
/// @brief set front element
53
long onCmdSetFrontElement(FXObject*, FXSelector, void*);
54
55
/// @brief delete element
56
long onCmdDeleteElement(FXObject*, FXSelector, void*);
57
58
/// @brief select element
59
long onCmdSelectElement(FXObject*, FXSelector, void*);
60
61
/// @brief open properties popUp
62
long onCmdOpenPropertiesPopUp(FXObject*, FXSelector, void*);
63
64
/// @brief move list up
65
long onCmdMoveListUp(FXObject*, FXSelector, void*);
66
67
/// @brief move list down
68
long onCmdMoveListDown(FXObject*, FXSelector, void*);
69
70
/// @brief move list down
71
long onCmdProcessFront(FXObject*, FXSelector, void*);
72
73
/// @brief unpost
74
long onCmdUnpost(FXObject*, FXSelector, void* ptr);
75
76
/// @}
77
78
protected:
79
/// @brief FOX need this
80
FOX_CONSTRUCTOR(GUICursorDialog)
81
82
/// @brief PopupType
83
GUIGLObjectPopupMenu::PopupType myType;
84
85
/// @brief pointer to view
86
GUISUMOAbstractView* myView;
87
88
/// @brief header
89
MFXMenuHeader* myMenuHeader = nullptr;
90
91
/// @brief menu command for move up list
92
FXMenuCommand* myMoveUpMenuCommand = nullptr;
93
94
/// @brief menu command for move down list
95
FXMenuCommand* myMoveDownMenuCommand = nullptr;
96
97
/// @brief container for menu commands and GLObjects
98
std::vector<std::pair<FXMenuCommand*, GUIGlObject*> > myMenuCommandGLObjects;
99
100
/// @brief list index
101
int myListIndex = 0;
102
103
/// @brief update list
104
void updateList();
105
106
private:
107
/// @brief build dialog elements
108
void buildDialogElements(GUISUMOAbstractView* view, const FXString text, GUIIcon icon,
109
FXSelector sel, const std::vector<GUIGlObject*>& objects);
110
111
/// @brief Invalidated copy constructor.
112
GUICursorDialog(const GUICursorDialog&) = delete;
113
114
/// @brief Invalidated assignment operator.
115
GUICursorDialog& operator=(const GUICursorDialog&) = delete;
116
};
117
118