// @(#)root/gui:$Id$
// Author: Fons Rademakers   12/02/98

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TRootContextMenu                                                     //
//                                                                      //
// This class provides an interface to context sensitive popup menus.   //
// These menus pop up when the user hits the right mouse button, and    //
// are destroyed when the menu pops downs.                              //
// The picture below shows a canvas with a pop-up menu.                 //
//                                                                      //
//Begin_Html <img src="gif/hsumMenu.gif"> End_Html                      //
//                                                                      //
// The picture below shows a canvas with a pop-up menu and a dialog box.//
//                                                                      //
//Begin_Html <img src="gif/hsumDialog.gif"> End_Html                    //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TRootContextMenu.h"
#include "TROOT.h"
#include "TGClient.h"
#include "TEnv.h"
#include "TList.h"
#include "TContextMenu.h"
#include "TMethod.h"
#include "TMethodArg.h"
#include "TClass.h"
#include "TVirtualX.h"
#include "TCanvas.h"
#include "TDataMember.h"
#include "TToggle.h"
#include "TRootDialog.h"
#include "TDataType.h"
#include "TCanvas.h"
#include "TBrowser.h"
#include "TRootCanvas.h"
#include "TRootBrowser.h"
#include "TClassMenuItem.h"
#include "TObjectSpy.h"
#include "KeySymbols.h"
#include "RConfigure.h"

enum EContextMenu {
   kToggleStart       = 1000, // first id of toggle menu items
   kToggleListStart   = 2000, // first id of toggle list menu items
   kUserFunctionStart = 3000  // first id of user added functions/methods, etc...
};


ClassImp(TRootContextMenu)

//______________________________________________________________________________
TRootContextMenu::TRootContextMenu(TContextMenu *c, const char *)
    : TGPopupMenu(gClient->GetDefaultRoot()), TContextMenuImp(c)
{
   // Create context menu.

   fDialog  = 0;
   fTrash = new TList;

   AddInput(kButtonPressMask | kButtonReleaseMask);
   gROOT->GetListOfCleanups()->Add(this);
   // Context menu handles its own messages
   Associate(this);
}

//______________________________________________________________________________
TRootContextMenu::~TRootContextMenu()
{
   // Delete a context menu.

   gROOT->GetListOfCleanups()->Remove(this);
   delete fDialog;
   if (fTrash) fTrash->Delete();
   delete fTrash;
}

//______________________________________________________________________________
void TRootContextMenu::DisplayPopup(Int_t x, Int_t y)
{
   // Display context popup menu for currently selected object.

   if (fClient->IsEditable()) return;

   // delete menu items releated to previous object and reset menu size
   if (fEntryList) fEntryList->Delete();
   fCurrent = 0;
   if (fTrash)   fTrash->Delete();
   fMenuHeight = 6;
   fMenuWidth  = 8;

   // delete previous dialog
   if (fDialog) {
      delete fDialog;
      fDialog = 0;
   }

   // add menu items to popup menu
   CreateMenu(fContextMenu->GetSelectedObject());

   int    xx, yy, topx = 0, topy = 0;
   UInt_t w, h;

   if (fContextMenu->GetSelectedCanvas())
      gVirtualX->GetGeometry(fContextMenu->GetSelectedCanvas()->GetCanvasID(),
                        topx, topy, w, h);

   xx = topx + x + 1;
   yy = topy + y + 1;

#ifdef R__HAS_COCOA
   //Context menu must be transient for a canvas, otherwise it's possible
   //to break the z-order (for example, using alt-tab to switch between
   //different aplications). This hint works ONLY for canvas though
   //(otherwise selected canvas is null).
   TGWindow *parent = 0;
   if (TVirtualPad *pad = fContextMenu->GetSelectedCanvas())
      parent = dynamic_cast<TGWindow *>(pad->GetCanvasImp());
   else if ((pad = fContextMenu->GetSelectedPad()) && pad->GetCanvasImp())
      parent = dynamic_cast<TGWindow *>(pad->GetCanvasImp());
   else if (TBrowser * const browser = fContextMenu->GetBrowser())
      parent = dynamic_cast<TGWindow *>(browser->GetBrowserImp());
   
   if (parent)
      gVirtualX->SetWMTransientHint(GetId(), parent->GetId());
#endif

   PlaceMenu(xx, yy, kTRUE, kTRUE);
   // add some space for the right-side '?' (help)
   fMenuWidth += 5;
   Resize(GetDefaultWidth()+5, GetDefaultHeight());
}

//______________________________________________________________________________
TGPopupMenu * TRootContextMenu::FindHierarchy(const char *commentstring, TString & last_component)
{
  // Decodes the Hierarchy="Level0/Level1/Level2/..." statement from the comment field
  // and returns the - if needed - created sub menu "Level0/Level1"
  // Returns the last component in last_component.

   TString cmd(commentstring);
   TString option;
   TString hierarchy;
   TGPopupMenu *currentMenu = 0;

   // search for arguments to the MENU statement
   // strcpy(cmd,commentstring);
   Ssiz_t opt_ptr;
   if ((opt_ptr=cmd.Index("*MENU={"))   != kNPOS ||
       (opt_ptr=cmd.Index("*SUBMENU={"))!= kNPOS ||
       (opt_ptr=cmd.Index("*TOGGLE={")) != kNPOS ) {

      Ssiz_t start = cmd.Index("{",opt_ptr) + 1;
      Ssiz_t end = cmd.Index("}",start);
      option = cmd(start,end - start);

      // Look for Hierarchy token
      TObjArray * array = option.Tokenize(";");
      TIter iter(array);
      TObject *obj;
      while((obj = iter())) {
         TString token(obj->GetName());
         if (token.Index("Hierarchy=\"") != kNPOS) {
            Ssiz_t tstart = token.Index("\"") + 1;
            Ssiz_t tend = token.Index("\"",tstart+1);
            if (tend == kNPOS) continue;
            hierarchy = token(tstart,tend - tstart);
         }
      }
      delete array;
   }

   // Build Hierarchy
   currentMenu = this;
   TObjArray * array = hierarchy.Tokenize("/");
   TIter iter(array);
   TObject *obj = iter();
   while(obj) {
      last_component = obj->GetName();
      obj = iter();
      if (obj) {
         TGMenuEntry *ptr;
         TIter next(currentMenu->GetListOfEntries());
         // Search for popup with corresponding name
         while ((ptr = (TGMenuEntry *) next()) &&
                (ptr->GetType() != kMenuPopup ||
                last_component.CompareTo(ptr->GetName()))) { }
         if (ptr)
            currentMenu = ptr->GetPopup();
         else {
            TGPopupMenu *r = new TGPopupMenu(gClient->GetDefaultRoot());
            // Alphabetical ordering
            TGMenuEntry *ptr2;
            TIter next2(currentMenu->GetListOfEntries());
            // Search for popup with corresponding name
            while ((ptr2 = (TGMenuEntry *) next2()) &&
                   (ptr2->GetType() != kMenuPopup  ||
                   last_component.CompareTo(ptr2->GetName()) > 0 )) { }

            currentMenu->AddPopup(last_component, r,ptr2);
            currentMenu = r;
            fTrash->Add(r);
            last_component = obj->GetName();
         }
      }
   }

   delete array;
   return currentMenu;
}

//______________________________________________________________________________
void TRootContextMenu::AddEntrySorted(TGPopupMenu *currentMenu, const char *s, Int_t id, void *ud,
                                         const TGPicture *p , Bool_t sorted)
{
   // Add a entry to current menu with alphabetical ordering.

   TGMenuEntry *ptr2 = 0;
   if (sorted) {
      TIter next(currentMenu->GetListOfEntries());
      // Search for popup with corresponding name
      while ((ptr2 = (TGMenuEntry *) next()) &&
             (ptr2->GetType() != kMenuEntry ||
             strcmp(ptr2->GetName(), s)<0 )) { }
   }
   currentMenu->AddEntry(s,id,ud,p,ptr2);
}

//______________________________________________________________________________
void TRootContextMenu::CreateMenu(TObject *object)
{
   // Create the context menu depending on the selected object.

   if (!object || fClient->IsEditable()) return;

   int entry = 0, toggle = kToggleStart, togglelist = kToggleListStart;
   int userfunction = kUserFunctionStart;

   // Add a title
   AddLabel(fContextMenu->CreatePopupTitle(object));
   AddSeparator();

   // Get list of menu items from the selected object's class
   TList *menuItemList = object->IsA()->GetMenuList();

   TClassMenuItem *menuItem;
   TIter nextItem(menuItemList);

   while ((menuItem = (TClassMenuItem*) nextItem())) {
      switch (menuItem->GetType()) {
         case TClassMenuItem::kPopupSeparator:
            {
            TGMenuEntry *last = (TGMenuEntry *)GetListOfEntries()->Last();
            if (last && last->GetType() != kMenuSeparator)
               AddSeparator();
            break;
            }
         case TClassMenuItem::kPopupStandardList:
            {
               // Standard list of class methods. Rebuild from scratch.
               // Get linked list of objects menu items (i.e. member functions
               // with the token *MENU in their comment fields.
               TList *methodList = new TList;
               object->IsA()->GetMenuItems(methodList);

               TMethod *method;
               TClass  *classPtr = 0;
               TIter next(methodList);
               Bool_t needSep = kFALSE;

               while ((method = (TMethod*) next())) {
                  if (classPtr != method->GetClass()) {
                     needSep = kTRUE;
                     classPtr = method->GetClass();
                  }

                  TDataMember *m;
                  EMenuItemKind menuKind = method->IsMenuItem();
                  TGPopupMenu *currentMenu = 0;
                  TString last_component;

                  switch (menuKind) {
                     case kMenuDialog:
                        // search for arguments to the MENU statement
                        currentMenu = FindHierarchy(method->GetCommentString(),last_component);
                        if (needSep && currentMenu == this) {
                           AddSeparator();
                           needSep = kFALSE;
                        }
                        AddEntrySorted(currentMenu,last_component.Length() ? last_component.Data() : method->GetName(), entry++, method,0,currentMenu != this);
                        break;
                     case kMenuSubMenu:
                        if ((m = method->FindDataMember())) {

                           // search for arguments to the MENU statement
                           currentMenu = FindHierarchy(method->GetCommentString(),last_component);

                           if (m->GetterMethod()) {
                              TGPopupMenu *r = new TGPopupMenu(gClient->GetDefaultRoot());
                              if (needSep && currentMenu == this) {
                                 AddSeparator();
                                 needSep = kFALSE;
                              }
                              if (last_component.Length()) {
                                 currentMenu->AddPopup(last_component, r);
                              } else {
                                 currentMenu->AddPopup(method->GetName(), r);
                              }
                              fTrash->Add(r);
                              TIter nxt(m->GetOptions());
                              TOptionListItem *it;
                              while ((it = (TOptionListItem*) nxt())) {
                                 const char *name = it->fOptName;
                                 Long_t val = it->fValue;

                                 TToggle *t = new TToggle;
                                 t->SetToggledObject(object, method);
                                 t->SetOnValue(val);
                                 fTrash->Add(t);

                                 r->AddEntry(name, togglelist++, t);
                                 if (t->GetState())
                                    r->CheckEntry(togglelist-1);
                              }
                           } else {
                              if (needSep && currentMenu == this) {
                                 AddSeparator();
                                 needSep = kFALSE;
                              }
                              AddEntrySorted(currentMenu,last_component.Length() ? last_component.Data() : method->GetName(), entry++, method,0,currentMenu != this);
                           }
                        }
                        break;

                     case kMenuToggle:
                        {
                           TToggle *t = new TToggle;
                           t->SetToggledObject(object, method);
                           t->SetOnValue(1);
                           fTrash->Add(t);
                           // search for arguments to the MENU statement
                           currentMenu = FindHierarchy(method->GetCommentString(),last_component);
                           if (needSep && currentMenu == this) {
                              AddSeparator();
                              needSep = kFALSE;
                           }
                           AddEntrySorted(currentMenu,last_component.Length() ? last_component.Data() : method->GetName(), toggle++, t,0,currentMenu != this);
                           if (t->GetState()) currentMenu->CheckEntry(toggle-1);
                        }
                        break;

                     default:
                        break;
                  }
               }
               delete methodList;
            }
            break;
         case TClassMenuItem::kPopupUserFunction:
            {
               const char* menuItemTitle = menuItem->GetTitle();
               if (menuItem->IsToggle()) {
                  TMethod* method =
                        object->IsA()->GetMethodWithPrototype(menuItem->GetFunctionName(),menuItem->GetArgs());
                  if (method) {
                     TToggle *t = new TToggle;
                     t->SetToggledObject(object, method);
                     t->SetOnValue(1);
                     fTrash->Add(t);

                     if (strlen(menuItemTitle)==0) menuItemTitle = method->GetName();
                     AddEntry(menuItemTitle, toggle++, t);
                     if (t->GetState()) CheckEntry(toggle-1);
                  }
               } else {
                  if (strlen(menuItemTitle)==0) menuItemTitle = menuItem->GetFunctionName();
                  AddEntry(menuItemTitle,userfunction++,menuItem);
               }
            }
            break;
         default:
            break;
      }
   }
}

//______________________________________________________________________________
void TRootContextMenu::Dialog(TObject *object, TMethod *method)
{
   // Create dialog object with OK and Cancel buttons. This dialog
   // prompts for the arguments of "method".

   Dialog(object,(TFunction*)method);
}

//______________________________________________________________________________
void TRootContextMenu::Dialog(TObject *object, TFunction *function)
{
   // Create dialog object with OK and Cancel buttons. This dialog
   // prompts for the arguments of "function".
   // function may be a global function or a method

   Int_t selfobjpos;

   if (!function) return;

   // Position, if it exists, of the argument that correspond to the object itself
   if (fContextMenu->GetSelectedMenuItem())
      selfobjpos =  fContextMenu->GetSelectedMenuItem()->GetSelfObjectPos();
   else selfobjpos = -1;

   const TGWindow *w;
   if (fContextMenu->GetSelectedCanvas()) {
      TCanvas *c = (TCanvas *) fContextMenu->GetSelectedCanvas();
      // Embedded canvas has no canvasimp that is a TGFrame
      // coverity[returned_null]
      // coverity[dereference]
      if (c->GetCanvasImp()->IsA()->InheritsFrom(TGFrame::Class())) {
         w = fClient->GetWindowById(gVirtualX->GetWindowID(c->GetCanvasID()));
         if (!w) w = (TRootCanvas *) c->GetCanvasImp();
      } else {
         w = gClient->GetDefaultRoot();
      }
   } else if (fContextMenu->GetBrowser()) {
      TBrowser *b = (TBrowser *) fContextMenu->GetBrowser();
      w = (TRootBrowser *) b->GetBrowserImp();
   } else {
      w = gClient->GetDefaultRoot();
   }
   fDialog = new TRootDialog(this, w, fContextMenu->CreateDialogTitle(object, function));

   // iterate through all arguments and create apropriate input-data objects:
   // inputlines, option menus...
   TMethodArg *argument = 0;

   TIter next(function->GetListOfMethodArgs());
   Int_t argpos = 0;

   while ((argument = (TMethodArg *) next())) {
      // Do not input argument for self object
      if (selfobjpos != argpos) {
         const char *argname    = fContextMenu->CreateArgumentTitle(argument);
         const char *type       = argument->GetTypeName();
         TDataType  *datatype   = gROOT->GetType(type);
         const char *charstar   = "char*";
         char        basictype[32];

         if (datatype) {
            strlcpy(basictype, datatype->GetTypeName(), 32);
         } else {
            TClass *cl = TClass::GetClass(type);
            if (strncmp(type, "enum", 4) && (cl && !(cl->Property() & kIsEnum)))
               Warning("Dialog", "data type is not basic type, assuming (int)");
            strlcpy(basictype, "int", 32);
         }

         if (strchr(argname, '*')) {
            strlcat(basictype, "*",32);
            if (!strncmp(type, "char", 4))
               type = charstar;
            else if (strstr(argname, "[default:")) {
               // skip arguments that are pointers (but not char *)
               // and have a default value
               argpos++;
               continue;
            }
         }

         TDataMember *m = argument->GetDataMember();
         if (m && object && m->GetterMethod(object->IsA())) {

            // Get the current value and form it as a text:

            char val[256];

            if (!strncmp(basictype, "char*", 5)) {
               char *tdefval;
               m->GetterMethod()->Execute(object, "", &tdefval);
               strlcpy(val, tdefval, sizeof(val));
            } else if (!strncmp(basictype, "float", 5) ||
                       !strncmp(basictype, "double", 6)) {
               Double_t ddefval;
               m->GetterMethod()->Execute(object, "", ddefval);
               snprintf(val,256, "%g", ddefval);
            } else if (!strncmp(basictype, "char", 4) ||
                       !strncmp(basictype, "bool", 4) ||
                       !strncmp(basictype, "int", 3)  ||
                       !strncmp(basictype, "long", 4) ||
                       !strncmp(basictype, "short", 5)) {
               Long_t ldefval;
               m->GetterMethod()->Execute(object, "", ldefval);
               snprintf(val,256, "%li", ldefval);
            }

            // Find out whether we have options ...

            TList *opt;
            // coverity[returned_pointer]: keep for later use
            if ((opt = m->GetOptions())) {
               Warning("Dialog", "option menu not yet implemented");
#if 0
               TMotifOptionMenu *o= new TMotifOptionMenu(argname);
               TIter nextopt(opt);
               TOptionListItem *it = 0;
               while ((it = (TOptionListItem*) nextopt())) {
                  char *name  = it->fOptName;
                  char *label = it->fOptLabel;
                  Long_t value  = it->fValue;
                  if (value != -9999) {
                     char val[256];
                     snprintf(val,256, "%li", value);
                     o->AddItem(name, val);
                  }else
                     o->AddItem(name, label);
               }
               o->SetData(val);
               fDialog->Add(o);
#endif
            } else {
               // we haven't got options - textfield ...
               fDialog->Add(argname, val, type);
            }
         } else {    // if m not found ...

            char val[256] = "";
            const char *tval = argument->GetDefault();
            if (tval && strlen(tval)) {
               // Remove leading and trailing quotes
               strlcpy(val, tval + (tval[0] == '"' ? 1 : 0), sizeof(val));
               if (val[strlen(val)-1] == '"')
                  val[strlen(val)-1]= 0;
            }
            fDialog->Add(argname, val, type);
         }
      }
      argpos++;
   }

   fDialog->Popup();
}

//______________________________________________________________________________
void TRootContextMenu::DrawEntry(TGMenuEntry *entry)
{
   // Draw context menu entry.

   int ty, offset;
   static int max_ascent = 0, max_descent = 0;

   TGPopupMenu::DrawEntry(entry);
   // draw the ? (help) in the right side when highlighting a menu entry
   if (entry->GetType() == kMenuEntry && (entry->GetStatus() & kMenuActiveMask)) {
      if (max_ascent == 0) {
         gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
      }
      offset = (entry->GetEh() - (max_ascent + max_descent)) / 2;
      ty = entry->GetEy() + max_ascent + offset - 1;
      TGHotString s("&?");
      s.Draw(fId, fSelGC, fMenuWidth-12, ty);
   }
}

//______________________________________________________________________________
Bool_t TRootContextMenu::HandleButton(Event_t *event)
{
   // Handle button event in the context menu.

   int   id;
   void *ud = 0;

   if ((event->fType == kButtonRelease) && (event->fX >= (Int_t)(fMenuWidth-15)) &&
       (event->fX <= (Int_t)fMenuWidth)) {
      id = EndMenu(ud);
      if (fHasGrab) gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);  // ungrab
      if (ud) {
         // retrieve the highlighted function
         TFunction *function = 0;
         if (id < kToggleStart) {
            TMethod *m = (TMethod *)ud;
            function = (TFunction *)m;
         } else if (id >= kToggleStart && id < kUserFunctionStart) {
            TToggle *t = (TToggle *)ud;
            TMethodCall *mc = (TMethodCall *)t->GetSetter();
            function = (TFunction *)mc->GetMethod();
         } else {
            TClassMenuItem *mi = (TClassMenuItem *)ud;
            function = gROOT->GetGlobalFunctionWithPrototype(mi->GetFunctionName());
         }
         if (function)
            fContextMenu->SetMethod(function);
      }
      OnlineHelp();
      return kTRUE;
   }
   return TGPopupMenu::HandleButton(event);
}

//______________________________________________________________________________
Bool_t TRootContextMenu::HandleCrossing(Event_t *event)
{
   // Handle pointer crossing event in context menu.

   if (event->fType == kLeaveNotify) {
      // just to reset the mouse pointer...
      HandleMotion(event);
   }
   return TGPopupMenu::HandleCrossing(event);
}

//______________________________________________________________________________
Bool_t TRootContextMenu::HandleMotion(Event_t *event)
{
   // Handle pointer motion event in context menu.

   static int toggle = 0;
   static Cursor_t handCur = kNone, rightCur = kNone;
   static UInt_t mask = kButtonPressMask | kButtonReleaseMask | kPointerMotionMask;

   if (handCur == kNone)
      handCur    = gVirtualX->CreateCursor(kHand);
   if (rightCur == kNone)
      rightCur   = gVirtualX->CreateCursor(kArrowRight);

   if (event->fType == kLeaveNotify) {
      gVirtualX->ChangeActivePointerGrab(fId, mask, rightCur);
      toggle = 0;
      return kTRUE;
   }
   // change the cursot to a small hand when over the ? (help)
   if ((event->fX >= (Int_t)(fMenuWidth-15)) && (event->fX <= (Int_t)fMenuWidth) &&
       fCurrent && (fCurrent->GetType() == kMenuEntry)) {
      if (toggle == 0) {
         gVirtualX->ChangeActivePointerGrab(fId, mask, handCur);
         toggle = 1;
      }
   }
   else {
      if (toggle == 1) {
         gVirtualX->ChangeActivePointerGrab(fId, mask, rightCur);
         toggle = 0;
      }
   }
   return TGPopupMenu::HandleMotion(event);
}

//______________________________________________________________________________
void TRootContextMenu::OnlineHelp()
{
   // Open the online help matching the actual class/method.

   TString clname;
   TString cmd;
   TString url = gEnv->GetValue("Browser.StartUrl", "http://root.cern.ch/root/html/");
   if (url.EndsWith(".html", TString::kIgnoreCase)) {
      if (url.Last('/') != kNPOS)
         url.Remove(url.Last('/'));
   }
   if (!url.EndsWith("/")) {
      url += '/';
   }
   TObject *obj = fContextMenu->GetSelectedObject();
   if (obj) {
      clname = obj->ClassName();
      if (fContextMenu->GetSelectedMethod()) {
         TString smeth = fContextMenu->GetSelectedMethod()->GetName();
         TMethod *method = obj->IsA()->GetMethodAllAny(smeth.Data());
         if (method) clname = method->GetClass()->GetName();
         url += clname;
         url += ".html";
         url += "#";
         url += clname;
         url += ":";
         url += smeth.Data();
      }
      else {
         url += clname;
         url += ".html";
      }
      if (fDialog) delete fDialog;
      fDialog = 0;
      cmd = TString::Format("new TGHtmlBrowser(\"%s\", 0, 900, 300);", url.Data());
      gROOT->ProcessLine(cmd.Data());
   }
}

//______________________________________________________________________________
Bool_t TRootContextMenu::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
{
   // Handle context menu messages.

   TObjectSpy savedPad;
   if (GetContextMenu()->GetSelectedPad()) {
      savedPad.SetObject(gPad);
      gPad = GetContextMenu()->GetSelectedPad();
   }

   switch (GET_MSG(msg)) {

      case kC_COMMAND:

         switch (GET_SUBMSG(msg)) {

            case kCM_MENU:

               if (parm1 < kToggleStart) {
                  TMethod *m = (TMethod *) parm2;
                  GetContextMenu()->Action(m);
               } else if (parm1 >= kToggleStart && parm1 < kToggleListStart) {
                  TToggle *t = (TToggle *) parm2;
                  GetContextMenu()->Action(t);
               } else if (parm1 >= kToggleListStart && parm1<kUserFunctionStart) {
                  TToggle *t = (TToggle *) parm2;
                  if (t->GetState() == 0)
                     t->SetState(1);
               } else {
                  TClassMenuItem *mi = (TClassMenuItem*)parm2;
                  GetContextMenu()->Action(mi);
               }
               break;

            case kCM_BUTTON:
               if (parm1 == 1) {
                  const char *args = fDialog->GetParameters();
                  GetContextMenu()->Execute((char *)args);
                  delete fDialog;
                  fDialog = 0;
               }
               if (parm1 == 2) {
                  const char *args = fDialog->GetParameters();
                  GetContextMenu()->Execute((char *)args);
               }
               if (parm1 == 3) {
                  delete fDialog;
                  fDialog = 0;
               }
               if (parm1 == 4) {
                  OnlineHelp();
               }
               break;

            default:
               break;
         }
         break;

      case kC_TEXTENTRY:

         switch (GET_SUBMSG(msg)) {

            case kTE_ENTER:
               {
                  const char *args = fDialog->GetParameters();
                  GetContextMenu()->Execute((char *)args);
                  delete fDialog;
                  fDialog = 0;
               }
               break;

            default:
               break;
         }
         break;

      default:
         break;
   }

   if (savedPad.GetObject()) gPad = (TVirtualPad*) savedPad.GetObject();

   return kTRUE;
}

//______________________________________________________________________________
void TRootContextMenu::RecursiveRemove(TObject *obj)
{
   // Close the context menu if the object is deleted in the
   // RecursiveRemove() operation.

   void *ud;
   if (obj == fContextMenu->GetSelectedCanvas())
      fContextMenu->SetCanvas(0);
   if (obj == fContextMenu->GetSelectedPad())
      fContextMenu->SetPad(0);
   if (obj == fContextMenu->GetSelectedObject()) {
      // if the object being deleted is the one selected,
      // ungrab the mouse pointer and terminate (close) the menu
      fContextMenu->SetObject(0);
      if (fHasGrab) 
         gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE);
      EndMenu(ud);
   }
}

 TRootContextMenu.cxx:1
 TRootContextMenu.cxx:2
 TRootContextMenu.cxx:3
 TRootContextMenu.cxx:4
 TRootContextMenu.cxx:5
 TRootContextMenu.cxx:6
 TRootContextMenu.cxx:7
 TRootContextMenu.cxx:8
 TRootContextMenu.cxx:9
 TRootContextMenu.cxx:10
 TRootContextMenu.cxx:11
 TRootContextMenu.cxx:12
 TRootContextMenu.cxx:13
 TRootContextMenu.cxx:14
 TRootContextMenu.cxx:15
 TRootContextMenu.cxx:16
 TRootContextMenu.cxx:17
 TRootContextMenu.cxx:18
 TRootContextMenu.cxx:19
 TRootContextMenu.cxx:20
 TRootContextMenu.cxx:21
 TRootContextMenu.cxx:22
 TRootContextMenu.cxx:23
 TRootContextMenu.cxx:24
 TRootContextMenu.cxx:25
 TRootContextMenu.cxx:26
 TRootContextMenu.cxx:27
 TRootContextMenu.cxx:28
 TRootContextMenu.cxx:29
 TRootContextMenu.cxx:30
 TRootContextMenu.cxx:31
 TRootContextMenu.cxx:32
 TRootContextMenu.cxx:33
 TRootContextMenu.cxx:34
 TRootContextMenu.cxx:35
 TRootContextMenu.cxx:36
 TRootContextMenu.cxx:37
 TRootContextMenu.cxx:38
 TRootContextMenu.cxx:39
 TRootContextMenu.cxx:40
 TRootContextMenu.cxx:41
 TRootContextMenu.cxx:42
 TRootContextMenu.cxx:43
 TRootContextMenu.cxx:44
 TRootContextMenu.cxx:45
 TRootContextMenu.cxx:46
 TRootContextMenu.cxx:47
 TRootContextMenu.cxx:48
 TRootContextMenu.cxx:49
 TRootContextMenu.cxx:50
 TRootContextMenu.cxx:51
 TRootContextMenu.cxx:52
 TRootContextMenu.cxx:53
 TRootContextMenu.cxx:54
 TRootContextMenu.cxx:55
 TRootContextMenu.cxx:56
 TRootContextMenu.cxx:57
 TRootContextMenu.cxx:58
 TRootContextMenu.cxx:59
 TRootContextMenu.cxx:60
 TRootContextMenu.cxx:61
 TRootContextMenu.cxx:62
 TRootContextMenu.cxx:63
 TRootContextMenu.cxx:64
 TRootContextMenu.cxx:65
 TRootContextMenu.cxx:66
 TRootContextMenu.cxx:67
 TRootContextMenu.cxx:68
 TRootContextMenu.cxx:69
 TRootContextMenu.cxx:70
 TRootContextMenu.cxx:71
 TRootContextMenu.cxx:72
 TRootContextMenu.cxx:73
 TRootContextMenu.cxx:74
 TRootContextMenu.cxx:75
 TRootContextMenu.cxx:76
 TRootContextMenu.cxx:77
 TRootContextMenu.cxx:78
 TRootContextMenu.cxx:79
 TRootContextMenu.cxx:80
 TRootContextMenu.cxx:81
 TRootContextMenu.cxx:82
 TRootContextMenu.cxx:83
 TRootContextMenu.cxx:84
 TRootContextMenu.cxx:85
 TRootContextMenu.cxx:86
 TRootContextMenu.cxx:87
 TRootContextMenu.cxx:88
 TRootContextMenu.cxx:89
 TRootContextMenu.cxx:90
 TRootContextMenu.cxx:91
 TRootContextMenu.cxx:92
 TRootContextMenu.cxx:93
 TRootContextMenu.cxx:94
 TRootContextMenu.cxx:95
 TRootContextMenu.cxx:96
 TRootContextMenu.cxx:97
 TRootContextMenu.cxx:98
 TRootContextMenu.cxx:99
 TRootContextMenu.cxx:100
 TRootContextMenu.cxx:101
 TRootContextMenu.cxx:102
 TRootContextMenu.cxx:103
 TRootContextMenu.cxx:104
 TRootContextMenu.cxx:105
 TRootContextMenu.cxx:106
 TRootContextMenu.cxx:107
 TRootContextMenu.cxx:108
 TRootContextMenu.cxx:109
 TRootContextMenu.cxx:110
 TRootContextMenu.cxx:111
 TRootContextMenu.cxx:112
 TRootContextMenu.cxx:113
 TRootContextMenu.cxx:114
 TRootContextMenu.cxx:115
 TRootContextMenu.cxx:116
 TRootContextMenu.cxx:117
 TRootContextMenu.cxx:118
 TRootContextMenu.cxx:119
 TRootContextMenu.cxx:120
 TRootContextMenu.cxx:121
 TRootContextMenu.cxx:122
 TRootContextMenu.cxx:123
 TRootContextMenu.cxx:124
 TRootContextMenu.cxx:125
 TRootContextMenu.cxx:126
 TRootContextMenu.cxx:127
 TRootContextMenu.cxx:128
 TRootContextMenu.cxx:129
 TRootContextMenu.cxx:130
 TRootContextMenu.cxx:131
 TRootContextMenu.cxx:132
 TRootContextMenu.cxx:133
 TRootContextMenu.cxx:134
 TRootContextMenu.cxx:135
 TRootContextMenu.cxx:136
 TRootContextMenu.cxx:137
 TRootContextMenu.cxx:138
 TRootContextMenu.cxx:139
 TRootContextMenu.cxx:140
 TRootContextMenu.cxx:141
 TRootContextMenu.cxx:142
 TRootContextMenu.cxx:143
 TRootContextMenu.cxx:144
 TRootContextMenu.cxx:145
 TRootContextMenu.cxx:146
 TRootContextMenu.cxx:147
 TRootContextMenu.cxx:148
 TRootContextMenu.cxx:149
 TRootContextMenu.cxx:150
 TRootContextMenu.cxx:151
 TRootContextMenu.cxx:152
 TRootContextMenu.cxx:153
 TRootContextMenu.cxx:154
 TRootContextMenu.cxx:155
 TRootContextMenu.cxx:156
 TRootContextMenu.cxx:157
 TRootContextMenu.cxx:158
 TRootContextMenu.cxx:159
 TRootContextMenu.cxx:160
 TRootContextMenu.cxx:161
 TRootContextMenu.cxx:162
 TRootContextMenu.cxx:163
 TRootContextMenu.cxx:164
 TRootContextMenu.cxx:165
 TRootContextMenu.cxx:166
 TRootContextMenu.cxx:167
 TRootContextMenu.cxx:168
 TRootContextMenu.cxx:169
 TRootContextMenu.cxx:170
 TRootContextMenu.cxx:171
 TRootContextMenu.cxx:172
 TRootContextMenu.cxx:173
 TRootContextMenu.cxx:174
 TRootContextMenu.cxx:175
 TRootContextMenu.cxx:176
 TRootContextMenu.cxx:177
 TRootContextMenu.cxx:178
 TRootContextMenu.cxx:179
 TRootContextMenu.cxx:180
 TRootContextMenu.cxx:181
 TRootContextMenu.cxx:182
 TRootContextMenu.cxx:183
 TRootContextMenu.cxx:184
 TRootContextMenu.cxx:185
 TRootContextMenu.cxx:186
 TRootContextMenu.cxx:187
 TRootContextMenu.cxx:188
 TRootContextMenu.cxx:189
 TRootContextMenu.cxx:190
 TRootContextMenu.cxx:191
 TRootContextMenu.cxx:192
 TRootContextMenu.cxx:193
 TRootContextMenu.cxx:194
 TRootContextMenu.cxx:195
 TRootContextMenu.cxx:196
 TRootContextMenu.cxx:197
 TRootContextMenu.cxx:198
 TRootContextMenu.cxx:199
 TRootContextMenu.cxx:200
 TRootContextMenu.cxx:201
 TRootContextMenu.cxx:202
 TRootContextMenu.cxx:203
 TRootContextMenu.cxx:204
 TRootContextMenu.cxx:205
 TRootContextMenu.cxx:206
 TRootContextMenu.cxx:207
 TRootContextMenu.cxx:208
 TRootContextMenu.cxx:209
 TRootContextMenu.cxx:210
 TRootContextMenu.cxx:211
 TRootContextMenu.cxx:212
 TRootContextMenu.cxx:213
 TRootContextMenu.cxx:214
 TRootContextMenu.cxx:215
 TRootContextMenu.cxx:216
 TRootContextMenu.cxx:217
 TRootContextMenu.cxx:218
 TRootContextMenu.cxx:219
 TRootContextMenu.cxx:220
 TRootContextMenu.cxx:221
 TRootContextMenu.cxx:222
 TRootContextMenu.cxx:223
 TRootContextMenu.cxx:224
 TRootContextMenu.cxx:225
 TRootContextMenu.cxx:226
 TRootContextMenu.cxx:227
 TRootContextMenu.cxx:228
 TRootContextMenu.cxx:229
 TRootContextMenu.cxx:230
 TRootContextMenu.cxx:231
 TRootContextMenu.cxx:232
 TRootContextMenu.cxx:233
 TRootContextMenu.cxx:234
 TRootContextMenu.cxx:235
 TRootContextMenu.cxx:236
 TRootContextMenu.cxx:237
 TRootContextMenu.cxx:238
 TRootContextMenu.cxx:239
 TRootContextMenu.cxx:240
 TRootContextMenu.cxx:241
 TRootContextMenu.cxx:242
 TRootContextMenu.cxx:243
 TRootContextMenu.cxx:244
 TRootContextMenu.cxx:245
 TRootContextMenu.cxx:246
 TRootContextMenu.cxx:247
 TRootContextMenu.cxx:248
 TRootContextMenu.cxx:249
 TRootContextMenu.cxx:250
 TRootContextMenu.cxx:251
 TRootContextMenu.cxx:252
 TRootContextMenu.cxx:253
 TRootContextMenu.cxx:254
 TRootContextMenu.cxx:255
 TRootContextMenu.cxx:256
 TRootContextMenu.cxx:257
 TRootContextMenu.cxx:258
 TRootContextMenu.cxx:259
 TRootContextMenu.cxx:260
 TRootContextMenu.cxx:261
 TRootContextMenu.cxx:262
 TRootContextMenu.cxx:263
 TRootContextMenu.cxx:264
 TRootContextMenu.cxx:265
 TRootContextMenu.cxx:266
 TRootContextMenu.cxx:267
 TRootContextMenu.cxx:268
 TRootContextMenu.cxx:269
 TRootContextMenu.cxx:270
 TRootContextMenu.cxx:271
 TRootContextMenu.cxx:272
 TRootContextMenu.cxx:273
 TRootContextMenu.cxx:274
 TRootContextMenu.cxx:275
 TRootContextMenu.cxx:276
 TRootContextMenu.cxx:277
 TRootContextMenu.cxx:278
 TRootContextMenu.cxx:279
 TRootContextMenu.cxx:280
 TRootContextMenu.cxx:281
 TRootContextMenu.cxx:282
 TRootContextMenu.cxx:283
 TRootContextMenu.cxx:284
 TRootContextMenu.cxx:285
 TRootContextMenu.cxx:286
 TRootContextMenu.cxx:287
 TRootContextMenu.cxx:288
 TRootContextMenu.cxx:289
 TRootContextMenu.cxx:290
 TRootContextMenu.cxx:291
 TRootContextMenu.cxx:292
 TRootContextMenu.cxx:293
 TRootContextMenu.cxx:294
 TRootContextMenu.cxx:295
 TRootContextMenu.cxx:296
 TRootContextMenu.cxx:297
 TRootContextMenu.cxx:298
 TRootContextMenu.cxx:299
 TRootContextMenu.cxx:300
 TRootContextMenu.cxx:301
 TRootContextMenu.cxx:302
 TRootContextMenu.cxx:303
 TRootContextMenu.cxx:304
 TRootContextMenu.cxx:305
 TRootContextMenu.cxx:306
 TRootContextMenu.cxx:307
 TRootContextMenu.cxx:308
 TRootContextMenu.cxx:309
 TRootContextMenu.cxx:310
 TRootContextMenu.cxx:311
 TRootContextMenu.cxx:312
 TRootContextMenu.cxx:313
 TRootContextMenu.cxx:314
 TRootContextMenu.cxx:315
 TRootContextMenu.cxx:316
 TRootContextMenu.cxx:317
 TRootContextMenu.cxx:318
 TRootContextMenu.cxx:319
 TRootContextMenu.cxx:320
 TRootContextMenu.cxx:321
 TRootContextMenu.cxx:322
 TRootContextMenu.cxx:323
 TRootContextMenu.cxx:324
 TRootContextMenu.cxx:325
 TRootContextMenu.cxx:326
 TRootContextMenu.cxx:327
 TRootContextMenu.cxx:328
 TRootContextMenu.cxx:329
 TRootContextMenu.cxx:330
 TRootContextMenu.cxx:331
 TRootContextMenu.cxx:332
 TRootContextMenu.cxx:333
 TRootContextMenu.cxx:334
 TRootContextMenu.cxx:335
 TRootContextMenu.cxx:336
 TRootContextMenu.cxx:337
 TRootContextMenu.cxx:338
 TRootContextMenu.cxx:339
 TRootContextMenu.cxx:340
 TRootContextMenu.cxx:341
 TRootContextMenu.cxx:342
 TRootContextMenu.cxx:343
 TRootContextMenu.cxx:344
 TRootContextMenu.cxx:345
 TRootContextMenu.cxx:346
 TRootContextMenu.cxx:347
 TRootContextMenu.cxx:348
 TRootContextMenu.cxx:349
 TRootContextMenu.cxx:350
 TRootContextMenu.cxx:351
 TRootContextMenu.cxx:352
 TRootContextMenu.cxx:353
 TRootContextMenu.cxx:354
 TRootContextMenu.cxx:355
 TRootContextMenu.cxx:356
 TRootContextMenu.cxx:357
 TRootContextMenu.cxx:358
 TRootContextMenu.cxx:359
 TRootContextMenu.cxx:360
 TRootContextMenu.cxx:361
 TRootContextMenu.cxx:362
 TRootContextMenu.cxx:363
 TRootContextMenu.cxx:364
 TRootContextMenu.cxx:365
 TRootContextMenu.cxx:366
 TRootContextMenu.cxx:367
 TRootContextMenu.cxx:368
 TRootContextMenu.cxx:369
 TRootContextMenu.cxx:370
 TRootContextMenu.cxx:371
 TRootContextMenu.cxx:372
 TRootContextMenu.cxx:373
 TRootContextMenu.cxx:374
 TRootContextMenu.cxx:375
 TRootContextMenu.cxx:376
 TRootContextMenu.cxx:377
 TRootContextMenu.cxx:378
 TRootContextMenu.cxx:379
 TRootContextMenu.cxx:380
 TRootContextMenu.cxx:381
 TRootContextMenu.cxx:382
 TRootContextMenu.cxx:383
 TRootContextMenu.cxx:384
 TRootContextMenu.cxx:385
 TRootContextMenu.cxx:386
 TRootContextMenu.cxx:387
 TRootContextMenu.cxx:388
 TRootContextMenu.cxx:389
 TRootContextMenu.cxx:390
 TRootContextMenu.cxx:391
 TRootContextMenu.cxx:392
 TRootContextMenu.cxx:393
 TRootContextMenu.cxx:394
 TRootContextMenu.cxx:395
 TRootContextMenu.cxx:396
 TRootContextMenu.cxx:397
 TRootContextMenu.cxx:398
 TRootContextMenu.cxx:399
 TRootContextMenu.cxx:400
 TRootContextMenu.cxx:401
 TRootContextMenu.cxx:402
 TRootContextMenu.cxx:403
 TRootContextMenu.cxx:404
 TRootContextMenu.cxx:405
 TRootContextMenu.cxx:406
 TRootContextMenu.cxx:407
 TRootContextMenu.cxx:408
 TRootContextMenu.cxx:409
 TRootContextMenu.cxx:410
 TRootContextMenu.cxx:411
 TRootContextMenu.cxx:412
 TRootContextMenu.cxx:413
 TRootContextMenu.cxx:414
 TRootContextMenu.cxx:415
 TRootContextMenu.cxx:416
 TRootContextMenu.cxx:417
 TRootContextMenu.cxx:418
 TRootContextMenu.cxx:419
 TRootContextMenu.cxx:420
 TRootContextMenu.cxx:421
 TRootContextMenu.cxx:422
 TRootContextMenu.cxx:423
 TRootContextMenu.cxx:424
 TRootContextMenu.cxx:425
 TRootContextMenu.cxx:426
 TRootContextMenu.cxx:427
 TRootContextMenu.cxx:428
 TRootContextMenu.cxx:429
 TRootContextMenu.cxx:430
 TRootContextMenu.cxx:431
 TRootContextMenu.cxx:432
 TRootContextMenu.cxx:433
 TRootContextMenu.cxx:434
 TRootContextMenu.cxx:435
 TRootContextMenu.cxx:436
 TRootContextMenu.cxx:437
 TRootContextMenu.cxx:438
 TRootContextMenu.cxx:439
 TRootContextMenu.cxx:440
 TRootContextMenu.cxx:441
 TRootContextMenu.cxx:442
 TRootContextMenu.cxx:443
 TRootContextMenu.cxx:444
 TRootContextMenu.cxx:445
 TRootContextMenu.cxx:446
 TRootContextMenu.cxx:447
 TRootContextMenu.cxx:448
 TRootContextMenu.cxx:449
 TRootContextMenu.cxx:450
 TRootContextMenu.cxx:451
 TRootContextMenu.cxx:452
 TRootContextMenu.cxx:453
 TRootContextMenu.cxx:454
 TRootContextMenu.cxx:455
 TRootContextMenu.cxx:456
 TRootContextMenu.cxx:457
 TRootContextMenu.cxx:458
 TRootContextMenu.cxx:459
 TRootContextMenu.cxx:460
 TRootContextMenu.cxx:461
 TRootContextMenu.cxx:462
 TRootContextMenu.cxx:463
 TRootContextMenu.cxx:464
 TRootContextMenu.cxx:465
 TRootContextMenu.cxx:466
 TRootContextMenu.cxx:467
 TRootContextMenu.cxx:468
 TRootContextMenu.cxx:469
 TRootContextMenu.cxx:470
 TRootContextMenu.cxx:471
 TRootContextMenu.cxx:472
 TRootContextMenu.cxx:473
 TRootContextMenu.cxx:474
 TRootContextMenu.cxx:475
 TRootContextMenu.cxx:476
 TRootContextMenu.cxx:477
 TRootContextMenu.cxx:478
 TRootContextMenu.cxx:479
 TRootContextMenu.cxx:480
 TRootContextMenu.cxx:481
 TRootContextMenu.cxx:482
 TRootContextMenu.cxx:483
 TRootContextMenu.cxx:484
 TRootContextMenu.cxx:485
 TRootContextMenu.cxx:486
 TRootContextMenu.cxx:487
 TRootContextMenu.cxx:488
 TRootContextMenu.cxx:489
 TRootContextMenu.cxx:490
 TRootContextMenu.cxx:491
 TRootContextMenu.cxx:492
 TRootContextMenu.cxx:493
 TRootContextMenu.cxx:494
 TRootContextMenu.cxx:495
 TRootContextMenu.cxx:496
 TRootContextMenu.cxx:497
 TRootContextMenu.cxx:498
 TRootContextMenu.cxx:499
 TRootContextMenu.cxx:500
 TRootContextMenu.cxx:501
 TRootContextMenu.cxx:502
 TRootContextMenu.cxx:503
 TRootContextMenu.cxx:504
 TRootContextMenu.cxx:505
 TRootContextMenu.cxx:506
 TRootContextMenu.cxx:507
 TRootContextMenu.cxx:508
 TRootContextMenu.cxx:509
 TRootContextMenu.cxx:510
 TRootContextMenu.cxx:511
 TRootContextMenu.cxx:512
 TRootContextMenu.cxx:513
 TRootContextMenu.cxx:514
 TRootContextMenu.cxx:515
 TRootContextMenu.cxx:516
 TRootContextMenu.cxx:517
 TRootContextMenu.cxx:518
 TRootContextMenu.cxx:519
 TRootContextMenu.cxx:520
 TRootContextMenu.cxx:521
 TRootContextMenu.cxx:522
 TRootContextMenu.cxx:523
 TRootContextMenu.cxx:524
 TRootContextMenu.cxx:525
 TRootContextMenu.cxx:526
 TRootContextMenu.cxx:527
 TRootContextMenu.cxx:528
 TRootContextMenu.cxx:529
 TRootContextMenu.cxx:530
 TRootContextMenu.cxx:531
 TRootContextMenu.cxx:532
 TRootContextMenu.cxx:533
 TRootContextMenu.cxx:534
 TRootContextMenu.cxx:535
 TRootContextMenu.cxx:536
 TRootContextMenu.cxx:537
 TRootContextMenu.cxx:538
 TRootContextMenu.cxx:539
 TRootContextMenu.cxx:540
 TRootContextMenu.cxx:541
 TRootContextMenu.cxx:542
 TRootContextMenu.cxx:543
 TRootContextMenu.cxx:544
 TRootContextMenu.cxx:545
 TRootContextMenu.cxx:546
 TRootContextMenu.cxx:547
 TRootContextMenu.cxx:548
 TRootContextMenu.cxx:549
 TRootContextMenu.cxx:550
 TRootContextMenu.cxx:551
 TRootContextMenu.cxx:552
 TRootContextMenu.cxx:553
 TRootContextMenu.cxx:554
 TRootContextMenu.cxx:555
 TRootContextMenu.cxx:556
 TRootContextMenu.cxx:557
 TRootContextMenu.cxx:558
 TRootContextMenu.cxx:559
 TRootContextMenu.cxx:560
 TRootContextMenu.cxx:561
 TRootContextMenu.cxx:562
 TRootContextMenu.cxx:563
 TRootContextMenu.cxx:564
 TRootContextMenu.cxx:565
 TRootContextMenu.cxx:566
 TRootContextMenu.cxx:567
 TRootContextMenu.cxx:568
 TRootContextMenu.cxx:569
 TRootContextMenu.cxx:570
 TRootContextMenu.cxx:571
 TRootContextMenu.cxx:572
 TRootContextMenu.cxx:573
 TRootContextMenu.cxx:574
 TRootContextMenu.cxx:575
 TRootContextMenu.cxx:576
 TRootContextMenu.cxx:577
 TRootContextMenu.cxx:578
 TRootContextMenu.cxx:579
 TRootContextMenu.cxx:580
 TRootContextMenu.cxx:581
 TRootContextMenu.cxx:582
 TRootContextMenu.cxx:583
 TRootContextMenu.cxx:584
 TRootContextMenu.cxx:585
 TRootContextMenu.cxx:586
 TRootContextMenu.cxx:587
 TRootContextMenu.cxx:588
 TRootContextMenu.cxx:589
 TRootContextMenu.cxx:590
 TRootContextMenu.cxx:591
 TRootContextMenu.cxx:592
 TRootContextMenu.cxx:593
 TRootContextMenu.cxx:594
 TRootContextMenu.cxx:595
 TRootContextMenu.cxx:596
 TRootContextMenu.cxx:597
 TRootContextMenu.cxx:598
 TRootContextMenu.cxx:599
 TRootContextMenu.cxx:600
 TRootContextMenu.cxx:601
 TRootContextMenu.cxx:602
 TRootContextMenu.cxx:603
 TRootContextMenu.cxx:604
 TRootContextMenu.cxx:605
 TRootContextMenu.cxx:606
 TRootContextMenu.cxx:607
 TRootContextMenu.cxx:608
 TRootContextMenu.cxx:609
 TRootContextMenu.cxx:610
 TRootContextMenu.cxx:611
 TRootContextMenu.cxx:612
 TRootContextMenu.cxx:613
 TRootContextMenu.cxx:614
 TRootContextMenu.cxx:615
 TRootContextMenu.cxx:616
 TRootContextMenu.cxx:617
 TRootContextMenu.cxx:618
 TRootContextMenu.cxx:619
 TRootContextMenu.cxx:620
 TRootContextMenu.cxx:621
 TRootContextMenu.cxx:622
 TRootContextMenu.cxx:623
 TRootContextMenu.cxx:624
 TRootContextMenu.cxx:625
 TRootContextMenu.cxx:626
 TRootContextMenu.cxx:627
 TRootContextMenu.cxx:628
 TRootContextMenu.cxx:629
 TRootContextMenu.cxx:630
 TRootContextMenu.cxx:631
 TRootContextMenu.cxx:632
 TRootContextMenu.cxx:633
 TRootContextMenu.cxx:634
 TRootContextMenu.cxx:635
 TRootContextMenu.cxx:636
 TRootContextMenu.cxx:637
 TRootContextMenu.cxx:638
 TRootContextMenu.cxx:639
 TRootContextMenu.cxx:640
 TRootContextMenu.cxx:641
 TRootContextMenu.cxx:642
 TRootContextMenu.cxx:643
 TRootContextMenu.cxx:644
 TRootContextMenu.cxx:645
 TRootContextMenu.cxx:646
 TRootContextMenu.cxx:647
 TRootContextMenu.cxx:648
 TRootContextMenu.cxx:649
 TRootContextMenu.cxx:650
 TRootContextMenu.cxx:651
 TRootContextMenu.cxx:652
 TRootContextMenu.cxx:653
 TRootContextMenu.cxx:654
 TRootContextMenu.cxx:655
 TRootContextMenu.cxx:656
 TRootContextMenu.cxx:657
 TRootContextMenu.cxx:658
 TRootContextMenu.cxx:659
 TRootContextMenu.cxx:660
 TRootContextMenu.cxx:661
 TRootContextMenu.cxx:662
 TRootContextMenu.cxx:663
 TRootContextMenu.cxx:664
 TRootContextMenu.cxx:665
 TRootContextMenu.cxx:666
 TRootContextMenu.cxx:667
 TRootContextMenu.cxx:668
 TRootContextMenu.cxx:669
 TRootContextMenu.cxx:670
 TRootContextMenu.cxx:671
 TRootContextMenu.cxx:672
 TRootContextMenu.cxx:673
 TRootContextMenu.cxx:674
 TRootContextMenu.cxx:675
 TRootContextMenu.cxx:676
 TRootContextMenu.cxx:677
 TRootContextMenu.cxx:678
 TRootContextMenu.cxx:679
 TRootContextMenu.cxx:680
 TRootContextMenu.cxx:681
 TRootContextMenu.cxx:682
 TRootContextMenu.cxx:683
 TRootContextMenu.cxx:684
 TRootContextMenu.cxx:685
 TRootContextMenu.cxx:686
 TRootContextMenu.cxx:687
 TRootContextMenu.cxx:688
 TRootContextMenu.cxx:689
 TRootContextMenu.cxx:690
 TRootContextMenu.cxx:691
 TRootContextMenu.cxx:692
 TRootContextMenu.cxx:693
 TRootContextMenu.cxx:694
 TRootContextMenu.cxx:695
 TRootContextMenu.cxx:696
 TRootContextMenu.cxx:697
 TRootContextMenu.cxx:698
 TRootContextMenu.cxx:699
 TRootContextMenu.cxx:700
 TRootContextMenu.cxx:701
 TRootContextMenu.cxx:702
 TRootContextMenu.cxx:703
 TRootContextMenu.cxx:704
 TRootContextMenu.cxx:705
 TRootContextMenu.cxx:706
 TRootContextMenu.cxx:707
 TRootContextMenu.cxx:708
 TRootContextMenu.cxx:709
 TRootContextMenu.cxx:710
 TRootContextMenu.cxx:711
 TRootContextMenu.cxx:712
 TRootContextMenu.cxx:713
 TRootContextMenu.cxx:714
 TRootContextMenu.cxx:715
 TRootContextMenu.cxx:716
 TRootContextMenu.cxx:717
 TRootContextMenu.cxx:718
 TRootContextMenu.cxx:719
 TRootContextMenu.cxx:720
 TRootContextMenu.cxx:721
 TRootContextMenu.cxx:722
 TRootContextMenu.cxx:723
 TRootContextMenu.cxx:724
 TRootContextMenu.cxx:725
 TRootContextMenu.cxx:726
 TRootContextMenu.cxx:727
 TRootContextMenu.cxx:728
 TRootContextMenu.cxx:729
 TRootContextMenu.cxx:730
 TRootContextMenu.cxx:731
 TRootContextMenu.cxx:732
 TRootContextMenu.cxx:733
 TRootContextMenu.cxx:734
 TRootContextMenu.cxx:735
 TRootContextMenu.cxx:736
 TRootContextMenu.cxx:737
 TRootContextMenu.cxx:738
 TRootContextMenu.cxx:739
 TRootContextMenu.cxx:740
 TRootContextMenu.cxx:741
 TRootContextMenu.cxx:742
 TRootContextMenu.cxx:743
 TRootContextMenu.cxx:744
 TRootContextMenu.cxx:745
 TRootContextMenu.cxx:746
 TRootContextMenu.cxx:747
 TRootContextMenu.cxx:748
 TRootContextMenu.cxx:749
 TRootContextMenu.cxx:750
 TRootContextMenu.cxx:751
 TRootContextMenu.cxx:752
 TRootContextMenu.cxx:753
 TRootContextMenu.cxx:754
 TRootContextMenu.cxx:755
 TRootContextMenu.cxx:756
 TRootContextMenu.cxx:757
 TRootContextMenu.cxx:758
 TRootContextMenu.cxx:759
 TRootContextMenu.cxx:760
 TRootContextMenu.cxx:761
 TRootContextMenu.cxx:762
 TRootContextMenu.cxx:763
 TRootContextMenu.cxx:764
 TRootContextMenu.cxx:765
 TRootContextMenu.cxx:766
 TRootContextMenu.cxx:767
 TRootContextMenu.cxx:768
 TRootContextMenu.cxx:769
 TRootContextMenu.cxx:770
 TRootContextMenu.cxx:771
 TRootContextMenu.cxx:772
 TRootContextMenu.cxx:773
 TRootContextMenu.cxx:774
 TRootContextMenu.cxx:775
 TRootContextMenu.cxx:776
 TRootContextMenu.cxx:777
 TRootContextMenu.cxx:778
 TRootContextMenu.cxx:779
 TRootContextMenu.cxx:780
 TRootContextMenu.cxx:781
 TRootContextMenu.cxx:782
 TRootContextMenu.cxx:783
 TRootContextMenu.cxx:784
 TRootContextMenu.cxx:785
 TRootContextMenu.cxx:786
 TRootContextMenu.cxx:787
 TRootContextMenu.cxx:788
 TRootContextMenu.cxx:789
 TRootContextMenu.cxx:790
 TRootContextMenu.cxx:791
 TRootContextMenu.cxx:792
 TRootContextMenu.cxx:793
 TRootContextMenu.cxx:794
 TRootContextMenu.cxx:795
 TRootContextMenu.cxx:796
 TRootContextMenu.cxx:797
 TRootContextMenu.cxx:798
 TRootContextMenu.cxx:799
 TRootContextMenu.cxx:800
 TRootContextMenu.cxx:801
 TRootContextMenu.cxx:802
 TRootContextMenu.cxx:803