CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 4 of file FWPopupMenu.cc.

Constructor & Destructor Documentation

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

Definition at line 6 of file FWPopupMenu.cc.

7  : TGPopupMenu(p, w, h, options) {
8  AddInput(kKeyPressMask);
9  }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const double w
Definition: UKUtility.cc:23

Member Function Documentation

Bool_t FWPopupMenu::HandleKey ( Event_t *  event)
inlineoverride

Definition at line 28 of file FWPopupMenu.cc.

References ev, and createJobs::tmp.

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

Definition at line 23 of file FWPopupMenu.cc.

References cmsLHEtoEOSManager::l.

23  {
24  gVirtualX->GrabKey(fId, 0l, kAnyModifier, kFALSE);
25  TGPopupMenu::PoppedDown();
26  }
void FWPopupMenu::PoppedUp ( )
inlineoverride

Definition at line 17 of file FWPopupMenu.cc.

References cmsLHEtoEOSManager::l.

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