00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef ROOT_TBrowser
00014 #define ROOT_TBrowser
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef ROOT_TNamed
00030 #include "TNamed.h"
00031 #endif
00032 #ifndef ROOT_TBrowserImp
00033 #include "TBrowserImp.h"
00034 #endif
00035
00036
00037 class TContextMenu;
00038 class TBrowserTimer;
00039
00040
00041 class TBrowser : public TNamed {
00042
00043 private:
00044 TObject *fLastSelectedObject;
00045
00046 TBrowser(const TBrowser&);
00047 TBrowser& operator=(const TBrowser&);
00048
00049 protected:
00050 TBrowserImp *fImp;
00051 TBrowserTimer *fTimer;
00052 TContextMenu *fContextMenu;
00053 Bool_t fNeedRefresh;
00054
00055 public:
00056 enum {
00057 kNoHidden = BIT(9)
00058 };
00059
00060 TBrowser(const char *name="Browser", const char *title="ROOT Object Browser", TBrowserImp *extimp=0, Option_t *opt="");
00061 TBrowser(const char *name, const char *title, UInt_t width, UInt_t height, TBrowserImp *extimp=0, Option_t *opt="");
00062 TBrowser(const char *name, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height, TBrowserImp *extimp=0, Option_t *opt="");
00063
00064 TBrowser(const char *name, TObject *obj, const char *title="ROOT Object Browser", Option_t *opt="");
00065 TBrowser(const char *name, TObject *obj, const char *title, UInt_t width, UInt_t height, Option_t *opt="");
00066 TBrowser(const char *name, TObject *obj, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height, Option_t *opt="");
00067
00068 TBrowser(const char *name, void *obj, TClass *cl, const char *objname="", const char *title="ROOT Foreign Browser", Option_t *opt="");
00069 TBrowser(const char *name, void *obj, TClass *cl, const char *objname, const char *title, UInt_t width, UInt_t height, Option_t *opt="");
00070 TBrowser(const char *name, void *obj, TClass *cl, const char *objname, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height, Option_t *opt="");
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 virtual ~TBrowser();
00084
00085 void Add(TObject *obj, const char *name = 0, Int_t check = -1);
00086 void Add(void *obj, TClass *cl, const char *name = 0, Int_t check = -1);
00087
00088 void AddCheckBox(TObject *obj, Bool_t check = kFALSE);
00089 void CheckObjectItem(TObject *obj, Bool_t check = kFALSE);
00090 void RemoveCheckBox(TObject *obj);
00091
00092 virtual void Create(TObject *obj = 0);
00093 void BrowseObject(TObject *obj) { fImp->BrowseObj(obj); }
00094 void ExecuteDefaultAction(TObject *obj);
00095 TBrowserImp *GetBrowserImp() const { return fImp; }
00096 void SetBrowserImp(TBrowserImp *i) { fImp = i; }
00097 TContextMenu *GetContextMenu() const { return fContextMenu; }
00098 Bool_t GetRefreshFlag() const { return fNeedRefresh; }
00099 TObject *GetSelected() const { return fLastSelectedObject; }
00100 void SetRefreshFlag(Bool_t flag) { fNeedRefresh = flag; }
00101 void Iconify() { fImp->Iconify(); }
00102 virtual void RecursiveRemove(TObject *obj);
00103 void Refresh();
00104 void SetSelected(TObject *clickedObject);
00105 void Show() { fImp->Show(); }
00106 void SetDrawOption(Option_t *option="") { fImp->SetDrawOption(option); }
00107 Option_t *GetDrawOption() const { return fImp->GetDrawOption(); }
00108
00109 Long_t ExecPlugin(const char *name = 0, const char *fname = 0,
00110 const char *cmd = 0, Int_t pos = 1, Int_t subpos = -1) {
00111 return fImp->ExecPlugin(name, fname, cmd, pos, subpos);
00112 }
00113 void SetStatusText(const char *txt, Int_t col) {
00114 fImp->SetStatusText(txt, col);
00115 }
00116 void StartEmbedding(Int_t pos, Int_t subpos) {
00117 fImp->StartEmbedding(pos, subpos);
00118 }
00119 void StopEmbedding(const char *name = "") { fImp->StopEmbedding(name); }
00120
00121 ClassDef(TBrowser,0)
00122 };
00123
00124 #endif