/****************************************************************************/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 MFXButtonTooltip.cpp14/// @author Angelo Banse15/// @date 2022-06-2116///17// Button similar to FXButton but with the possibility of showing tooltips18/****************************************************************************/19#include <config.h>2021#include "MFXStaticToolTip.h"22#include "MFXButtonTooltip.h"2324// ===========================================================================25// FOX callback mapping26// ===========================================================================2728FXDEFMAP(MFXButtonTooltip) MFXButtonTooltipMap[] = {29FXMAPFUNC(SEL_ENTER, 0, MFXButtonTooltip::onEnter),30FXMAPFUNC(SEL_LEAVE, 0, MFXButtonTooltip::onLeave),31FXMAPFUNC(SEL_MOTION, 0, MFXButtonTooltip::onMotion),32};3334// Object implementation35FXIMPLEMENT(MFXButtonTooltip, FXButton, MFXButtonTooltipMap, ARRAYNUMBER(MFXButtonTooltipMap))3637// ===========================================================================38// method definitions39// ===========================================================================4041MFXButtonTooltip::MFXButtonTooltip(FXComposite* p, MFXStaticToolTip* staticToolTip,42const std::string& text, FXIcon* ic,43FXObject* tgt, FXSelector sel, FXuint opts,44FXint x, FXint y, FXint w, FXint h,45FXint pl, FXint pr, FXint pt, FXint pb) :46FXButton(p, text.c_str(), ic, tgt, sel, opts, x, y, w, h, pl, pr, pt, pb),47myStaticToolTip(staticToolTip) {48}495051MFXButtonTooltip::~MFXButtonTooltip() {}525354long55MFXButtonTooltip::onEnter(FXObject* sender, FXSelector sel, void* ptr) {56// show tip show57myStaticToolTip->showStaticToolTip(getTipText());58return FXButton::onEnter(sender, sel, ptr);59}606162long63MFXButtonTooltip::onLeave(FXObject* sender, FXSelector sel, void* ptr) {64// hide static toolTip65myStaticToolTip->hideStaticToolTip();66return FXButton::onLeave(sender, sel, ptr);67}686970long71MFXButtonTooltip::onMotion(FXObject* sender, FXSelector sel, void* ptr) {72// update static tooltip73myStaticToolTip->onUpdate(sender, sel, ptr);74return FXButton::onMotion(sender, sel, ptr);75}7677/****************************************************************************/787980