Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/dialogs/GNEColorDialog.h
193674 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2006-2026 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 Constructor
36
GNEColorDialog(GNEApplicationWindow* applicationWindow, const RGBColor color);
37
38
/// @brief Constructor with parent dialog
39
GNEColorDialog(GNEApplicationWindow* applicationWindow, GNEDialog* parentDialog,
40
const RGBColor color);
41
42
/// @brief Destructor
43
virtual ~GNEColorDialog();
44
45
/// @brief run internal test
46
void runInternalTest(const InternalTestStep::DialogArgument* dialogArgument);
47
48
/// @brief Get the color
49
RGBColor getColor() const;
50
51
/// @name FOX-callbacks
52
/// @{
53
54
/// @brief called when reset button is pressed
55
long onCmdReset(FXObject*, FXSelector, void*);
56
57
/// @brief Called when color is changed
58
long onChgColor(FXObject*, FXSelector, void*);
59
60
/// @brief Called when color is selected
61
long onCmdColor(FXObject*, FXSelector, void*);
62
63
/// @}
64
65
protected:
66
/// @brief Default constructor
67
FOX_CONSTRUCTOR(GNEColorDialog)
68
69
/// @brief Color selector box
70
FXColorSelector* myColorbox = nullptr;
71
72
/// @brief Original color to restore pressing reset button
73
const RGBColor myOriginalColor = RGBColor::BLACK;
74
75
private:
76
/// @brief builder
77
void builder(const RGBColor color);
78
79
/// @brief Invalidated copy constructor.
80
GNEColorDialog(const GNEColorDialog&) = delete;
81
82
/// @brief Invalidated assignment operator
83
GNEColorDialog& operator=(const GNEColorDialog& src) = delete;
84
};
85
86