BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
BesGMenuBar Class Reference

#include <BesGMenuBar.h>

+ Inheritance diagram for BesGMenuBar:

Public Member Functions

 BesGMenuBar (const TGWindow *p=0, UInt_t w=60, UInt_t h=20, UInt_t options=kHorizontalFrame|kRaisedFrame)
 
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)
 
BesGMenuTitleGetMenuTitle (Int_t i)
 

Protected Member Functions

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

Detailed Description

Definition at line 8 of file BesGMenuBar.h.

Constructor & Destructor Documentation

◆ BesGMenuBar()

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

Member Function Documentation

◆ AddFrameBefore()

void BesGMenuBar::AddFrameBefore ( TGFrame *  f,
TGLayoutHints *  l = 0,
TGPopupMenu *  before = 0 
)
protectedvirtual

Definition at line 43 of file BesGMenuBar.cxx.

45{
46 // Private version of AddFrame for menubar, to make sure that we
47 // indeed only add BesGMenuTitle objects to it. If before is not 0
48 // the menu will be added before it.
49
50 if (f->IsA() != BesGMenuTitle::Class()) {
51 Error("AddFrameBefore", "may only add BesGMenuTitle objects to a menu bar");
52 return;
53 }
54
55 if (!before) {
56 AddFrame(f, l);
57 return;
58 }
59
60 TGFrameElement *nw;
61
62 nw = new TGFrameElement;
63 nw->fFrame = f;
64 nw->fLayout = l ? l : fgDefaultHints;
65 nw->fState = 1;
66
67 TGFrameElement *el;
68 TIter next(fList);
69 while ((el = (TGFrameElement *) next())) {
70 BesGMenuTitle *t = (BesGMenuTitle *) el->fFrame;
71 if (t->GetMenu() == before) {
72 fList->AddBefore(el, nw);
73 return;
74 }
75 }
76 fList->Add(nw);
77}
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
TTree * t
Definition: binning.cxx:23
Index next(Index i)
Definition: EvtCyclic3.cc:107

Referenced by AddPopup().

◆ AddPopup() [1/2]

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

Definition at line 33 of file BesGMenuBar.cxx.

35{
36 // Add popup menu to menu bar. If before is not 0 the menu will be
37 // added before it.
38
39 AddPopup(new TGHotString(s), menu, l, before);
40}
XmlRpcServer s
Definition: HelloServer.cpp:11
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
Definition: BesGMenuBar.cxx:14

◆ AddPopup() [2/2]

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

Definition at line 14 of file BesGMenuBar.cxx.

16{
17 // Add popup menu to menu bar. The hot string will be adopted by the
18 // menubar (actually the menu title) and deleted when possible.
19 // If before is not 0 the menu will be added before it.
20
22 Int_t keycode;
23
24 AddFrameBefore(t = new BesGMenuTitle(this, s, menu), l, before);
25 fTitles->Add(t); // keep track of menu titles for later cleanup in dtor
26
27 if ((keycode = t->GetHotKeyCode()) != 0) {
28 BindHotKey(keycode, kTRUE);
29 }
30}
virtual void AddFrameBefore(TGFrame *f, TGLayoutHints *l=0, TGPopupMenu *before=0)
Definition: BesGMenuBar.cxx:43

Referenced by AddPopup(), and BesClient::CreateMenuBar().

◆ GetMenuTitle()

BesGMenuTitle * BesGMenuBar::GetMenuTitle ( Int_t  i)

Definition at line 80 of file BesGMenuBar.cxx.

81{
82 if (i >= 0 && i < fTitles->GetSize()) return (BesGMenuTitle*)fTitles->At(i);
83 else return 0;
84}

Referenced by BesClient::CreateMenuBar().


The documentation for this class was generated from the following files: