BOSS
8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesGPictureButton.cxx
Go to the documentation of this file.
1
2
#include "BesVisLib/BesGPictureButton.h"
3
4
using namespace
std
;
5
6
#ifndef __CINT__
7
ClassImp
(
BesGPictureButton
)
8
#endif
9
10
//______________________________________________________________________________
11
BesGPictureButton::BesGPictureButton
(
const
TGWindow* p,
const
TGPicture* pic, Int_t
id
,
12
GContext_t norm, UInt_t option )
13
: TGPictureButton( p, pic, id, norm, option ) {
14
fPicHL = 0;
15
fState =
false
;
16
}
17
18
//______________________________________________________________________________
19
BesGPictureButton::BesGPictureButton
(
const
TGWindow* p,
const
TGPicture* pic,
const
char
* cmd,
20
Int_t
id
, GContext_t norm, UInt_t option )
21
: TGPictureButton( p, pic, cmd, id, norm, option ) {
22
fPicHL
= 0;
23
fState
=
false
;
24
}
25
26
//______________________________________________________________________________
27
BesGPictureButton::BesGPictureButton
(
const
TGWindow* p,
const
char
* pic, Int_t
id
,
28
GContext_t norm, UInt_t option )
29
: TGPictureButton( p, pic, id, norm, option ) {
30
fPicHL
= 0;
31
fState
=
false
;
32
}
33
34
//______________________________________________________________________________
35
Bool_t
BesGPictureButton::HandleCrossing
( Event_t* event ) {
36
// Handle mouse crossing event.
37
38
static
const
TGPicture* picTemp;
39
static
Bool_t state;
// state when entering
40
41
if
(
fPicHL
)
42
{
43
if
( event->fType == kEnterNotify )
44
{
45
picTemp = fPic;
46
state =
fState
;
47
SetPicture
(
fPicHL
);
48
}
49
else
50
{
51
if
(
fState
== state )
52
SetPicture
( picTemp );
// if state unchanged, set to pic when cursor entering
53
else
SetPicture
( fPic );
// else, set to state pic
54
}
55
}
56
57
/*
58
if (fTip) {
59
if (event->fType == kEnterNotify)
60
fTip->Reset();
61
else
62
fTip->Hide();
63
}
64
65
if ((fgDbw != event->fWindow) || (fgReleaseBtn == event->fWindow)) return kTRUE;
66
67
if (!(event->fState & (kButton1Mask | kButton2Mask | kButton3Mask)))
68
return kTRUE;
69
70
if (fState == kButtonEngaged || fState == kButtonDisabled) return kTRUE;
71
72
if (event->fType == kEnterNotify) {
73
SetState(kButtonDown, kFALSE);
74
} else {
75
SetState(kButtonUp, kFALSE);
76
}
77
78
*/
79
TGButton::HandleCrossing( event );
80
return
kTRUE;
81
}
82
83
//______________________________________________________________________________
84
void
BesGPictureButton::SetPicture
(
const
TGPicture* new_pic ) {
85
// once you SetPicture, you show set the button state
86
TGPictureButton::SetPicture( new_pic );
87
}
ClassImp
ClassImp(BesGPictureButton) BesGPictureButton
Definition
BesGPictureButton.cxx:7
BesGPictureButton
Definition
EventDisplay/BesVisLib/include/BesVisLib/BesGPictureButton.h:7
BesGPictureButton::fPicHL
const TGPicture * fPicHL
Definition
EventDisplay/BesVisLib/include/BesVisLib/BesGPictureButton.h:29
BesGPictureButton::HandleCrossing
Bool_t HandleCrossing(Event_t *event)
Definition
BesGPictureButton.cxx:35
BesGPictureButton::BesGPictureButton
BesGPictureButton(const TGWindow *p, const TGPicture *pic, Int_t id=-1, GContext_t norm=GetDefaultGC()(), UInt_t option=kRaisedFrame|kDoubleBorder)
BesGPictureButton::fState
Bool_t fState
Definition
EventDisplay/BesVisLib/include/BesVisLib/BesGPictureButton.h:30
BesGPictureButton::SetPicture
virtual void SetPicture(const TGPicture *new_pic)
Definition
BesGPictureButton.cxx:84
std
Definition
x86_64-el9-gcc13-dbg/Event/RootEventData/RootEventDataDict.cxx:101
8.0.0
BOSS_Source
EventDisplay
BesVisLib
src
BesGPictureButton.cxx
Generated by
1.16.1