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  }

Member Function Documentation

◆ HandleKey()

Bool_t FWPopupMenu::HandleKey ( Event_t *  event)
inlineoverride

Definition at line 29 of file FWPopupMenu.cc.

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  }

References ev, and createJobs::tmp.

◆ PoppedDown()

void FWPopupMenu::PoppedDown ( )
inlineoverride

Definition at line 24 of file FWPopupMenu.cc.

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

References cmsLHEtoEOSManager::l.

◆ PoppedUp()

void FWPopupMenu::PoppedUp ( )
inlineoverride

Definition at line 18 of file FWPopupMenu.cc.

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

References cmsLHEtoEOSManager::l.

AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
options
Definition: options.py:1
w
const double w
Definition: UKUtility.cc:23
h
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
dummy
Definition: DummySelector.h:38
event
Definition: event.py:1