/****************************************************************************/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 MFXCheckableButton.h14/// @author Daniel Krajzewicz15/// @date 2004-03-1916///17// Checkable button similar to a FXButton but maintain the check18/****************************************************************************/19#pragma once20#include <config.h>2122#include <string>2324#include "fxheader.h"2526// ===========================================================================27// class declaration28// ===========================================================================2930class MFXStaticToolTip;3132// ===========================================================================33// class definitions34// ===========================================================================3536class MFXCheckableButton : public FXButton {37/// @brief fox declaration38FXDECLARE(MFXCheckableButton)3940public:41/// @brief constructor (Very similar to the FXButton constructor)42MFXCheckableButton(bool amChecked, FXComposite* p, MFXStaticToolTip* staticToolTip, const std::string& text,43FXIcon* ic = NULL, FXObject* tgt = NULL, FXSelector sel = 0, FXuint opts = BUTTON_NORMAL,44FXint x = 0, FXint y = 0, FXint w = 0, FXint h = 0,45FXint pl = DEFAULT_PAD, FXint pr = DEFAULT_PAD, FXint pt = DEFAULT_PAD, FXint pb = DEFAULT_PAD);4647/// @brief destructor (Called automatically)48~MFXCheckableButton();4950/// @brief check if this MFXCheckableButton is checked51bool amChecked() const;5253/// @brief check or uncheck this MFXCheckableButton54void setChecked(bool val, const bool inform = false);5556/// @name FOX callbacks57/// @{58/// @brief called when this MFXCheckableButton is painted59long onPaint(FXObject*, FXSelector, void*);6061/// @brief called when this MFXCheckableButton is updated62long onUpdate(FXObject*, FXSelector, void*);6364/// @brief called when mouse enter in MFXCheckableButton65long onEnter(FXObject*, FXSelector, void*);6667/// @brief called when mouse leaves in MFXCheckableButton68long onLeave(FXObject*, FXSelector, void*);6970/// @brief called when mouse motion in MFXCheckableButton71long onMotion(FXObject*, FXSelector, void*);7273/// @}7475protected:76/// @brief FOX need this77FOX_CONSTRUCTOR(MFXCheckableButton)7879/// @brief flag to indicate if this MFXCheckableButton is checked80bool myAmChecked;8182/// @brief colors of this MFXCheckableButton83FXColor myBackColor,84myDarkColor,85myHiliteColor,86myShadowColor;8788/// @brief check if this MFXCheckableButton is initialised89bool myAmInitialised;9091/// @brief static tool tip92MFXStaticToolTip* myStaticToolTip = nullptr;9394/// @brief build color of this MFXCheckableButton95void buildColors();9697/// @brief set colors of this MFXCheckableButton98void setColors();99100private:101/// @brief Invalidated copy constructor.102MFXCheckableButton(const MFXCheckableButton&) = delete;103104/// @brief Invalidated assignment operator.105MFXCheckableButton& operator=(const MFXCheckableButton&) = delete;106};107108109