/****************************************************************************/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 MFXMenuCheckIcon.h14/// @author Pablo Alvarez Lopez15/// @date Jan 202116///17//18/****************************************************************************/1920#pragma once21#include <config.h>222324#include "fxheader.h"25#include <string>2627/**28* The menu check widget is used to change a state in the29* application from a menu. Menu checks may reflect30* the state of the application by graying out, becoming hidden,31* or by a check mark.32* When activated, a menu check sends a SEL_COMMAND to its target;33* the void* argument of the message contains the new state.34*/35class MFXMenuCheckIcon : public FXMenuCommand {36/// @brief FOX-declaration37FXDECLARE(MFXMenuCheckIcon)3839public:40/// @brief Construct a menu check41MFXMenuCheckIcon(FXComposite* p, const std::string& text, const std::string& shortcut, const std::string& info, const FXIcon* icon, FXObject* tgt = NULL, FXSelector sel = 0, FXuint opts = 0);4243/// @brief Return default width44virtual FXint getDefaultWidth();4546/// @brief Return default height47virtual FXint getDefaultHeight();4849/// @brief Set check state (TRUE, FALSE or MAYBE)50void setCheck(FXbool s = TRUE);5152/// @brief Toggle current check state53void toggleCheck();5455/// @brief Get check state (TRUE, FALSE or MAYBE)56FXbool getCheck() const;5758/// @brief Get the box background color59FXColor getBoxColor() const;6061/// @brief Set the box background color62void setBoxColor(FXColor clr);6364/// @brief Save menu to a stream65virtual void save(FXStream& store) const;6667/// @brief Load menu from a stream68virtual void load(FXStream& store);6970/// @name FOX calls71/// @{72long onPaint(FXObject*, FXSelector, void*);73long onButtonPress(FXObject*, FXSelector, void*);74long onButtonRelease(FXObject*, FXSelector, void*);75long onKeyPress(FXObject*, FXSelector, void*);76long onKeyRelease(FXObject*, FXSelector, void*);77long onHotKeyPress(FXObject*, FXSelector, void*);78long onHotKeyRelease(FXObject*, FXSelector, void*);79long onCheck(FXObject*, FXSelector, void*);80long onUncheck(FXObject*, FXSelector, void*);81long onUnknown(FXObject*, FXSelector, void*);82long onCmdSetValue(FXObject*, FXSelector, void*);83long onCmdSetIntValue(FXObject*, FXSelector, void*);84long onCmdGetIntValue(FXObject*, FXSelector, void*);85long onCmdAccel(FXObject*, FXSelector, void*);86/// @}8788protected:89/// @brief default constructor90MFXMenuCheckIcon();9192/// @brief Icon93const FXIcon* myIcon;9495/// @brief State of menu96FXuchar myCheck;9798/// @brief Box color99FXColor myBoxColor;100101private:102/// @brief Invalidated copy constructor.103MFXMenuCheckIcon(const MFXMenuCheckIcon&) = delete;104105/// @brief Invalidated assignment operator.106MFXMenuCheckIcon& operator=(const MFXMenuCheckIcon&) = delete;107};108109110