/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2006-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file MFXListIconItem.h14/// @author Pablo Alvarez Lopez15/// @date Feb 202316///17//18/****************************************************************************/19#pragma once20#include <config.h>2122#include "fxheader.h"2324// ===========================================================================25// class declaration26// ===========================================================================2728class MFXListIcon;2930// ===========================================================================31// class definitions32// ===========================================================================3334class MFXListIconItem : public FXObject {35/// @brief FOX declaration36FXDECLARE(MFXListIconItem)3738/// @brief declare friend class39friend class MFXListIcon;4041public:42enum {43SELECTED = 1, /// Selected44FOCUS = 2, /// Focus45DISABLED = 4, /// Disabled46DRAGGABLE = 8, /// Draggable47ICONOWNED = 16 /// Icon owned by item48};4950/// @brief Construct new item with given text, icon, and user-data51MFXListIconItem(const FXString& text, FXIcon* ic = NULL, FXColor backGroundColor = 0, void* ptr = NULL);5253/// @brief Destroy item and free icons if owned54~MFXListIconItem();5556/// @brief Change item's text label57void setText(const FXString& txt);5859/// @brief Return item's text label60const FXString& getText() const;6162/// @brief Return item's icon63FXIcon* getIcon() const;6465/// @brief get background color66const FXColor& getBackGroundColor() const;6768/// @brief Make item draw as focused69void setFocus(FXbool focus);7071/// @brief Return true if item has focus72FXbool hasFocus() const;7374/// @brief Select item75void setSelected(FXbool selected);7677/// @brief Return true if this item is selected78FXbool isSelected() const;7980/// @brief Enable or disable item81void setEnabled(FXbool enabled);8283/// @brief Return true if this item is enabled84FXbool isEnabled() const;8586/// @brief Make item draggable87void setDraggable(FXbool draggable);8889/// @brief Return true if this item is draggable90FXbool isDraggable() const;9192/// @brief Return width of item as drawn in list93FXint getWidth(const MFXListIcon* list) const;9495/// @brief Return height of item as drawn in list96FXint getHeight(const MFXListIcon* list) const;9798/// @brief Create server-side resources99void create();100101/// @brief Detach server-side resources102void detach();103104/// @brief Destroy server-side resources105void destroy();106107protected:108/// @brief FOX need this109MFXListIconItem();110111/// @brief daraw112void draw(const MFXListIcon* list, FXDC& dc, FXint x, FXint y, FXint w, FXint h);113114/// @brief hit item115FXint hitItem(const MFXListIcon* list, FXint x, FXint y) const;116117/// @brief label118FXString label;119120/// @brief icon121FXIcon* icon = nullptr;122123/// @brief data124void* data = nullptr;125126/// @brief state127FXuint state = 0;128129/// @brief position130FXint x = 0;131FXint y = 0;132133/// @brief backGround color134FXColor myBackGroundColor = 0;135136/// @brief flag for show/hidde element137bool show = true;138139private:140/// @brief invalidate copy constructor141MFXListIconItem(const MFXListIconItem&) = delete;142143/// @brief invalidate assign constructor144MFXListIconItem& operator = (const MFXListIconItem&) = delete;145};146147148