Path: blob/main/src/utils/foxtools/MFXMenuButtonTooltip.h
169678 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-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 MFXMenuButtonTooltip.h14/// @author Pablo Alvarez Lopez15/// @date 2022-07-2716///17// MenuButton similar to FXMenuButton but with the possibility of showing tooltips18/****************************************************************************/19#pragma once20#include <config.h>2122#include <string>2324#include "fxheader.h"2526// ===========================================================================27// class declaration28// ===========================================================================2930class MFXStaticToolTip;3132// ===========================================================================33// class definitions34// ===========================================================================3536class MFXMenuButtonTooltip : public FXMenuButton {37/// @brief fox declaration38FXDECLARE(MFXMenuButtonTooltip)3940public:41/// @brief constructor (Exactly like the FXMenuButton constructor)42MFXMenuButtonTooltip(FXComposite* p, MFXStaticToolTip* staticToolTip, const std::string& text, FXIcon* ic,43FXPopup* pup, FXObject* optionalTarget,44FXuint opts = JUSTIFY_NORMAL | ICON_BEFORE_TEXT | MENUBUTTON_DOWN,45FXint x = 0, FXint y = 0, FXint w = 0, FXint h = 0,46FXint pl = DEFAULT_PAD, FXint pr = DEFAULT_PAD, FXint pt = DEFAULT_PAD, FXint pb = DEFAULT_PAD);4748/// @brief destructor (Called automatically)49~MFXMenuButtonTooltip();5051/// @name FOX callbacks52/// @{53/// @brief called when mouse enter in MFXMenuButtonTooltip54long onEnter(FXObject*, FXSelector, void*);5556/// @brief called when mouse leaves in MFXMenuButtonTooltip57long onLeave(FXObject*, FXSelector, void*);5859/// @brief called when mouse motion in MFXMenuButtonTooltip60long onMotion(FXObject*, FXSelector, void*);6162/// @brief called when left mouse button is press63long onLeftBtnPress(FXObject*, FXSelector, void*);6465/// @brief called when key is press66long onKeyPress(FXObject*, FXSelector, void*);6768/// @brief called when button is press69long onCmdPost(FXObject*, FXSelector, void*);7071/// @}7273protected:74/// @brief FOX needs this75FOX_CONSTRUCTOR(MFXMenuButtonTooltip)7677/// @brief static tooltip78MFXStaticToolTip* myStaticToolTip = nullptr;7980/// @brief optional target81FXObject* myOptionalTarget = nullptr;8283private:84/// @brief Invalidated copy constructor.85MFXMenuButtonTooltip(const MFXMenuButtonTooltip&) = delete;8687/// @brief Invalidated assignment operator.88MFXMenuButtonTooltip& operator=(const MFXMenuButtonTooltip&) = delete;89};909192