Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/frames/common/GNEComboBoxAttrProperty.h
185790 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 GNEComboBoxAttrProperty.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Mar 2025
17
///
18
// ComboBox icon specific for attr properties
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <vector>
24
#include <utils/foxtools/MFXComboBoxIcon.h>
25
26
// ===========================================================================
27
// class declaration
28
// ===========================================================================
29
30
class GNEAttributeProperties;
31
32
// ===========================================================================
33
// class definitions
34
// ===========================================================================
35
36
class GNEComboBoxAttrProperty : public MFXComboBoxIcon {
37
38
public:
39
/// @brief Construct a Combo Box widget with room to display cols columns of text
40
GNEComboBoxAttrProperty(FXComposite* p, MFXStaticToolTip* staticToolTip, const bool canSearch, const int visibleItems,
41
FXObject* tgt, FXSelector sel, FXuint opts, FXint x = 0, FXint y = 0, FXint w = 0, FXint h = 0,
42
FXint pl = DEFAULT_PAD, FXint pr = DEFAULT_PAD, FXint pt = DEFAULT_PAD, FXint pb = DEFAULT_PAD);
43
44
/// @brief Destructor
45
~GNEComboBoxAttrProperty();
46
47
/// @brief append item
48
FXint appendAttrItem(const GNEAttributeProperties* attrProperties, FXColor bgColor = FXRGB(255, 255, 255), void* ptr = nullptr);
49
50
/// @brief get attribute properties
51
const GNEAttributeProperties* getAttrProperties(FXint index) const;
52
53
/// @brief get current attribute property
54
const GNEAttributeProperties* getCurrentAttrProperty() const;
55
56
/// @brief Set the current item
57
long setCurrentItem(const GNEAttributeProperties* attrProperties, FXbool notify = FALSE);
58
59
/// @brief check if the given attribute exist in comboBox
60
bool hasAttrProperty(const GNEAttributeProperties* attrProperties);
61
62
/// @brief Remove all items from the list
63
void clearItems();
64
65
private:
66
/// @brief vector with tag properties
67
std::vector<const GNEAttributeProperties*> myAttrProperties;
68
69
/// @brief delete original replace the item at index
70
FXint updateIconItem(FXint index, const FXString& text, FXIcon* icon = nullptr, FXColor bgColor = FXRGB(255, 255, 255), void* ptr = nullptr) = delete;
71
72
/// @brief delete original insert icon item in the given position
73
FXint insertIconItem(FXint index, const FXString& text, FXIcon* icon = nullptr, FXColor bgColor = FXRGB(255, 255, 255), void* ptr = nullptr) = delete;
74
75
/// @brief delete original append icon item in the last position
76
FXint appendIconItem(const FXString& text, FXIcon* icon = nullptr, FXColor bgColor = FXRGB(255, 255, 255), void* ptr = nullptr) = delete;
77
78
/// @brief invalidate copy constructor
79
GNEComboBoxAttrProperty(const GNEComboBoxAttrProperty&) = delete;
80
81
/// @brief invalidate assignment operator
82
GNEComboBoxAttrProperty& operator=(const GNEComboBoxAttrProperty&) = delete;
83
};
84
85