CMS 3D CMS Logo

Public Member Functions

FWPopupMenu Class Reference

List of all members.

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)
virtual void PoppedDown ()
virtual void PoppedUp ()

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.

                                                                                :
      TGPopupMenu(p, w, h, options)
   {
      AddInput(kKeyPressMask);
   }

Member Function Documentation

virtual Bool_t FWPopupMenu::HandleKey ( Event_t *  event) [inline, virtual]

Definition at line 33 of file FWPopupMenu.cc.

References tmp.

   {
      if (event->fType != kGKeyPress) return kTRUE;

      UInt_t keysym;
      char tmp[2];
      gVirtualX->LookupString(event, tmp, sizeof(tmp), keysym);

      TGMenuEntry *ce = fCurrent;

      switch (keysym)
      {
         case kKey_Up:
         {
            if (ce) ce = (TGMenuEntry*)GetListOfEntries()->Before(ce);
            while (ce && ((ce->GetType() == kMenuSeparator) ||
                          (ce->GetType() == kMenuLabel) ||
                          !(ce->GetStatus() & kMenuEnableMask)))
            {
               ce = (TGMenuEntry*)GetListOfEntries()->Before(ce);
            }
            if (!ce) ce = (TGMenuEntry*)GetListOfEntries()->Last();
            Activate(ce);
            break;
         }
         case kKey_Down:
         {
            if (ce) ce = (TGMenuEntry*)GetListOfEntries()->After(ce);
            while (ce && ((ce->GetType() == kMenuSeparator) ||
                          (ce->GetType() == kMenuLabel) ||
                          !(ce->GetStatus() & kMenuEnableMask)))
            {
               ce = (TGMenuEntry*)GetListOfEntries()->After(ce);
            }
            if (!ce) ce = (TGMenuEntry*)GetListOfEntries()->First();
            Activate(ce);
            break;
         }
         case kKey_Enter:
         case kKey_Return:
         {
            Event_t ev;
            ev.fType = kButtonRelease;
            ev.fWindow = fId;
            return HandleButton(&ev);
         }
         case kKey_Escape:
         {
            fCurrent = 0;
            void *dummy = 0;
            return EndMenu(dummy);
         }
         default:
         {
            break;
         }
      }

      return kTRUE;
   }
virtual void FWPopupMenu::PoppedDown ( ) [inline, virtual]

Definition at line 27 of file FWPopupMenu.cc.

References prof2calltree::l.

   {
      gVirtualX->GrabKey(fId, 0l, kAnyModifier, kFALSE);
      TGPopupMenu::PoppedDown();
   }
virtual void FWPopupMenu::PoppedUp ( ) [inline, virtual]

Definition at line 19 of file FWPopupMenu.cc.

References prof2calltree::l.

   {
      TGPopupMenu::PoppedUp();
      gVirtualX->SetInputFocus(fId);
      gVirtualX->GrabKey(fId, 0l, kAnyModifier, kTRUE);
      
   }