#include <BesGMenuBar.h>
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) | |
BesGMenuTitle * | GetMenuTitle (Int_t i) |
BesGMenuTitle * | GetMenuTitle (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) |
|
|
|
|
|
|
|
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 }
|
|
|
|
|
|
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 }
|
|
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 }
|
|
|
|
00081 { 00082 if (i >= 0 && i < fTitles->GetSize()) return (BesGMenuTitle*)fTitles->At(i); 00083 else return 0; 00084 }
|