BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
BesGPictureButton.cxx
Go to the documentation of this file.
1
2#include "BesVisLib/BesGPictureButton.h"
3
4using namespace std;
5
6#ifndef __CINT__
8#endif
9
10//______________________________________________________________________________
11BesGPictureButton::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//______________________________________________________________________________
19BesGPictureButton::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//______________________________________________________________________________
28BesGPictureButton::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//______________________________________________________________________________
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;
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//______________________________________________________________________________
82void BesGPictureButton::SetPicture(const TGPicture *new_pic)
83{
84 // once you SetPicture, you show set the button state
85 TGPictureButton::SetPicture(new_pic);
86}
ClassImp(BesGPictureButton) BesGPictureButton
Bool_t HandleCrossing(Event_t *event)
BesGPictureButton(const TGWindow *p, const TGPicture *pic, Int_t id=-1, GContext_t norm=GetDefaultGC()(), UInt_t option=kRaisedFrame|kDoubleBorder)
virtual void SetPicture(const TGPicture *new_pic)