#ifndef ROOT_TRootBrowser
#define ROOT_TRootBrowser
#ifndef ROOT_TGFrame
#include "TGFrame.h"
#endif
#ifndef ROOT_TBrowserImp
#include "TBrowserImp.h"
#endif
class TGLayoutHints;
class TGTab;
class TGMenuBar;
class TGPopupMenu;
class TGStatusBar;
class TGVSplitter;
class TGHSplitter;
class TBrowserPlugin : public TNamed
{
public:
Int_t fTab;
Int_t fSubTab;
TString fCommand;
TBrowserPlugin(const char *name, const char *cmd = "", Int_t tab = 1,
Int_t sub = -1) : TNamed(name, cmd), fTab(tab),
fSubTab(sub), fCommand(cmd) { }
virtual ~TBrowserPlugin() {}
void SetTab(Int_t tab) { fTab = tab; }
void SetSubTab(Int_t sub) { fSubTab = sub; }
void SetCommand(const char *cmd) { fCommand = cmd; }
ClassDef(TBrowserPlugin, 0)
};
class TRootBrowser : public TGMainFrame, public TBrowserImp {
private:
TRootBrowser(const TRootBrowser&);
TRootBrowser& operator=(const TRootBrowser&);
protected:
TGLayoutHints *fLH0, *fLH1, *fLH2, *fLH3;
TGLayoutHints *fLH4, *fLH5, *fLH6, *fLH7;
TGTab *fTabLeft;
TGTab *fTabRight;
TGTab *fTabBottom;
TGTab *fEditTab;
Int_t fEditPos;
Int_t fEditSubPos;
TGVerticalFrame *fVf;
TGHorizontalFrame *fHf;
TGHorizontalFrame *fH1;
TGHorizontalFrame *fH2;
TGVerticalFrame *fV1;
TGVerticalFrame *fV2;
TGVSplitter *fVSplitter;
TGHSplitter *fHSplitter;
TGCompositeFrame *fEditFrame;
TGHorizontalFrame *fTopMenuFrame;
TGHorizontalFrame *fPreMenuFrame;
TGHorizontalFrame *fMenuFrame;
TGHorizontalFrame *fToolbarFrame;
TGMenuBar *fMenuBar;
TGPopupMenu *fMenuFile;
TGPopupMenu *fMenuExecPlugin;
TGPopupMenu *fMenuHelp;
TGCompositeFrame *fActMenuBar;
TBrowserImp *fActBrowser;
TList fBrowsers;
TList fPlugins;
TGStatusBar *fStatusBar;
Int_t fNbInitPlugins;
Int_t fNbTab[3];
Int_t fCrTab[3];
Int_t fPid;
Bool_t fShowCloseTab;
public:
enum EInsertPosition {
kLeft, kRight, kBottom
};
TRootBrowser(TBrowser *b = 0, const char *name = "ROOT Browser", UInt_t width = 800, UInt_t height = 500, Option_t *opt="", Bool_t initshow=kTRUE);
TRootBrowser(TBrowser *b, const char *name, Int_t x, Int_t y, UInt_t width, UInt_t height, Option_t *opt="", Bool_t initshow=kTRUE);
virtual ~TRootBrowser();
void InitPlugins(Option_t *opt="");
void CreateBrowser(const char *name);
void CloneBrowser();
void CloseWindow();
void CloseTab(Int_t id);
void DoTab(Int_t id);
TGFrame *GetActFrame() const { return (TGFrame *)fEditFrame; }
TGFrame *GetToolbarFrame() const { return (TGFrame *)fToolbarFrame; }
TGStatusBar *GetStatusBar() const { return fStatusBar; }
TGTab *GetTabLeft() const { return fTabLeft; }
TGTab *GetTabRight() const { return fTabRight; }
TGTab *GetTabBottom() const { return fTabBottom; }
TGTab *GetTab(Int_t pos) const;
void SetTab(Int_t pos = kRight, Int_t subpos = -1);
void SetTabTitle(const char *title, Int_t pos = kRight, Int_t subpos = -1);
void HandleMenu(Int_t id);
void RecursiveReparent(TGPopupMenu *popup);
void RemoveTab(Int_t pos, Int_t subpos);
void SetActBrowser(TBrowserImp *b) { fActBrowser = b; }
void ShowMenu(TGCompositeFrame *menu);
virtual void StartEmbedding(Int_t pos = kRight, Int_t subpos = -1);
virtual void StopEmbedding(const char *name = 0) { StopEmbedding(name, 0); }
void StopEmbedding(const char *name, TGLayoutHints *layout);
void SwitchMenus(TGCompositeFrame *from);
virtual void BrowseObj(TObject *obj);
virtual void ExecuteDefaultAction(TObject *obj);
virtual void DoubleClicked(TObject *obj);
virtual void Checked(TObject *obj, Bool_t check);
virtual void Add(TObject *obj, const char *name = 0, Int_t check = -1);
virtual void RecursiveRemove(TObject *obj);
virtual void Refresh(Bool_t force = kFALSE);
virtual void Show() { MapRaised(); }
Option_t *GetDrawOption() const;
TGMainFrame *GetMainFrame() const { return (TGMainFrame *)this; }
virtual Long_t ExecPlugin(const char *name = 0, const char *fname = 0,
const char *cmd = 0, Int_t pos = kRight,
Int_t subpos = -1);
virtual void SetStatusText(const char *txt, Int_t col);
virtual Bool_t HandleKey(Event_t *event);
virtual void ShowCloseTab(Bool_t show) { fShowCloseTab = show; }
virtual Bool_t IsCloseTabShown() const { return fShowCloseTab; }
virtual void ReallyDelete();
static TBrowserImp *NewBrowser(TBrowser *b = 0, const char *title = "ROOT Browser", UInt_t width = 800, UInt_t height = 500, Option_t *opt="");
static TBrowserImp *NewBrowser(TBrowser *b, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height, Option_t *opt="");
ClassDef(TRootBrowser, 0)
};
#endif