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