BOSS 7.0.5
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)
 
 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

Constructor & Destructor Documentation

◆ BesGPictureButton() [1/6]

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

◆ BesGPictureButton() [2/6]

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}

◆ BesGPictureButton() [3/6]

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}

◆ BesGPictureButton() [4/6]

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

◆ BesGPictureButton() [5/6]

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

◆ BesGPictureButton() [6/6]

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

Member Function Documentation

◆ HandleCrossing() [1/2]

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)

◆ HandleCrossing() [2/2]

Bool_t BesGPictureButton::HandleCrossing ( Event_t *  event)

◆ IsStateOn() [1/2]

Bool_t BesGPictureButton::IsStateOn ( )
inline

◆ IsStateOn() [2/2]

Bool_t BesGPictureButton::IsStateOn ( )
inline

Definition at line 22 of file InstallArea/include/BesVisLib/BesVisLib/BesGPictureButton.h.

22{ return fState; }

◆ SetPicture() [1/2]

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::OpenGL(), BesClient::SetAllDisplayModeButtonUnHL(), BesClient::UpdateStatus(), and BesClient::X3D().

◆ SetPicture() [2/2]

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

◆ SetPictureHL() [1/2]

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

◆ SetPictureHL() [2/2]

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

Definition at line 26 of file InstallArea/include/BesVisLib/BesVisLib/BesGPictureButton.h.

26{ fPicHL = hl_pic; }

◆ SetState() [1/2]

◆ SetState() [2/2]

virtual void BesGPictureButton::SetState ( Bool_t  state)
inlinevirtual

Definition at line 23 of file InstallArea/include/BesVisLib/BesVisLib/BesGPictureButton.h.

23{ fState = state; }

Member Data Documentation

◆ fPicHL

const TGPicture * BesGPictureButton::fPicHL
protected

◆ fState

Bool_t BesGPictureButton::fState
protected

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