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=nullptr, UInt_t w=10, UInt_t h=10, UInt_t options=0)
 
Bool_t HandleKey (Event_t *event) override
 
void PoppedDown () override
 
void PoppedUp () override
 

Detailed Description

Definition at line 5 of file FWPopupMenu.cc.

Constructor & Destructor Documentation

◆ FWPopupMenu()

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

Definition at line 7 of file FWPopupMenu.cc.

8  : TGPopupMenu(p, w, h, options) {
9  AddInput(kKeyPressMask);
10  }
T w() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

Member Function Documentation

◆ HandleKey()

Bool_t FWPopupMenu::HandleKey ( Event_t *  event)
inlineoverride

Definition at line 29 of file FWPopupMenu.cc.

References makeMEIFBenchmarkPlots::ev, and createJobs::tmp.

29  {
30  if (event->fType != kGKeyPress)
31  return kTRUE;
32 
33  UInt_t keysym;
34  char tmp[2];
35  gVirtualX->LookupString(event, tmp, sizeof(tmp), keysym);
36 
37  TGMenuEntry* ce = fCurrent;
38 
39  switch (keysym) {
40  case kKey_Up: {
41  if (ce)
42  ce = (TGMenuEntry*)GetListOfEntries()->Before(ce);
43  while (ce && ((ce->GetType() == kMenuSeparator) || (ce->GetType() == kMenuLabel) ||
44  !(ce->GetStatus() & kMenuEnableMask))) {
45  ce = (TGMenuEntry*)GetListOfEntries()->Before(ce);
46  }
47  if (!ce)
48  ce = (TGMenuEntry*)GetListOfEntries()->Last();
49  Activate(ce);
50  break;
51  }
52  case kKey_Down: {
53  if (ce)
54  ce = (TGMenuEntry*)GetListOfEntries()->After(ce);
55  while (ce && ((ce->GetType() == kMenuSeparator) || (ce->GetType() == kMenuLabel) ||
56  !(ce->GetStatus() & kMenuEnableMask))) {
57  ce = (TGMenuEntry*)GetListOfEntries()->After(ce);
58  }
59  if (!ce)
60  ce = (TGMenuEntry*)GetListOfEntries()->First();
61  Activate(ce);
62  break;
63  }
64  case kKey_Enter:
65  case kKey_Return: {
66  Event_t ev;
67  ev.fType = kButtonRelease;
68  ev.fWindow = fId;
69  return HandleButton(&ev);
70  }
71  case kKey_Escape: {
72  fCurrent = nullptr;
73  void* dummy = nullptr;
74  return EndMenu(dummy);
75  }
76  default: {
77  break;
78  }
79  }
80 
81  return kTRUE;
82  }
tmp
align.sh
Definition: createJobs.py:716
Definition: event.py:1

◆ PoppedDown()

void FWPopupMenu::PoppedDown ( )
inlineoverride

Definition at line 24 of file FWPopupMenu.cc.

References MainPageGenerator::l.

24  {
25  gVirtualX->GrabKey(fId, 0l, kAnyModifier, kFALSE);
26  TGPopupMenu::PoppedDown();
27  }

◆ PoppedUp()

void FWPopupMenu::PoppedUp ( )
inlineoverride

Definition at line 18 of file FWPopupMenu.cc.

References MainPageGenerator::l.

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