Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

BesGMenuBar Class Reference

#include <BesGMenuBar.h>

List of all members.

Public Member Functions

virtual void AddPopup (const char *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
virtual void AddPopup (TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
virtual void AddPopup (const char *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
virtual void AddPopup (TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
 BesGMenuBar (const TGWindow *p=0, UInt_t w=60, UInt_t h=20, UInt_t options=kHorizontalFrame|kRaisedFrame)
 BesGMenuBar (const TGWindow *p=0, UInt_t w=60, UInt_t h=20, UInt_t options=kHorizontalFrame|kRaisedFrame)
BesGMenuTitleGetMenuTitle (Int_t i)
BesGMenuTitleGetMenuTitle (Int_t i)

Protected Member Functions

virtual void AddFrameBefore (TGFrame *f, TGLayoutHints *l=0, TGPopupMenu *before=0)
virtual void AddFrameBefore (TGFrame *f, TGLayoutHints *l=0, TGPopupMenu *before=0)


Constructor & Destructor Documentation

BesGMenuBar::BesGMenuBar const TGWindow *  p = 0,
UInt_t  w = 60,
UInt_t  h = 20,
UInt_t  options = kHorizontalFrame|kRaisedFrame
 

BesGMenuBar::BesGMenuBar const TGWindow *  p = 0,
UInt_t  w = 60,
UInt_t  h = 20,
UInt_t  options = kHorizontalFrame|kRaisedFrame
 


Member Function Documentation

virtual void BesGMenuBar::AddFrameBefore TGFrame *  f,
TGLayoutHints *  l = 0,
TGPopupMenu *  before = 0
[protected, virtual]
 

void BesGMenuBar::AddFrameBefore TGFrame *  f,
TGLayoutHints *  l = 0,
TGPopupMenu *  before = 0
[protected, virtual]
 

00045 {
00046     // Private version of AddFrame for menubar, to make sure that we
00047     // indeed only add BesGMenuTitle objects to it. If before is not 0
00048     // the menu will be added before it.
00049 
00050     if (f->IsA() != BesGMenuTitle::Class()) {
00051         Error("AddFrameBefore", "may only add BesGMenuTitle objects to a menu bar");
00052         return;
00053     }
00054 
00055     if (!before) {
00056         AddFrame(f, l);
00057         return;
00058     }
00059 
00060     TGFrameElement *nw;
00061 
00062     nw = new TGFrameElement;
00063     nw->fFrame  = f;
00064     nw->fLayout = l ? l : fgDefaultHints;
00065     nw->fState  = 1;
00066 
00067     TGFrameElement *el;
00068     TIter next(fList);
00069     while ((el = (TGFrameElement *) next())) {
00070         BesGMenuTitle *t = (BesGMenuTitle *) el->fFrame;
00071         if (t->GetMenu() == before) {
00072             fList->AddBefore(el, nw);
00073             return;
00074         }
00075     }
00076     fList->Add(nw);
00077 }

virtual void BesGMenuBar::AddPopup const char *  s,
TGPopupMenu *  menu,
TGLayoutHints *  l,
TGPopupMenu *  before = 0
[virtual]
 

virtual void BesGMenuBar::AddPopup TGHotString *  s,
TGPopupMenu *  menu,
TGLayoutHints *  l,
TGPopupMenu *  before = 0
[virtual]
 

void BesGMenuBar::AddPopup const char *  s,
TGPopupMenu *  menu,
TGLayoutHints *  l,
TGPopupMenu *  before = 0
[virtual]
 

00035 {
00036     // Add popup menu to menu bar. If before is not 0 the menu will be
00037     // added before it.
00038 
00039     AddPopup(new TGHotString(s), menu, l, before);
00040 }

void BesGMenuBar::AddPopup TGHotString *  s,
TGPopupMenu *  menu,
TGLayoutHints *  l,
TGPopupMenu *  before = 0
[virtual]
 

00016 {
00017     // Add popup menu to menu bar. The hot string will be adopted by the
00018     // menubar (actually the menu title) and deleted when possible.
00019     // If before is not 0 the menu will be added before it.
00020 
00021     BesGMenuTitle *t;
00022     Int_t keycode;
00023 
00024     AddFrameBefore(t = new BesGMenuTitle(this, s, menu), l, before);
00025     fTitles->Add(t);  // keep track of menu titles for later cleanup in dtor
00026 
00027     if ((keycode = t->GetHotKeyCode()) != 0) {
00028         BindHotKey(keycode, kTRUE);
00029     }
00030 }

BesGMenuTitle* BesGMenuBar::GetMenuTitle Int_t  i  ) 
 

BesGMenuTitle * BesGMenuBar::GetMenuTitle Int_t  i  ) 
 

00081 {
00082     if (i >= 0 && i < fTitles->GetSize()) return (BesGMenuTitle*)fTitles->At(i);
00083     else return 0;
00084 }


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 15:52:38 2011 for BOSS6.5.5 by  doxygen 1.3.9.1