Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/dialogs/GNEColorDialog.h
169678 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2006-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 GNEColorDialog.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Aug 2025
17
///
18
// Custom GNEColorDialog used in Netedit that supports internal tests
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <utils/common/RGBColor.h>
24
25
#include "GNEDialog.h"
26
27
// ===========================================================================
28
// class definitions
29
// ===========================================================================
30
31
class GNEColorDialog : public GNEDialog {
32
FXDECLARE(GNEColorDialog)
33
34
public:
35
/// @brief Construct color dialog
36
GNEColorDialog(GNEApplicationWindow* applicationWindow, const RGBColor color);
37
38
/// @brief Destructor
39
virtual ~GNEColorDialog();
40
41
/// @brief run internal test
42
void runInternalTest(const InternalTestStep::DialogArgument* dialogArgument);
43
44
/// @brief Get the color
45
RGBColor getColor() const;
46
47
/// @name FOX-callbacks
48
/// @{
49
50
/// @brief called when reset button is pressed
51
long onCmdReset(FXObject*, FXSelector, void*);
52
53
/// @brief Called when color is changed
54
long onChgColor(FXObject*, FXSelector, void*);
55
56
/// @brief Called when color is selected
57
long onCmdColor(FXObject*, FXSelector, void*);
58
59
/// @}
60
61
protected:
62
/// @brief Default constructor
63
FOX_CONSTRUCTOR(GNEColorDialog)
64
65
/// @brief Color selector box
66
FXColorSelector* myColorbox = nullptr;
67
68
/// @brief Original color to restore pressing reset button
69
const RGBColor myOriginalColor = RGBColor::BLACK;
70
71
private:
72
/// @brief Invalidated copy constructor.
73
GNEColorDialog(const GNEColorDialog&) = delete;
74
75
/// @brief Invalidated assignment operator
76
GNEColorDialog& operator=(const GNEColorDialog& src) = delete;
77
};
78
79