BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
BesGPictureButton Class Reference

#include <BesGPictureButton.h>

+ Inheritance diagram for BesGPictureButton:

Public Member Functions

 BesGPictureButton (const TGWindow *p, const TGPicture *pic, Int_t id=-1, GContext_t norm=GetDefaultGC()(), UInt_t option=kRaisedFrame|kDoubleBorder)
 
 BesGPictureButton (const TGWindow *p, const TGPicture *pic, const char *cmd, Int_t id=-1, GContext_t norm=GetDefaultGC()(), UInt_t option=kRaisedFrame|kDoubleBorder)
 
 BesGPictureButton (const TGWindow *p=0, const char *pic=0, Int_t id=-1, GContext_t norm=GetDefaultGC()(), UInt_t option=kRaisedFrame|kDoubleBorder)
 
Bool_t HandleCrossing (Event_t *event)
 
Bool_t IsStateOn ()
 
virtual void SetState (Bool_t state)
 
virtual void SetPicture (const TGPicture *new_pic)
 
virtual void SetPictureHL (const TGPicture *hl_pic)
 

Protected Attributes

const TGPicture * fPicHL
 
Bool_t fState
 

Detailed Description

Definition at line 7 of file BesGPictureButton.h.

Constructor & Destructor Documentation

◆ BesGPictureButton() [1/3]

BesGPictureButton::BesGPictureButton ( const TGWindow *  p,
const TGPicture *  pic,
Int_t  id = -1,
GContext_t  norm = GetDefaultGC()(),
UInt_t  option = kRaisedFrame|kDoubleBorder 
)

◆ BesGPictureButton() [2/3]

BesGPictureButton::BesGPictureButton ( const TGWindow *  p,
const TGPicture *  pic,
const char *  cmd,
Int_t  id = -1,
GContext_t  norm = GetDefaultGC()(),
UInt_t  option = kRaisedFrame | kDoubleBorder 
)

Definition at line 19 of file BesGPictureButton.cxx.

21 : TGPictureButton(p, pic, cmd, id, norm, option)
22{
23 fPicHL = 0;
24 fState = false;
25}
const TGPicture * fPicHL

◆ BesGPictureButton() [3/3]

BesGPictureButton::BesGPictureButton ( const TGWindow *  p = 0,
const char *  pic = 0,
Int_t  id = -1,
GContext_t  norm = GetDefaultGC()(),
UInt_t  option = kRaisedFrame | kDoubleBorder 
)

Definition at line 28 of file BesGPictureButton.cxx.

29 : TGPictureButton(p, pic, id, norm, option)
30{
31 fPicHL = 0;
32 fState = false;
33}

Member Function Documentation

◆ HandleCrossing()

Bool_t BesGPictureButton::HandleCrossing ( Event_t *  event)

Definition at line 36 of file BesGPictureButton.cxx.

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}
virtual void SetPicture(const TGPicture *new_pic)

◆ IsStateOn()

Bool_t BesGPictureButton::IsStateOn ( )
inline

Definition at line 22 of file BesGPictureButton.h.

22{ return fState; }

◆ SetPicture()

void BesGPictureButton::SetPicture ( const TGPicture *  new_pic)
virtual

Definition at line 82 of file BesGPictureButton.cxx.

83{
84 // once you SetPicture, you show set the button state
85 TGPictureButton::SetPicture(new_pic);
86}

Referenced by BesClient::AutoDisplayEvent(), BesClient::GetEvent(), BesClient::GetRecEvent(), BesClient::HandleButtons(), HandleCrossing(), BesClient::SetAllDisplayModeButtonUnHL(), and BesClient::UpdateStatus().

◆ SetPictureHL()

virtual void BesGPictureButton::SetPictureHL ( const TGPicture *  hl_pic)
inlinevirtual

◆ SetState()

virtual void BesGPictureButton::SetState ( Bool_t  state)
inlinevirtual

Member Data Documentation

◆ fPicHL

const TGPicture* BesGPictureButton::fPicHL
protected

Definition at line 32 of file BesGPictureButton.h.

Referenced by BesGPictureButton(), HandleCrossing(), and SetPictureHL().

◆ fState

Bool_t BesGPictureButton::fState
protected

Definition at line 33 of file BesGPictureButton.h.

Referenced by BesGPictureButton(), HandleCrossing(), IsStateOn(), and SetState().


The documentation for this class was generated from the following files: