File indexing completed on 2025-01-18 10:11:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef ROOT_TBrowser
0014 #define ROOT_TBrowser
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #include "TNamed.h"
0030 #include "TBrowserImp.h"
0031
0032
0033 class TContextMenu;
0034 class TBrowserTimer;
0035
0036
0037 class TBrowser : public TNamed {
0038
0039 private:
0040 TObject *fLastSelectedObject{nullptr};
0041
0042 TBrowser(const TBrowser&) = delete;
0043 TBrowser& operator=(const TBrowser&) = delete;
0044
0045 protected:
0046 TBrowserImp *fImp{nullptr};
0047 TBrowserTimer *fTimer{nullptr};
0048 TContextMenu *fContextMenu{nullptr};
0049 Bool_t fNeedRefresh{kFALSE};
0050
0051 Bool_t InitGraphics();
0052
0053 public:
0054 enum EStatusBits {
0055 kNoHidden = BIT(9)
0056 };
0057
0058 TBrowser(const char *name="Browser", const char *title = "ROOT Object Browser", TBrowserImp *extimp = nullptr, Option_t *opt = "");
0059 TBrowser(const char *name, const char *title, UInt_t width, UInt_t height, TBrowserImp *extimp = nullptr, Option_t *opt = "");
0060 TBrowser(const char *name, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height, TBrowserImp *extimp = nullptr, Option_t *opt = "");
0061
0062 TBrowser(const char *name, TObject *obj, const char *title="ROOT Object Browser", Option_t *opt="");
0063 TBrowser(const char *name, TObject *obj, const char *title, UInt_t width, UInt_t height, Option_t *opt="");
0064 TBrowser(const char *name, TObject *obj, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height, Option_t *opt="");
0065
0066 TBrowser(const char *name, void *obj, TClass *cl, const char *objname="", const char *title="ROOT Foreign Browser", Option_t *opt="");
0067 TBrowser(const char *name, void *obj, TClass *cl, const char *objname, const char *title, UInt_t width, UInt_t height, Option_t *opt="");
0068 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="");
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081 virtual ~TBrowser();
0082
0083 void Add(TObject *obj, const char *name = nullptr, Int_t check = -1);
0084 void Add(void *obj, TClass *cl, const char *name = nullptr, Int_t check = -1);
0085
0086 void AddCheckBox(TObject *obj, Bool_t check = kFALSE);
0087 void CheckObjectItem(TObject *obj, Bool_t check = kFALSE);
0088 void RemoveCheckBox(TObject *obj);
0089
0090 virtual void Create(TObject *obj = nullptr);
0091 virtual void Destructor();
0092 void BrowseObject(TObject *obj) { if (fImp) fImp->BrowseObj(obj); }
0093 void ExecuteDefaultAction(TObject *obj);
0094 TBrowserImp *GetBrowserImp() const { return fImp; }
0095 void SetBrowserImp(TBrowserImp *i) { fImp = i; }
0096 TContextMenu *GetContextMenu() const { return fContextMenu; }
0097 Bool_t GetRefreshFlag() const { return fNeedRefresh; }
0098 TObject *GetSelected() const { return fLastSelectedObject; }
0099 void SetRefreshFlag(Bool_t flag) { fNeedRefresh = flag; }
0100 void Iconify() { if (fImp) fImp->Iconify(); }
0101 void RecursiveRemove(TObject *obj) override;
0102 void Refresh();
0103 void SetSelected(TObject *clickedObject);
0104 void Show() { if (fImp) fImp->Show(); }
0105 void SetDrawOption(Option_t *option="") override { if (fImp) fImp->SetDrawOption(option); }
0106 Option_t *GetDrawOption() const override { return (fImp) ? fImp->GetDrawOption() : nullptr; }
0107
0108 Longptr_t ExecPlugin(const char *name = nullptr, const char *fname = nullptr,
0109 const char *cmd = nullptr, Int_t pos = 1, Int_t subpos = -1) {
0110 return (fImp) ? fImp->ExecPlugin(name, fname, cmd, pos, subpos) : -1;
0111 }
0112 void SetStatusText(const char *txt, Int_t col) {
0113 if (fImp) fImp->SetStatusText(txt, col);
0114 }
0115 void StartEmbedding(Int_t pos, Int_t subpos) {
0116 if (fImp) fImp->StartEmbedding(pos, subpos);
0117 }
0118 void StopEmbedding(const char *name = "") { if (fImp) fImp->StopEmbedding(name); }
0119
0120 ClassDefOverride(TBrowser,0)
0121 };
0122
0123 #endif