#include <BesGPictureButton.h>
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 |
Definition at line 7 of file BesGPictureButton.h.
BesGPictureButton::BesGPictureButton | ( | const TGWindow * | p, | |
const TGPicture * | pic, | |||
Int_t | id = -1 , |
|||
GContext_t | norm = GetDefaultGC()() , |
|||
UInt_t | option = kRaisedFrame|kDoubleBorder | |||
) |
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::BesGPictureButton | ( | const TGWindow * | p = 0 , |
|
const char * | pic = 0 , |
|||
Int_t | id = -1 , |
|||
GContext_t | norm = GetDefaultGC()() , |
|||
UInt_t | option = kRaisedFrame|kDoubleBorder | |||
) |
Bool_t BesGPictureButton::HandleCrossing | ( | Event_t * | event | ) |
Definition at line 36 of file BesGPictureButton.cxx.
References fPicHL, fState, and SetPicture().
00037 { 00038 // Handle mouse crossing event. 00039 00040 static const TGPicture *picTemp; 00041 static Bool_t state; // state when entering 00042 00043 if (fPicHL) { 00044 if (event->fType == kEnterNotify) { 00045 picTemp = fPic; 00046 state = fState; 00047 SetPicture(fPicHL); 00048 } 00049 else { 00050 if (fState == state) SetPicture(picTemp); // if state unchanged, set to pic when cursor entering 00051 else SetPicture(fPic); // else, set to state pic 00052 } 00053 } 00054 00055 /* 00056 if (fTip) { 00057 if (event->fType == kEnterNotify) 00058 fTip->Reset(); 00059 else 00060 fTip->Hide(); 00061 } 00062 00063 if ((fgDbw != event->fWindow) || (fgReleaseBtn == event->fWindow)) return kTRUE; 00064 00065 if (!(event->fState & (kButton1Mask | kButton2Mask | kButton3Mask))) 00066 return kTRUE; 00067 00068 if (fState == kButtonEngaged || fState == kButtonDisabled) return kTRUE; 00069 00070 if (event->fType == kEnterNotify) { 00071 SetState(kButtonDown, kFALSE); 00072 } else { 00073 SetState(kButtonUp, kFALSE); 00074 } 00075 00076 */ 00077 TGButton::HandleCrossing(event); 00078 return kTRUE; 00079 }
Bool_t BesGPictureButton::IsStateOn | ( | ) | [inline] |
void BesGPictureButton::SetPicture | ( | const TGPicture * | new_pic | ) | [virtual] |
Definition at line 82 of file BesGPictureButton.cxx.
Referenced by BesClient::AutoDisplayEvent(), BesClient::GetEvent(), BesClient::GetRecEvent(), BesClient::HandleButtons(), HandleCrossing(), BesClient::SetAllDisplayModeButtonUnHL(), and BesClient::UpdateStatus().
00083 { 00084 // once you SetPicture, you show set the button state 00085 TGPictureButton::SetPicture(new_pic); 00086 }
virtual void BesGPictureButton::SetPictureHL | ( | const TGPicture * | hl_pic | ) | [inline, virtual] |
Definition at line 26 of file BesGPictureButton.h.
References fPicHL.
Referenced by BesClient::CreateDisplayModeBar(), BesClient::CreateToolBar(), and BesClient::CreateUpButtonBar().
00026 { fPicHL = hl_pic; }
virtual void BesGPictureButton::SetState | ( | Bool_t | state | ) | [inline, virtual] |
Definition at line 23 of file BesGPictureButton.h.
References fState.
Referenced by BesClient::CreateDisplayModeBar(), BesClient::CreateToolBar(), BesClient::CreateUpButtonBar(), BesClient::HandleButtons(), and BesClient::UpdateStatus().
00023 { fState = state; }
const TGPicture* BesGPictureButton::fPicHL [protected] |
Definition at line 32 of file BesGPictureButton.h.
Referenced by BesGPictureButton(), HandleCrossing(), and SetPictureHL().
Bool_t BesGPictureButton::fState [protected] |
Definition at line 33 of file BesGPictureButton.h.
Referenced by BesGPictureButton(), HandleCrossing(), IsStateOn(), and SetState().