]>
Commit | Line | Data |
---|---|---|
32e219c2 | 1 | #ifndef ROOT_TGFileBrowser |
2 | #define ROOT_TGFileBrowser | |
3 | ||
4 | #ifndef ROOT_TGFrame | |
5 | #include "TGFrame.h" | |
6 | #endif | |
7 | ||
8 | #ifndef ROOT_TBrowserImp | |
9 | #include "TBrowserImp.h" | |
10 | #endif | |
11 | ||
12 | class TGCanvas; | |
13 | class TGListTree; | |
14 | class TGListTreeItem; | |
15 | class TGPicture; | |
16 | class TGLabel; | |
17 | class TGComboBox; | |
18 | class TGTextEntry; | |
19 | class TGTextBuffer; | |
20 | class TGTextView; | |
21 | class TContextMenu; | |
22 | class TRegexp; | |
23 | class TGMenuBar; | |
24 | class TGPopupMenu; | |
25 | class TGStatusBar; | |
26 | class TGPictureButton; | |
27 | class TString; | |
28 | class TGNewBrowser; | |
29 | ||
30 | class TGFileBrowser : public TGMainFrame, public TBrowserImp { | |
31 | ||
32 | protected: | |
33 | // TGNewBrowser *fNewBrowser; | |
34 | TGHorizontalFrame *fTopFrame; | |
35 | TGHorizontalFrame *fBotFrame; | |
36 | TGCanvas *fCanvas; | |
37 | TGListTree *fListTree; | |
38 | TGListTreeItem *fListLevel; // current TGListTree level | |
39 | TGListTreeItem *fCurrentDir; // | |
40 | TGListTreeItem *fRootDir; // | |
41 | TGComboBox *fDrawOption; // draw options combobox | |
42 | TGComboBox *fFileType; // file type combobox | |
43 | TContextMenu *fContextMenu; // context menu pointer | |
44 | const TGPicture *fRootIcon; | |
45 | const TGPicture *fFileIcon; | |
46 | const TGPicture *fCachedPic; // | |
47 | TString fCachedPicName; // | |
48 | TRegexp *fFilter; | |
49 | Int_t fGroupSize; // total number of items when icon box switched to "global view" mode | |
50 | Long_t fNKeys, fCnt; | |
51 | Bool_t fGrouped; // | |
52 | Bool_t fShowHidden; | |
53 | ||
54 | TGNewBrowser *fNewBrowser; | |
55 | ||
56 | void CreateBrowser(const char *name); | |
57 | ||
58 | public: | |
59 | TGFileBrowser(TBrowser* b=0, const char *name="ROOT Browser", UInt_t w=200, UInt_t h=400); | |
60 | TGFileBrowser(TBrowser* b, const char *name, Int_t x, Int_t y, UInt_t w, UInt_t h); | |
61 | virtual ~TGFileBrowser(); | |
62 | ||
63 | virtual void Add(TObject *obj, const char *name = 0, Int_t check = -1); | |
64 | virtual void BrowseObj(TObject *obj); | |
65 | virtual void RecursiveRemove(TObject *obj); | |
66 | virtual void Refresh(Bool_t force = kFALSE); | |
67 | virtual void Show() { MapRaised(); } | |
68 | Option_t *GetDrawOption() const; | |
69 | ||
70 | TGNewBrowser *GetNewBrowser() const { return fNewBrowser; } | |
71 | void SetNewBrowser(TGNewBrowser* b) { fNewBrowser = b; } | |
72 | ||
73 | void AddFSDirectory(const char* entry, const char* path=0); | |
74 | void AddKey(TGListTreeItem *itm, TObject *obj, const char *name = 0); | |
75 | void ApplyFilter(Int_t id); | |
76 | void Chdir(TGListTreeItem *item); | |
77 | void Clicked(TGListTreeItem *item, Int_t btn, Int_t x, Int_t y); | |
78 | TString DirName(TGListTreeItem* item); | |
79 | void DoubleClicked(TGListTreeItem *item, Int_t btn); | |
80 | Long_t XXExecuteDefaultAction(TObject *obj); | |
81 | char *FormatFileInfo(const char *fname, Long64_t size, Long_t modtime); | |
82 | void GetObjPicture(const TGPicture **pic, TObject *obj); | |
83 | void GotoDir(const char *path); | |
84 | ||
85 | // overridden from TGMainFrame | |
86 | void ReallyDelete(); | |
87 | ||
88 | ClassDef(TGFileBrowser, 0) // File browser. | |
89 | }; | |
90 | ||
91 | #endif |