12 #ifndef ROOT_TRootBrowser
13 #define ROOT_TRootBrowser
34 class TBrowserPlugin :
public TNamed
41 TBrowserPlugin(
const char *name,
const char *cmd =
"", Int_t tab = 1,
42 Int_t sub = -1) : TNamed(name, cmd), fTab(tab),
43 fSubTab(sub), fCommand(cmd) { }
44 virtual ~TBrowserPlugin() {}
46 void SetTab(Int_t tab) { fTab = tab; }
47 void SetSubTab(Int_t sub) { fSubTab = sub; }
48 void SetCommand(
const char *cmd) { fCommand = cmd; }
50 ClassDef(TBrowserPlugin, 0)
53 class TRootBrowser :
public TGMainFrame,
public TBrowserImp {
55 TRootBrowser(
const TRootBrowser&);
56 TRootBrowser& operator=(
const TRootBrowser&);
60 TGLayoutHints *fLH0, *fLH1, *fLH2, *fLH3;
61 TGLayoutHints *fLH4, *fLH5, *fLH6, *fLH7;
69 TGHorizontalFrame *fHf;
70 TGHorizontalFrame *fH1;
71 TGHorizontalFrame *fH2;
74 TGVSplitter *fVSplitter;
75 TGHSplitter *fHSplitter;
76 TGCompositeFrame *fEditFrame;
77 TGHorizontalFrame *fTopMenuFrame;
78 TGHorizontalFrame *fPreMenuFrame;
79 TGHorizontalFrame *fMenuFrame;
80 TGHorizontalFrame *fToolbarFrame;
82 TGPopupMenu *fMenuFile;
83 TGPopupMenu *fMenuExecPlugin;
84 TGPopupMenu *fMenuHelp;
85 TGCompositeFrame *fActMenuBar;
86 TBrowserImp *fActBrowser;
89 TGStatusBar *fStatusBar;
95 const TGPicture *fIconPic;
98 enum ENewBrowserMessages {
120 enum EInsertPosition {
121 kLeft, kRight, kBottom
124 TRootBrowser(TBrowser *b = 0,
const char *name =
"ROOT Browser", UInt_t width = 800, UInt_t height = 500, Option_t *opt=
"", Bool_t initshow=kTRUE);
125 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);
126 virtual ~TRootBrowser();
128 void InitPlugins(Option_t *opt=
"");
130 void CreateBrowser(
const char *name);
132 virtual void CloseWindow();
133 virtual void CloseTab(Int_t
id);
134 virtual void CloseTabs();
135 void DoTab(Int_t
id);
136 void EventInfo(Int_t event, Int_t px, Int_t py, TObject *selected);
137 TGFrame *GetActFrame()
const {
return (TGFrame *)fEditFrame; }
138 TGFrame *GetToolbarFrame()
const {
return (TGFrame *)fToolbarFrame; }
139 TGStatusBar *GetStatusBar()
const {
return fStatusBar; }
140 TGTab *GetTabLeft()
const {
return fTabLeft; }
141 TGTab *GetTabRight()
const {
return fTabRight; }
142 TGTab *GetTabBottom()
const {
return fTabBottom; }
143 TGTab *GetTab(Int_t pos)
const;
144 void SetTab(Int_t pos = kRight, Int_t subpos = -1);
145 void SetTabTitle(
const char *title, Int_t pos = kRight, Int_t subpos = -1);
146 void HandleMenu(Int_t
id);
147 void RecursiveReparent(TGPopupMenu *popup);
148 void RemoveTab(Int_t pos, Int_t subpos);
149 void SetActBrowser(TBrowserImp *b) { fActBrowser = b; }
150 void ShowMenu(TGCompositeFrame *menu);
151 virtual void StartEmbedding(Int_t pos = kRight, Int_t subpos = -1);
152 virtual void StopEmbedding(
const char *name = 0) { StopEmbedding(name, 0); }
153 void StopEmbedding(
const char *name, TGLayoutHints *layout);
154 void SwitchMenus(TGCompositeFrame *from);
156 virtual void BrowseObj(TObject *obj);
157 virtual void ExecuteDefaultAction(TObject *obj);
158 virtual void DoubleClicked(TObject *obj);
159 virtual void Checked(TObject *obj, Bool_t check);
161 virtual void Add(TObject *obj,
const char *name = 0, Int_t check = -1);
162 virtual void RecursiveRemove(TObject *obj);
163 virtual void Refresh(Bool_t force = kFALSE);
164 virtual void Show() { MapRaised(); }
165 Option_t *GetDrawOption()
const;
166 TGMainFrame *GetMainFrame()
const {
return (TGMainFrame *)
this; }
168 virtual Long_t ExecPlugin(
const char *name = 0,
const char *fname = 0,
169 const char *cmd = 0, Int_t pos = kRight,
171 virtual void SetStatusText(
const char *txt, Int_t col);
172 virtual Bool_t HandleKey(Event_t *event);
174 virtual void ShowCloseTab(Bool_t show) { fShowCloseTab = show; }
175 virtual Bool_t IsCloseTabShown()
const {
return fShowCloseTab; }
179 virtual void ReallyDelete();
181 static TBrowserImp *NewBrowser(TBrowser *b = 0,
const char *title =
"ROOT Browser", UInt_t width = 800, UInt_t height = 500, Option_t *opt=
"");
182 static TBrowserImp *NewBrowser(TBrowser *b,
const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height, Option_t *opt=
"");
184 ClassDef(TRootBrowser, 0)