Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MFXButtonTooltip.cpp
Go to the documentation of this file.
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials are made available under the
5
// terms of the Eclipse Public License 2.0 which is available at
6
// https://www.eclipse.org/legal/epl-2.0/
7
// This Source Code may also be made available under the following Secondary
8
// Licenses when the conditions for such availability set forth in the Eclipse
9
// Public License 2.0 are satisfied: GNU General Public License, version 2
10
// or later which is available at
11
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
/****************************************************************************/
18
// Button similar to FXButton but with the possibility of showing tooltips
19
/****************************************************************************/
20
#include <config.h>
21
22
#include "
MFXButtonTooltip.h
"
23
24
25
FXDEFMAP
(
MFXButtonTooltip
) MFXButtonTooltipMap[] = {
26
FXMAPFUNC(SEL_ENTER, 0,
MFXButtonTooltip::onEnter
),
27
FXMAPFUNC(SEL_LEAVE, 0,
MFXButtonTooltip::onLeave
),
28
FXMAPFUNC(SEL_MOTION, 0,
MFXButtonTooltip::onMotion
),
29
};
30
31
32
// Object implementation
33
FXIMPLEMENT(
MFXButtonTooltip
, FXButton, MFXButtonTooltipMap, ARRAYNUMBER(MFXButtonTooltipMap))
34
35
MFXButtonTooltip
::
MFXButtonTooltip
(FXComposite* p,
MFXStaticToolTip
* staticToolTip,
36
const
std
::
string
& text, FXIcon* ic,
37
FXObject* tgt, FXSelector sel, FXuint opts,
38
FXint x, FXint y, FXint w, FXint h,
39
FXint pl, FXint pr, FXint pt, FXint pb) :
40
FXButton(p, text.c_str(), ic, tgt, sel, opts, x, y, w, h, pl, pr, pt, pb),
41
myStaticToolTip(staticToolTip) {
42
}
43
44
45
MFXButtonTooltip::~MFXButtonTooltip
() {}
46
47
48
long
49
MFXButtonTooltip::onEnter
(FXObject* sender, FXSelector sel,
void
* ptr) {
50
// show tip show
51
myStaticToolTip
->
showStaticToolTip
(getTipText());
52
return
FXButton::onEnter(sender, sel, ptr);
53
}
54
55
56
long
57
MFXButtonTooltip::onLeave
(FXObject* sender, FXSelector sel,
void
* ptr) {
58
// hide static toolTip
59
myStaticToolTip
->
hideStaticToolTip
();
60
return
FXButton::onLeave(sender, sel, ptr);
61
}
62
63
64
long
65
MFXButtonTooltip::onMotion
(FXObject* sender, FXSelector sel,
void
* ptr) {
66
// update static tooltip
67
myStaticToolTip
->
onUpdate
(sender, sel, ptr);
68
return
FXButton::onMotion(sender, sel, ptr);
69
}
70
71
/****************************************************************************/
FXDEFMAP
FXDEFMAP(MFXButtonTooltip) MFXButtonTooltipMap[]
MFXButtonTooltip.h
MFXButtonTooltip
Definition
MFXButtonTooltip.h:31
MFXButtonTooltip::myStaticToolTip
MFXStaticToolTip * myStaticToolTip
FOX needs this.
Definition
MFXButtonTooltip.h:63
MFXButtonTooltip::onEnter
long onEnter(FXObject *, FXSelector, void *)
Definition
MFXButtonTooltip.cpp:49
MFXButtonTooltip::~MFXButtonTooltip
~MFXButtonTooltip()
destructor (Called automatically)
Definition
MFXButtonTooltip.cpp:45
MFXButtonTooltip::onMotion
long onMotion(FXObject *, FXSelector, void *)
called when mouse motion in MFXButtonTooltip
Definition
MFXButtonTooltip.cpp:65
MFXButtonTooltip::onLeave
long onLeave(FXObject *, FXSelector, void *)
called when mouse leaves in MFXButtonTooltip
Definition
MFXButtonTooltip.cpp:57
MFXStaticToolTip
MFXStaticToolTip (based on FXToolTip)
Definition
MFXStaticToolTip.h:27
MFXStaticToolTip::onUpdate
long onUpdate(FXObject *sender, FXSelector sel, void *ptr)
called when tooltip is updated
Definition
MFXStaticToolTip.cpp:114
MFXStaticToolTip::showStaticToolTip
void showStaticToolTip(const FXString &toolTipText)
show static toolTip
Definition
MFXStaticToolTip.cpp:79
MFXStaticToolTip::hideStaticToolTip
void hideStaticToolTip()
hide static toolTip
Definition
MFXStaticToolTip.cpp:94
std
Definition
json.hpp:4471
src
utils
foxtools
MFXButtonTooltip.cpp
Generated on Tue Nov 5 2024 00:10:31 for Eclipse SUMO - Simulation of Urban MObility by
1.9.8