CMS 3D CMS Logo

List of all members | Public Member Functions
FWPopupMenu Class Reference
Inheritance diagram for FWPopupMenu:

Public Member Functions

 FWPopupMenu (const TGWindow *p=0, UInt_t w=10, UInt_t h=10, UInt_t options=0)
 
virtual Bool_t HandleKey (Event_t *event) override
 
virtual void PoppedDown () override
 
virtual void PoppedUp () override
 

Detailed Description

Definition at line 4 of file FWPopupMenu.cc.

Constructor & Destructor Documentation

FWPopupMenu::FWPopupMenu ( const TGWindow *  p = 0,
UInt_t  w = 10,
UInt_t  h = 10,
UInt_t  options = 0 
)
inline

Definition at line 7 of file FWPopupMenu.cc.

7  :
8  TGPopupMenu(p, w, h, options)
9  {
10  AddInput(kKeyPressMask);
11  }
const double w
Definition: UKUtility.cc:23

Member Function Documentation

virtual Bool_t FWPopupMenu::HandleKey ( Event_t *  event)
inlineoverridevirtual

Definition at line 33 of file FWPopupMenu.cc.

References ev, and tmp.

34  {
35  if (event->fType != kGKeyPress) return kTRUE;
36 
37  UInt_t keysym;
38  char tmp[2];
39  gVirtualX->LookupString(event, tmp, sizeof(tmp), keysym);
40 
41  TGMenuEntry *ce = fCurrent;
42 
43  switch (keysym)
44  {
45  case kKey_Up:
46  {
47  if (ce) ce = (TGMenuEntry*)GetListOfEntries()->Before(ce);
48  while (ce && ((ce->GetType() == kMenuSeparator) ||
49  (ce->GetType() == kMenuLabel) ||
50  !(ce->GetStatus() & kMenuEnableMask)))
51  {
52  ce = (TGMenuEntry*)GetListOfEntries()->Before(ce);
53  }
54  if (!ce) ce = (TGMenuEntry*)GetListOfEntries()->Last();
55  Activate(ce);
56  break;
57  }
58  case kKey_Down:
59  {
60  if (ce) ce = (TGMenuEntry*)GetListOfEntries()->After(ce);
61  while (ce && ((ce->GetType() == kMenuSeparator) ||
62  (ce->GetType() == kMenuLabel) ||
63  !(ce->GetStatus() & kMenuEnableMask)))
64  {
65  ce = (TGMenuEntry*)GetListOfEntries()->After(ce);
66  }
67  if (!ce) ce = (TGMenuEntry*)GetListOfEntries()->First();
68  Activate(ce);
69  break;
70  }
71  case kKey_Enter:
72  case kKey_Return:
73  {
74  Event_t ev;
75  ev.fType = kButtonRelease;
76  ev.fWindow = fId;
77  return HandleButton(&ev);
78  }
79  case kKey_Escape:
80  {
81  fCurrent = 0;
82  void *dummy = 0;
83  return EndMenu(dummy);
84  }
85  default:
86  {
87  break;
88  }
89  }
90 
91  return kTRUE;
92  }
bool ev
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
Definition: event.py:1
virtual void FWPopupMenu::PoppedDown ( )
inlineoverridevirtual

Definition at line 27 of file FWPopupMenu.cc.

References checklumidiff::l.

28  {
29  gVirtualX->GrabKey(fId, 0l, kAnyModifier, kFALSE);
30  TGPopupMenu::PoppedDown();
31  }
virtual void FWPopupMenu::PoppedUp ( )
inlineoverridevirtual

Definition at line 19 of file FWPopupMenu.cc.

References checklumidiff::l.

20  {
21  TGPopupMenu::PoppedUp();
22  gVirtualX->SetInputFocus(fId);
23  gVirtualX->GrabKey(fId, 0l, kAnyModifier, kTRUE);
24 
25  }