CGEM BOSS
6.6.5.i
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,
12
Int_t
id
, GContext_t norm, UInt_t option) : TGPictureButton(p, pic, id, norm, option)
13
{
14
fPicHL = 0;
15
fState =
false
;
16
}
17
18
//______________________________________________________________________________
19
BesGPictureButton::BesGPictureButton
(
const
TGWindow *p,
const
TGPicture *pic,
20
const
char
*cmd, Int_t
id
, GContext_t norm, UInt_t option)
21
: TGPictureButton(p, pic, cmd, id, norm, option)
22
{
23
fPicHL
= 0;
24
fState
=
false
;
25
}
26
27
//______________________________________________________________________________
28
BesGPictureButton::BesGPictureButton
(
const
TGWindow *p,
const
char
*pic,
29
Int_t
id
, GContext_t norm, UInt_t option) : TGPictureButton(p, pic, id, norm, option)
30
{
31
fPicHL
= 0;
32
fState
=
false
;
33
}
34
35
//______________________________________________________________________________
36
Bool_t
BesGPictureButton::HandleCrossing
(Event_t *event)
37
{
38
// Handle mouse crossing event.
39
40
static
const
TGPicture *picTemp;
41
static
Bool_t state;
// state when entering
42
43
if
(
fPicHL
) {
44
if
(event->fType == kEnterNotify) {
45
picTemp = fPic;
46
state =
fState
;
47
SetPicture
(
fPicHL
);
48
}
49
else
{
50
if
(
fState
== state)
SetPicture
(picTemp);
// if state unchanged, set to pic when cursor entering
51
else
SetPicture
(fPic);
// else, set to state pic
52
}
53
}
54
55
/*
56
if (fTip) {
57
if (event->fType == kEnterNotify)
58
fTip->Reset();
59
else
60
fTip->Hide();
61
}
62
63
if ((fgDbw != event->fWindow) || (fgReleaseBtn == event->fWindow)) return kTRUE;
64
65
if (!(event->fState & (kButton1Mask | kButton2Mask | kButton3Mask)))
66
return kTRUE;
67
68
if (fState == kButtonEngaged || fState == kButtonDisabled) return kTRUE;
69
70
if (event->fType == kEnterNotify) {
71
SetState(kButtonDown, kFALSE);
72
} else {
73
SetState(kButtonUp, kFALSE);
74
}
75
76
*/
77
TGButton::HandleCrossing(event);
78
return
kTRUE;
79
}
80
81
//______________________________________________________________________________
82
void
BesGPictureButton::SetPicture
(
const
TGPicture *new_pic)
83
{
84
// once you SetPicture, you show set the button state
85
TGPictureButton::SetPicture(new_pic);
86
}
ClassImp
ClassImp(BesGPictureButton) BesGPictureButton
Definition
BesGPictureButton.cxx:7
BesGPictureButton.h
BesGPictureButton
Definition
BesGPictureButton.h:7
BesGPictureButton::HandleCrossing
Bool_t HandleCrossing(Event_t *event)
Definition
BesGPictureButton.cxx:36
BesGPictureButton::BesGPictureButton
BesGPictureButton(const TGWindow *p, const TGPicture *pic, Int_t id=-1, GContext_t norm=GetDefaultGC()(), UInt_t option=kRaisedFrame|kDoubleBorder)
BesGPictureButton::fPicHL
const TGPicture * fPicHL
Definition
BesGPictureButton.h:32
BesGPictureButton::fState
Bool_t fState
Definition
BesGPictureButton.h:33
BesGPictureButton::SetPicture
virtual void SetPicture(const TGPicture *new_pic)
Definition
BesGPictureButton.cxx:82
std
Definition
RootEventData_rootcint.cxx:16
6.6.5.i
EventDisplay
BesVisLib
BesVisLib-00-06-12
src
BesGPictureButton.cxx
Generated by
1.12.0