/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2004-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 MFXLCDLabel.h14/// @author Mathew Robertson15/// @author Daniel Krajzewicz16/// @author Michael Behrisch17/// @author Pablo Alvarez Lopez18/// @date 2004-03-1919///20//21/****************************************************************************/22#pragma once23#include <config.h>2425#include "fxheader.h"2627// ===========================================================================28// class declaration29// ===========================================================================3031class MFXStaticToolTip;3233// ===========================================================================34// class definitions35// ===========================================================================3637class MFXLCDLabel : public FXHorizontalFrame {38/// @brief FOX-declaration39FXDECLARE(MFXLCDLabel)4041public:42/// @brief LCD Label styles43enum {44LCDLABEL_NORMAL = FRAME_SUNKEN | FRAME_THICK,45LCDLABEL_LEADING_ZEROS = 0x01000000 /// leading zero's on label - useful for integers46};4748/// @brief call messages49enum {50ID_SEVENSEGMENT = FXHorizontalFrame::ID_LAST,51ID_LAST52};5354public:55/// @brief constructor56MFXLCDLabel(FXComposite* p, MFXStaticToolTip* staticToolTip, FXuint nfig, FXObject* tgt, FXSelector sel, FXuint opts = LCDLABEL_NORMAL, FXint pl = DEFAULT_PAD, FXint pr = DEFAULT_PAD, FXint pt = DEFAULT_PAD, FXint pb = DEFAULT_PAD, FXint hs = DEFAULT_PAD);5758/// @brief destructor59virtual ~MFXLCDLabel();6061/// @brief create resrouces62virtual void create();6364/// @brief detach resources65virtual void detach();6667/// @brief destroy resources68virtual void destroy();6970/// @brief manipulate text in LCD label71void setText(FXString lbl);7273/// @brief get text74FXString getText() const;7576/// @brief set forground color77void setFgColor(FXColor clr);7879/// @brief get forground color80FXColor getFgColor() const;8182/// @brief set background color83void setBgColor(FXColor clr);8485/// @brief get background color86FXColor getBgColor() const;8788/// @brief set segment horizontal length - must be more than twice the segment width89void setHorizontal(const FXint len);9091/// @brief get segment horizontal length - must be more than twice the segment width92FXint getHorizontal() const;9394/// @brief set segment vertical length - must be more than twice the segment width95void setVertical(const FXint len);9697/// @brief get segment vertical length - must be more than twice the segment width98FXint getVertical() const;99100/// @brief set segment width - must be less than half the segment length101void setThickness(const FXint w);102103/// @brief get segment width - must be less than half the segment length104FXint getThickness() const;105106/// @brief set groove width - must be less than segment width107void setGroove(const FXint w);108109/// @brief get groove width - must be less than segment width110FXint getGroove() const;111112/// @brief return minimum width113virtual FXint getDefaultWidth();114115/// @brief return minimum height116virtual FXint getDefaultHeight();117118/// @brief set tooltip text119void setToolTipText(const FXString& text);120121/// @brief save resources122virtual void save(FXStream& store) const;123124/// @brief load resources125virtual void load(FXStream& store);126127/// @brief handle paint event128long onPaint(FXObject*, FXSelector, void*);129130/// @brief called when mouse enter in MFXMenuButtonTooltip131long onEnter(FXObject* obj, FXSelector sel, void* ptr);132133/// @brief called when mouse leaves in MFXMenuButtonTooltip134long onLeave(FXObject* obj, FXSelector sel, void* ptr);135136/// @brief called when mouse motion in MFXMenuButtonTooltip137long onMotion(FXObject* obj, FXSelector sel, void* ptr);138139/// @brief Update value from a message140long onCmdSetValue(FXObject*, FXSelector, void* ptr);141142/// @brief Update int value from a message143long onCmdSetIntValue(FXObject*, FXSelector, void* ptr);144145/// @brief Update real value from a message146long onCmdSetRealValue(FXObject*, FXSelector, void* ptr);147148/// @brief Update string value from a message149long onCmdSetStringValue(FXObject*, FXSelector, void* ptr);150151/// @brief Obtain int value from text field152long onCmdGetIntValue(FXObject*, FXSelector, void* ptr);153154/// @brief Obtain real value from text field155long onCmdGetRealValue(FXObject*, FXSelector, void* ptr);156157/// @brief Obtain string value from text field158long onCmdGetStringValue(FXObject*, FXSelector, void* ptr);159160/// @brief redirect events to main window161long onRedirectEvent(FXObject*, FXSelector, void* ptr);162163/// @brief let parent show tip if appropriate164long onQueryTip(FXObject*, FXSelector, void* ptr);165166/// @brief let parent show help if appropriate167long onQueryHelp(FXObject*, FXSelector, void* ptr);168169protected:170/// @brief FOX constructor171FOX_CONSTRUCTOR(MFXLCDLabel)172173/// @brief The currently shown label174FXString myLabel;175176/// @brief The number of shown figuresi, greater than zero177FXint myNFigures;178179/// @brief pointer to staticToolTip180MFXStaticToolTip* myStaticToolTip;181182/// @brief toolTip text183FXString myToolTipText;184185/// @brief Draw a string186void drawString(const FXString& lbl);187};188189190