Logo ROOT  
Reference Guide
TGFileBrowser.cxx
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Bertrand Bellenot 26/09/2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #include "TROOT.h"
13 #include "TSystem.h"
14 #include "TApplication.h"
15 #include "TGClient.h"
16 #include "TGListTree.h"
17 #include "TGLayout.h"
18 #include "TGComboBox.h"
19 #include "TContextMenu.h"
20 #include "TGTextEntry.h"
21 #include "TGTab.h"
22 #include "TGLabel.h"
23 #include "TSystemDirectory.h"
24 #include "TGMimeTypes.h"
25 #include "TClass.h"
26 #include "TQClass.h"
27 #include "TObjString.h"
28 #include "TObjArray.h"
29 #include "TInterpreter.h"
30 #include "TRegexp.h"
31 #include "TEnv.h"
32 #include "TImage.h"
33 #include "TBrowser.h"
34 #include "TRemoteObject.h"
35 #include "TKey.h"
36 #include "TKeyMapFile.h"
37 #include "TVirtualPad.h"
38 #include "Getline.h"
39 #include "snprintf.h"
40 #include <ctime>
41 #include <cstring>
42 #include <cstdlib>
43 
44 #include "TGFileBrowser.h"
45 #include "TRootBrowser.h"
46 #include "TGInputDialog.h"
47 
48 #include "TVirtualPadEditor.h"
49 #include "TGedEditor.h"
50 #include "TBaseClass.h"
51 #include "TVirtualX.h"
52 
53 #include "RConfigure.h"
54 
55 #ifdef WIN32
56 const char rootdir[] = "\\";
57 #else
58 const char rootdir[] = "/";
59 #endif
60 
61 const char *filters[] = {
62  "",
63  "*.*",
64  "*.[C|c|h]*",
65  "*.root",
66  "*.txt"
67 };
68 
69 //_____________________________________________________________________________
70 //
71 // TCursorSwitcher
72 //
73 // Helper class used to change the cursor in a method and restore the
74 // original one when going out of the method scope.
75 //_____________________________________________________________________________
76 
77 ///////////////////////////////////////////////////////////////////////////////
78 class TCursorSwitcher {
79 private:
80  TGWindow *fW1;
81  TGWindow *fW2;
82 public:
83  TCursorSwitcher(TGWindow *w1, TGWindow *w2) : fW1(w1), fW2(w2) {
84  if (w1) gVirtualX->SetCursor(w1->GetId(), gVirtualX->CreateCursor(kWatch));
85  if (w2) gVirtualX->SetCursor(w2->GetId(), gVirtualX->CreateCursor(kWatch));
86  }
87  ~TCursorSwitcher() {
88  if (fW1) gVirtualX->SetCursor(fW1->GetId(), gVirtualX->CreateCursor(kPointer));
89  if (fW2) gVirtualX->SetCursor(fW2->GetId(), gVirtualX->CreateCursor(kPointer));
90  }
91 };
92 
93 //_____________________________________________________________________________
94 //
95 // TGFileBrowser
96 //
97 // System file browser, used as TRootBrowser plug-in.
98 // This class is the real core of the ROOT browser.
99 //_____________________________________________________________________________
100 
102 
103 ////////////////////////////////////////////////////////////////////////////////
104 /// TGFileBrowser constructor.
105 
107  : TGMainFrame(p, w, h), TBrowserImp(b), fNewBrowser(0)
108 {
109  if (p && p != gClient->GetDefaultRoot())
111  if (fNewBrowser)
112  fNewBrowser->SetActBrowser(this);
113  CreateBrowser();
114  Resize(w, h);
115  if (fBrowser) Show();
116 }
117 
118 ////////////////////////////////////////////////////////////////////////////////
119 /// Create the actual file browser.
120 
122 {
123  fCachedPic = 0;
125 
126  fTopFrame = new TGHorizontalFrame(this, 100, 30);
127  fDrawOption = new TGComboBox(fTopFrame, "");
128  TGTextEntry *dropt_entry = fDrawOption->GetTextEntry();
129  dropt_entry->SetToolTipText("Object Draw Option", 300);
130  fDrawOption->Resize(80, 20);
132  lb->Resize(lb->GetWidth(), 120);
133  Int_t dropt = 1;
134  fDrawOption->AddEntry("", dropt++);
135  fDrawOption->AddEntry("box", dropt++);
136  fDrawOption->AddEntry("colz", dropt++);
137  fDrawOption->AddEntry("lego", dropt++);
138  fDrawOption->AddEntry("lego1", dropt++);
139  fDrawOption->AddEntry("lego2", dropt++);
140  fDrawOption->AddEntry("same", dropt++);
141  fDrawOption->AddEntry("surf", dropt++);
142  fDrawOption->AddEntry("surf1", dropt++);
143  fDrawOption->AddEntry("surf2", dropt++);
144  fDrawOption->AddEntry("surf3", dropt++);
145  fDrawOption->AddEntry("surf4", dropt++);
146  fDrawOption->AddEntry("surf5", dropt++);
147  fDrawOption->AddEntry("text", dropt++);
149  kLHintsRight, 2, 2, 2, 2));
150  fTopFrame->AddFrame(new TGLabel(fTopFrame, "Draw Option:"),
152  5, 2, 2, 2));
153 
154  fSortButton = new TGPictureButton(fTopFrame, "bld_sortup.png");
155  fSortButton->SetStyle(gClient->GetStyle());
156  fSortButton->SetToolTipText("Sort Alphabetically\n(Current folder only)");
158  kLHintsLeft, 2, 2, 2, 2));
159  fSortButton->Connect("Clicked()", "TGFileBrowser", this, "ToggleSort()");
160 
161  fFilterButton = new TGPictureButton(fTopFrame, "filter.png");
162  fFilterButton->SetStyle(gClient->GetStyle());
163  fFilterButton->SetToolTipText("Filter Content");
165  kLHintsLeft, 2, 2, 2, 2));
166  fFilterButton->Connect("Clicked()", "TGFileBrowser", this, "RequestFilter()");
167 
168  fRefreshButton = new TGPictureButton(fTopFrame, "refresh.png");
169  fRefreshButton->SetStyle(gClient->GetStyle());
170  fRefreshButton->SetToolTipText("Refresh Current Folder");
172  kLHintsLeft, 2, 5, 2, 2));
173  fRefreshButton->Connect("Clicked()", "TGFileBrowser", this, "Refresh()");
174 
176  kLHintsExpandX, 2, 2, 2, 2));
177  fCanvas = new TGCanvas(this, 100, 100);
181  fListTree->Connect("DoubleClicked(TGListTreeItem *, Int_t)",
182  "TGFileBrowser", this, "DoubleClicked(TGListTreeItem *, Int_t)");
183  fListTree->Connect("Clicked(TGListTreeItem *, Int_t, Int_t, Int_t)",
184  "TGFileBrowser", this, "Clicked(TGListTreeItem *, Int_t, Int_t, Int_t)");
185  fListTree->Connect("Checked(TObject*, Bool_t)", "TGFileBrowser",
186  this, "Checked(TObject*, Bool_t)");
187 
188  fRootIcon = gClient->GetPicture("rootdb_t.xpm");
189  fFileIcon = gClient->GetPicture("doc_t.xpm");
190 
191  fBotFrame = new TGHorizontalFrame(this, 100, 30);
192  fBotFrame->AddFrame(new TGLabel(fBotFrame, "Filter: "),
194  2, 2, 2, 2));
195  fFileType = new TGComboBox(fBotFrame, " All Files (*.*)");
196  Int_t ftype = 1;
197  fFileType->AddEntry(" All Files (*.*)", ftype++);
198  fFileType->AddEntry(" C/C++ Files (*.c;*.cxx;*.h;...)", ftype++);
199  fFileType->AddEntry(" ROOT Files (*.root)", ftype++);
200  fFileType->AddEntry(" Text Files (*.txt)", ftype++);
201  fFileType->Resize(200, 20);
203  kLHintsExpandX, 2, 2, 2, 2));
204  fFileType->Connect("Selected(Int_t)", "TGFileBrowser", this,
205  "ApplyFilter(Int_t)");
206  fFileType->GetTextEntry()->Connect("ReturnPressed()", "TGFileBrowser",
207  this, "ApplyFilter(Int_t = -1)");
209  kLHintsExpandX, 2, 2, 2, 2));
210 
211  fContextMenu = new TContextMenu("FileBrowserContextMenu");
212  fFilter = 0;
213  fGroupSize = 1000;
214  fListLevel = 0;
215  fCurrentDir = 0;
216  fRootDir = 0;
217  fDir = 0;
218  fFile = 0;
219  fNKeys = 0;
220  fCnt = 0;
221  fFilterStr = "*";
222 
223  TString gv = gEnv->GetValue("Browser.GroupView", "1000");
224  Int_t igv = atoi(gv.Data());
225  if (igv > 10)
226  fGroupSize = igv;
227 
228  if (gEnv->GetValue("Browser.ShowHidden", 0))
229  fShowHidden = kTRUE;
230  else
232 
233  fDblClick = kFALSE;
234 
235  if (TClass::GetClass("TGHtmlBrowser"))
236  TQObject::Connect("TGHtmlBrowser", "Clicked(char*)",
237  "TGFileBrowser", this, "Selected(char*)");
238 
239  TQObject::Connect("TPad", "Modified()",
240  "TGFileBrowser", this, "PadModified()");
241 
242  fListLevel = 0;
243  MapSubwindows();
245  MapWindow();
246 }
247 
248 ////////////////////////////////////////////////////////////////////////////////
249 /// Destructor.
250 
252 {
253  if (TClass::GetClass("TGHtmlBrowser"))
254  TQObject::Disconnect("TGHtmlBrowser", "Clicked(char*)");
255  TQObject::Disconnect("TPad", "Modified()");
256 
257  delete fContextMenu;
258  delete fListTree;
260  if (fCachedPic && (fCachedPic != fFileIcon))
263  Cleanup();
264 }
265 
266 ////////////////////////////////////////////////////////////////////////////////
267 /// Helper function checking if a class has a graphic properties editor.
268 
270 {
271  TBaseClass *base;
272  TList* bcl = cl->GetListOfBases();
273  TIter next(bcl);
274  while ((base = (TBaseClass*) next())) {
275  cl = base->GetClassPointer();
276  if (cl && TClass::GetClass(Form("%sEditor", cl->GetName())))
277  return kTRUE;
278  if (IsObjectEditable(cl))
279  return kTRUE;
280  }
281  return kFALSE;
282 }
283 
284 ////////////////////////////////////////////////////////////////////////////////
285 /// Format the tooltip information, based on the object passed in argument.
286 
287 static const char *FormatToolTip(TObject *obj, Int_t maxlen=0)
288 {
289  static TString infos;
290  if (!obj) {
291  infos.Clear();
292  return 0;
293  }
294  infos = obj->GetName();
295  if (obj->GetTitle()) {
296  infos += "\n";
297  infos += obj->GetTitle();
298  }
299  if (maxlen > 0 && infos.Length() > maxlen) {
300  infos.Remove(maxlen - 3);
301  infos += "...";
302  }
303  TString objinfo = obj->GetObjectInfo(1, 1);
304  if (!objinfo.IsNull() && !objinfo.BeginsWith("x=")) {
305  Long64_t bsize, fsize, objsize;
306  objsize = objinfo.Atoll();
307  if (objsize > 0) {
308  infos += "\n";
309  bsize = fsize = objsize;
310  if (fsize > 1024) {
311  fsize /= 1024;
312  if (fsize > 1024) {
313  // 3.7MB is more informative than just 3MB
314  infos += TString::Format("Size: %lld.%lldM", fsize/1024,
315  (fsize%1024)/103);
316  } else {
317  infos += TString::Format("Size: %lld.%lldK", bsize/1024,
318  (bsize%1024)/103);
319  }
320  } else {
321  infos += TString::Format("Size: %lld bytes", bsize);
322  }
323  }
324  }
325  return infos.Data();
326 }
327 
328 /**************************************************************************/
329 // TBrowserImp virtuals
330 /**************************************************************************/
331 
332 ////////////////////////////////////////////////////////////////////////////////
333 /// Add items to the browser. This function has to be called
334 /// by the Browse() member function of objects when they are
335 /// called by a browser. If check < 0 (default) no check box is drawn,
336 /// if 0 then unchecked checkbox is added, if 1 checked checkbox is added.
337 
338 void TGFileBrowser::Add(TObject *obj, const char *name, Int_t check)
339 {
340  if (fListLevel && !strcmp(fListLevel->GetText(), "Classes") &&
341  fListLevel->GetParent() &&
342  !strcmp(fListLevel->GetParent()->GetText(), "root")) {
343  // Browsing list of root classes...
344  }
345  else {
346  if (obj && obj->InheritsFrom("TApplication"))
347  fListLevel = 0;
348  if (obj && obj->InheritsFrom("TSystemDirectory"))
349  return;
350  }
351  if (fListLevel) {
352  TString oname = "";
353  if (name)
354  oname = name;
355  else if (obj)
356  oname = obj->GetName();
357  // check if the current item is filtered
358  auto it = fFilteredItems.find(fListLevel);
359  if (it != fFilteredItems.end()) {
360  // check if the item (object) name match the filter
361  const char *filter = it->second.c_str();
362  TRegexp re(filter, kTRUE);
363  // if not, simply return, so no item will be added
364  if (oname.Index(re) == kNPOS) return;
365  }
366  }
367  const TGPicture *pic = nullptr;
368  if (obj && obj->InheritsFrom("TKey") && (obj->IsA() != TClass::Class()))
369  AddKey(fListLevel, obj, name);
370  else if (obj) {
371  GetObjPicture(&pic, obj);
372  if (!name) name = obj->GetName();
373  if (check > -1) {
376  pic, pic, kTRUE);
377  if ((pic != fFileIcon) && (pic != fCachedPic))
378  fClient->FreePicture(pic);
379  if (item) fListTree->CheckItem(item, (Bool_t)check);
380  fListTree->SetToolTipItem(item, FormatToolTip(obj, 32));
381  }
382  }
383  else {
384  // special case for remote object
385  Bool_t isRemote = kFALSE;
386  if (obj->InheritsFrom("TRemoteObject"))
387  isRemote = kTRUE;
388  else if (fListLevel) {
389  // check also if one of its parents is a remote object
390  TGListTreeItem *top = fListLevel;
391  while (top->GetParent()) {
392  TObject *tobj = (TObject *) top->GetUserData();
393  if (tobj && (tobj->InheritsFrom("TRemoteObject") ||
394  tobj->InheritsFrom("TApplicationRemote"))) {
395  isRemote = kTRUE;
396  break;
397  }
398  top = top->GetParent();
399  }
400  }
401  if (isRemote) {
402  TRemoteObject *robj = (TRemoteObject *)obj;
403  if (!strcmp(robj->GetClassName(), "TKey")) {
404  AddKey(fListLevel, obj, name);
405  }
406  else {
407  TString fname = name;
408  // add the remote object only if not already in the list
409  if (!fShowHidden && fname.BeginsWith("."))
410  return;
411  AddRemoteFile(obj);
412  }
413  }
414  else {
416  TGListTreeItem *item = fListTree->AddItem(fListLevel, name, obj, pic, pic);
417  if ((pic != fFileIcon) && (pic != fCachedPic))
418  fClient->FreePicture(pic);
419  if (item && obj && obj->InheritsFrom("TObject"))
420  item->SetDNDSource(kTRUE);
421  fListTree->SetToolTipItem(item, FormatToolTip(obj, 32));
422  }
423  }
424  }
425  }
426 }
427 
428 ////////////////////////////////////////////////////////////////////////////////
429 /// Add remote file in list tree.
430 
432 {
433  Bool_t is_link;
434  Int_t type;
435  TString filename;
436  const TGPicture *spic;
437  TGPicture *pic;
438 
439  FileStat_t sbuf;
440 
441  type = 0;
442  is_link = kFALSE;
443 
444  TRemoteObject *robj = (TRemoteObject *)obj;
445 
446  robj->GetFileStat(&sbuf);
447  is_link = sbuf.fIsLink;
448  type = sbuf.fMode;
449  filename = robj->GetName();
450  if (R_ISDIR(type) || fFilter == 0 ||
451  (fFilter && filename.Index(*fFilter) != kNPOS)) {
452 
453  GetFilePictures(&spic, type, is_link, filename);
454 
455  pic = (TGPicture*)spic; pic->AddReference();
456 
457  if ((!fListTree->FindChildByName(fListLevel, filename)) &&
459  fListTree->AddItem(fListLevel, filename, obj, pic, pic);
460  }
461 }
462 
463 ////////////////////////////////////////////////////////////////////////////////
464 /// Browse object. This, in turn, will trigger the calling of
465 /// TBrowser::Add() which will fill the IconBox and the tree.
466 /// Emits signal "BrowseObj(TObject*)".
467 
469 {
470  if (fNewBrowser)
471  fNewBrowser->SetActBrowser(this);
472  if (obj != gROOT) {
474  fListLevel = 0;
475  Add(obj);
478  if (obj->IsFolder())
482  }
483  }
484  if (fBrowser) obj->Browse(fBrowser);
485  if (obj == gROOT) {
486  TList *volumes = gSystem->GetVolumes("all");
487  TList *curvol = gSystem->GetVolumes("cur");
488  if (volumes && curvol) {
489  const char *curdrive;
490  TNamed *named = (TNamed *)curvol->At(0);
491  if (named)
492  curdrive = named->GetName();
493  else
494  curdrive = "C:";
495  TIter next(volumes);
496  TNamed *drive;
497  while ((drive = (TNamed *)next())) {
498  AddFSDirectory(TString::Format("%s\\", drive->GetName()), drive->GetTitle(),
499  (strcmp(drive->GetName(), curdrive) == 0) ?
500  "SetRootDir" : "Add");
501  }
502  delete volumes;
503  delete curvol;
504  }
505  else {
506  AddFSDirectory("/");
507  }
509  if (gROOT->GetListOfFiles() && !gROOT->GetListOfFiles()->IsEmpty())
510  Selected(0);
511  }
512 }
513 
514 ////////////////////////////////////////////////////////////////////////////////
515 /// Emits signal when double clicking on icon.
516 
518 {
519  if (fNewBrowser)
520  fNewBrowser->Checked(obj, checked);
521 }
522 
523 ////////////////////////////////////////////////////////////////////////////////
524 /// returns drawing option
525 
527 {
528  return fDrawOption->GetTextEntry()->GetText();
529 }
530 
531 ////////////////////////////////////////////////////////////////////////////////
532 /// Determine the file picture for the given file type.
533 
534 void TGFileBrowser::GetFilePictures(const TGPicture **pic, Int_t file_type,
535  Bool_t is_link, const char *name)
536 {
537  static TString cached_ext;
538  static const TGPicture *cached_spic = 0;
539  const char *ext = name ? strrchr(name, '.') : 0;
540  TString sname = name ? name : " ";
541  *pic = 0;
542 
543  if (ext && cached_spic && (cached_ext == ext)) {
544  *pic = cached_spic;
545  return;
546  }
547 
548  if (R_ISREG(file_type)) {
549  *pic = gClient->GetMimeTypeList()->GetIcon(name, kTRUE);
550 
551  if (*pic) {
552  if (ext) {
553  cached_ext = ext;
554  cached_spic = *pic;
555  return;
556  }
557  }
558  } else {
559  *pic = 0;
560  }
561 
562  if (*pic == 0) {
563  *pic = gClient->GetPicture("doc_t.xpm");
564 
565  if (R_ISREG(file_type) && (file_type) & kS_IXUSR) {
566  *pic = gClient->GetPicture("app_t.xpm");
567  }
568  if (R_ISDIR(file_type)) {
569  *pic = gClient->GetPicture("folder_t.xpm");
570  }
571  if(sname.EndsWith(".root")) {
572  *pic = gClient->GetPicture("rootdb_t.xpm");
573  }
574 
575  }
576  if (is_link) {
577  *pic = gClient->GetPicture("slink_t.xpm");
578  }
579 
580  cached_spic = 0;
581  cached_ext = "";
582 }
583 
584 ////////////////////////////////////////////////////////////////////////////////
585 /// Recursively remove object.
586 
588 {
589  TGListTreeItem *itm = nullptr, *item = nullptr;
590  if (obj->InheritsFrom("TFile")) {
591  itm = fListTree->FindChildByData(0, gROOT->GetListOfFiles());
592  if (itm)
593  item = fListTree->FindChildByData(itm, obj);
594  if (item) {
595  // if the item to be deleted has a filter,
596  // delete its entry in the map
597  if (CheckFiltered(item))
598  fFilteredItems.erase(item);
599  fListTree->DeleteItem(item);
600  }
601  itm = fRootDir ? fRootDir->GetFirstChild() : nullptr;
602  while (itm) {
603  item = fListTree->FindItemByObj(itm, obj);
604  if (item) {
605  fListTree->DeleteChildren(item);
606  item->SetUserData(0);
607  }
608  itm = itm->GetNextSibling();
609  }
610  }
611  if (!obj->InheritsFrom("TFile") && fRootDir) {
612  item = fListTree->FindItemByObj(fRootDir, obj);
613  // if the item to be deleted has a filter, delete its entry in the map
614  if (item && CheckFiltered(item))
615  fFilteredItems.erase(item);
617  }
618  //fListTree->ClearViewPort();
619 }
620 
621 ////////////////////////////////////////////////////////////////////////////////
622 /// Refresh content of the list tree.
623 
625 {
626  TTimer::SingleShot(200, "TGFileBrowser", this, "Update()");
627  return; // disable refresh for the time being...
628  // coverity[unreachable]
629  TCursorSwitcher cursorSwitcher(this, fListTree);
630  static UInt_t prev = 0;
631  UInt_t curr = gROOT->GetListOfBrowsables()->GetSize();
632  if (!prev) prev = curr;
633 
634  if (prev != curr) { // refresh gROOT
635  TGListTreeItem *sav = fListLevel;
636  fListLevel = 0;
637  BrowseObj(gROOT);
638  fListLevel = sav;
639  prev = curr;
640  }
641 }
642 
643 ////////////////////////////////////////////////////////////////////////////////
644 /// Update content of the list tree.
645 
647 {
648  Long64_t size = 0;
649  Long_t id = 0, flags = 0, modtime = 0;
650  char path[1024];
651  TGListTreeItem *item = fCurrentDir;
652  if (!item) item = fRootDir;
653  if (!item) return;
654  //fListTree->DeleteChildren(item);
655  TGListTreeItem *curr = fListTree->GetSelected(); // GetCurrent() ??
656  if (curr) {
657  TObject *obj = (TObject *) curr->GetUserData();
658  if (obj && !obj->TestBit(kNotDeleted)) {
659  // if the item to be deleted has a filter,
660  // delete its entry in the map
661  if (CheckFiltered(curr))
662  fFilteredItems.erase(curr);
663  fListTree->DeleteItem(curr);
664  curr = 0;
665  obj = 0;
666  }
667  else if (obj && obj->TestBit(kNotDeleted) &&
668  obj->InheritsFrom("TObjString") && curr->GetParent()) {
669  fListTree->GetPathnameFromItem(curr->GetParent(), path);
670  if (strlen(path) > 1) {
671  TString dirpath = FullPathName(curr->GetParent());
672  Int_t res = gSystem->GetPathInfo(dirpath.Data(), &id, &size,
673  &flags, &modtime);
674  if ((res == 0) && (flags & 2)) {
675  TString fullpath = FullPathName(curr);
676  if (gSystem->AccessPathName(fullpath.Data())) {
677  // if the item to be deleted has a filter,
678  // delete its entry in the map
679  if (CheckFiltered(curr))
680  fFilteredItems.erase(curr);
681  fListTree->DeleteItem(curr);
682  curr = 0;
683  obj = 0;
684  }
685  }
686  }
687  }
688  }
689  TString actpath = FullPathName(item);
690  flags = id = size = modtime = 0;
691  if (gSystem->GetPathInfo(actpath.Data(), &id, &size, &flags, &modtime) == 0) {
692  Int_t isdir = (Int_t)flags & 2;
693 
694  TString savdir = gSystem->WorkingDirectory();
695  if (isdir) {
696  TGListTreeItem *del = 0, *itm = item->GetFirstChild();
697  while (itm) {
698  fListTree->GetPathnameFromItem(itm, path);
699  if (strlen(path) > 1) {
700  TString recpath = FullPathName(itm);
701  if (gSystem->AccessPathName(recpath.Data())) {
702  del = itm;
703  itm = itm->GetNextSibling();
704  // if the item to be deleted has a filter,
705  // delete its entry in the map
706  if (CheckFiltered(del))
707  fFilteredItems.erase(del);
708  fListTree->DeleteItem(del);
709  }
710  }
711  if (del)
712  del = 0;
713  else
714  itm = itm->GetNextSibling();
715  }
716  }
717  }
718  TGListTreeItem *sav = fListLevel;
719  DoubleClicked(item, 1);
720  fListLevel = sav;
722 }
723 
724 /**************************************************************************/
725 // Other
726 /**************************************************************************/
727 
728 ////////////////////////////////////////////////////////////////////////////////
729 /// Add file system directory in the list tree.
730 
731 void TGFileBrowser::AddFSDirectory(const char *entry, const char *path,
732  Option_t *opt)
733 {
734  TGListTreeItem *item = 0;
735  if ((opt == 0) || (!opt[0])) {
736  if (fRootDir == 0 && !fListTree->FindChildByName(0, rootdir))
737  item = fRootDir = fListTree->AddItem(0, rootdir);
738  return;
739  }
740  if (strstr(opt, "SetRootDir")) {
741  if (!fListTree->FindChildByName(0, entry))
742  item = fRootDir = fListTree->AddItem(0, entry);
743  }
744  else if (strstr(opt, "Add")) {
745  // MT: i give up! wanted to place entries for selected
746  // directories like home, pwd, alice-macros.
747  // TGListTreeItem *lti = fListTree->AddItem(0, entry);
748  //
749  if (!fListTree->FindChildByName(0, entry))
750  item = fListTree->AddItem(0, entry);
751  }
752  if (item && path) {
753  TString infos = path;
754  item->SetTipText(path);
755  TGPicture *pic = 0;
756  if (infos.Contains("Removable"))
757  pic = (TGPicture *)gClient->GetPicture("fdisk_t.xpm");
758  else if (infos.Contains("Local"))
759  pic = (TGPicture *)gClient->GetPicture("hdisk_t.xpm");
760  else if (infos.Contains("CD"))
761  pic = (TGPicture *)gClient->GetPicture("cdrom_t.xpm");
762  else if (infos.Contains("Network"))
763  pic = (TGPicture *)gClient->GetPicture("netdisk_t.xpm");
764  if (pic)
765  item->SetPictures(pic, pic);
766  }
767 }
768 
769 ////////////////////////////////////////////////////////////////////////////////
770 /// display content of ROOT file
771 
772 void TGFileBrowser::AddKey(TGListTreeItem *itm, TObject *obj, const char *name)
773 {
774  // Int_t from, to;
775  TGListTreeItem *where;
776  static TGListTreeItem *olditem = itm;
777  static TGListTreeItem *item = itm;
778  const TGPicture *pic;
779 
780  if (itm == 0) return;
781 
782  if ((fCnt == 0) || (olditem != itm)) {
783  olditem = item = itm;
784  }
785  if (!name) name = obj->GetName();
786  if (fNKeys > fGroupSize) {
787  where = itm->GetFirstChild();
788  while (where) {
789  if (fListTree->FindItemByObj(where, obj))
790  return;
791  where = where->GetNextSibling();
792  }
793  }
794  if ((fNKeys > fGroupSize) && (fCnt % fGroupSize == 0)) {
795  if (item != itm) {
796  TString newname = TString::Format("%s-%s", item->GetText(), name);
797  item->Rename(newname.Data());
798  }
799  item = fListTree->AddItem(itm, name);
800  item->SetDNDSource(kTRUE);
801  }
802  if ((fCnt > fGroupSize) && (fCnt >= fNKeys-1)) {
803  TString newname = TString::Format("%s-%s", item->GetText(), name);
804  item->Rename(newname.Data());
805  }
806  GetObjPicture(&pic, obj);
807  if (!fListTree->FindChildByName(item, name)) {
808  TGListTreeItem *it = fListTree->AddItem(item, name, obj, pic, pic);
809  if (pic && (pic != fFileIcon) && (pic != fCachedPic))
810  fClient->FreePicture(pic);
811  it->SetDNDSource(kTRUE);
812  it->SetTipText(FormatToolTip(obj, 32));
813  }
814  fCnt++;
815 }
816 
817 ////////////////////////////////////////////////////////////////////////////////
818 /// Apply filter selected in combo box to the file tree view.
819 
821 {
822  // Long64_t size;
823  // Long_t fid, flags, modtime;
824 
825  if (fFilter) delete fFilter;
826  fFilter = 0;
827  if ((id > 1) && (id < 5))
828  fFilter = new TRegexp(filters[id], kTRUE);
829  else if ((id < 0) || (id > 4)) {
831  if (lbe) {
832  const char *text = lbe->GetTitle();
833  fFilter = new TRegexp(text, kTRUE);
834  }
835  }
836  TGListTreeItem *item = fCurrentDir;
837  if (!item)
838  item = fRootDir;
839  if (!item) return;
840  fListTree->DeleteChildren(item);
841  DoubleClicked(item, 1);
842  //fListTree->AdjustPosition(item);
844 }
845 
846 ////////////////////////////////////////////////////////////////////////////////
847 /// Make object associated with item the current directory.
848 
850 {
851  if (item) {
852  TGListTreeItem *i = item;
853  while (i) {
854  TObject *obj = (TObject*) i->GetUserData();
855  if ((obj) && obj->InheritsFrom("TDirectory")) {
856  ((TDirectory *)obj)->cd();
857  break;
858  }
859  i = i->GetParent();
860  }
861  }
862 }
863 
864 ////////////////////////////////////////////////////////////////////////////////
865 /// Check if the current list tree item points to a remote object.
866 
868 {
869  if (!item) return;
870  TObject *obj = (TObject *) item->GetUserData();
871  if (obj) {
872  if (obj->InheritsFrom("TApplicationRemote")) {
873  if (!gApplication->GetAppRemote()) {
874  gROOT->ProcessLine(TString::Format(".R %s", item->GetText()));
875  if (gApplication->GetAppRemote()) {
876  Getlinem(kInit, TString::Format("\n%s:root [0]",
878  }
879  }
880  }
881  if (item->GetParent() && item->GetParent()->GetUserData() &&
882  ((TObject *)item->GetParent()->GetUserData())->InheritsFrom("TApplicationRemote")) {
883  // switch to remote session
884  if (!gApplication->GetAppRemote()) {
885  gROOT->ProcessLine(TString::Format(".R %s", item->GetParent()->GetText()));
886  if (gApplication->GetAppRemote()) {
887  Getlinem(kInit, TString::Format("\n%s:root [0]",
889  }
890  }
891  else if (!strcmp(item->GetText(), "ROOT Files")) {
892  // update list of files opened in the remote session
894  gApplication->ProcessLine("((TApplicationServer *)gApplication)->BrowseFile(0);");
895  }
896  }
897  else {
898  // check if the listtree item is from a local session or
899  // from a remote session, then switch to the session it belongs to
900  TGListTreeItem *top = item;
901  while (top->GetParent()) {
902  top = top->GetParent();
903  }
904  TObject *topobj = (TObject *) top->GetUserData();
905  if (topobj && topobj->InheritsFrom("TApplicationRemote")) {
906  // it belongs to a remote session
907  if (!gApplication->GetAppRemote()) {
908  // switch to remote session if not already in
909  gROOT->ProcessLine(TString::Format(".R %s", top->GetText()));
910  if (gApplication->GetAppRemote()) {
911  Getlinem(kInit, TString::Format("\n%s:root [0]",
913  }
914  }
915  }
916  else if (gApplication->GetAppRemote()) {
917  // switch back to local session if not already in
918  gApplication->ProcessLine(".R");
919  Getlinem(kInit, "\nroot [0]");
920  }
921  }
922  }
923  else if (gApplication->GetAppRemote()) {
924  // switch back to local session if not already in
925  gApplication->ProcessLine(".R");
926  Getlinem(kInit, "\nroot [0]");
927  }
928 }
929 
930 ////////////////////////////////////////////////////////////////////////////////
931 /// Check if there is a filter active on the children of the list tree item.
932 /// If the but argument is true, the "filter" button state is set accordingly,
933 /// and its tooltip will show the filter used.
934 
936 {
937  Bool_t found = kFALSE;
938  TString filter;
939  // if there is no filter (the map is empty) then just return
940  if (fFilteredItems.empty())
941  return kFALSE;
942  auto it = fFilteredItems.find(item);
943  if (it != fFilteredItems.end()) {
944  // if the item is in the map, take the filter regexp string
945  filter = it->second.c_str();
946  fFilterStr = filter;
947  found = kTRUE;
948  }
949  if (but) {
950  // if the but argument is true, change the button state
951  // to reflect the filtering state
953  if (found) {
954  // format the tooltip to display the regexp used as filter
955  filter.Prepend("Showing only \'");
956  filter += "\'";
957  fFilterButton->SetToolTipText(filter.Data());
958  }
959  else {
960  // reset the tooltip text
961  fFilterButton->SetToolTipText("Filter Content...");
962  }
963  }
964  return found;
965 }
966 
967 ////////////////////////////////////////////////////////////////////////////////
968 /// Check if the list tree item children are alphabetically sorted.
969 /// If the but argument is true, the "sort" button state is set accordingly.
970 
972 {
973  Bool_t found = kFALSE;
974  TGListTreeItem *i, *itm;
975  if (item->GetFirstChild())
976  itm = item;
977  else
978  itm = item->GetParent();
979  for (sLTI_i p=fSortedItems.begin(); p!=fSortedItems.end(); ++p) {
980  i = (TGListTreeItem *)(*p);
981  if (itm == i) {
982  found = kTRUE;
983  break;
984  }
985  }
986  if (but) fSortButton->SetState(found ? kButtonEngaged : kButtonUp);
987  return found;
988 }
989 
990 ////////////////////////////////////////////////////////////////////////////////
991 /// Process mouse clicks in TGListTree.
992 
994 {
995  char path[1024];
996  Long64_t size = 0;
997  Long_t id = 0, flags = 0, modtime = 0;
998  fListLevel = item;
999  if (!item) return;
1000  CheckSorted(item, kTRUE);
1001  CheckFiltered(item, kTRUE);
1002  CheckRemote(item);
1003  TObject *selected = 0;
1004  TString fullpath = FullPathName(item);
1005  TObject *obj = (TObject *) item->GetUserData();
1006  if (obj && (!obj->InheritsFrom("TObjString") ||
1007  gSystem->AccessPathName(fullpath.Data()))) {
1008  if (obj->InheritsFrom("TKey") && (obj->IsA() != TClass::Class())) {
1009  Chdir(item);
1010  const char *clname = ((TKey *)obj)->GetClassName();
1011  if (clname && strcmp(clname, "TGeoManager")) {
1012  TClass *cl = TClass::GetClass(clname);
1013  TString name = ((TKey *)obj)->GetName();
1014  name += ";";
1015  name += ((TKey *)obj)->GetCycle();
1016  void *add = gDirectory->FindObjectAny((char *) name.Data());
1017  if (add && cl->IsTObject()) {
1018  obj = (TObject*)add;
1019  // don't change the user data, to avoid deletion of the
1020  // list tree item by RecursiveRemove()
1021  // it is better to read the object each time anyway,
1022  // as it may have changed in the file
1023  if (obj->InheritsFrom("TDirectory") || obj->InheritsFrom("TList"))
1024  item->SetUserData(obj);
1025  }
1026  }
1027  }
1028  if (obj->InheritsFrom("TLeaf") ||
1029  obj->InheritsFrom("TBranch")) {
1030  Chdir(item);
1031  }
1032  if (btn == kButton3)
1033  fContextMenu->Popup(x, y, obj, fBrowser);
1034  selected = obj;
1035  }
1036  else {
1037  fListTree->GetPathnameFromItem(item, path);
1038  if (strlen(path) > 3) {
1039  if (gSystem->GetPathInfo(fullpath.Data(), &id, &size, &flags, &modtime) == 0) {
1040  if (flags & 2) {
1041  fCurrentDir = item;
1042  if (btn == kButton3) {
1043  if (fDir) delete fDir;
1044  fDir = new TSystemDirectory(item->GetText(), fullpath.Data());
1046  }
1047  }
1048  else {
1049  fCurrentDir = item->GetParent();
1050  if (btn == kButton3) {
1051  if (fFile) delete fFile;
1052  fFile = new TSystemFile(item->GetText(), fullpath.Data());
1054  }
1055  }
1056  }
1057  }
1058  }
1060  if (selected && (selected->IsA() != TClass::Class())) {
1061  if (selected->InheritsFrom("TLeaf"))
1062  selected = (TObject *)gROOT->ProcessLine(TString::Format("((TLeaf *)0x%lx)->GetBranch()->GetTree();", (ULong_t)selected));
1063  if (selected->InheritsFrom("TBranch"))
1064  selected = (TObject *)gROOT->ProcessLine(TString::Format("((TBranch *)0x%lx)->GetTree();", (ULong_t)selected));
1065  if (selected->InheritsFrom("TTree")) {
1066  // if a tree not attached to any directory (e.g. in a TFolder)
1067  // then attach it to the current directory (gDirectory)
1068  TDirectory *tdir = (TDirectory *)gROOT->ProcessLine(TString::Format("((TTree *)0x%lx)->GetDirectory();", (ULong_t)selected));
1069  if (!tdir) {
1070  gROOT->ProcessLine(TString::Format("((TTree *)0x%lx)->SetDirectory(gDirectory);", (ULong_t)selected));
1071  }
1072  }
1073  }
1074  if (selected && gPad && IsObjectEditable(selected->IsA())) {
1076  if (ved) {
1077  TGedEditor *ged = (TGedEditor *)ved;
1078  ged->SetModel(gPad, selected, kButton1Down);
1079  }
1080  }
1081 }
1082 
1083 ////////////////////////////////////////////////////////////////////////////////
1084 /// returns an absolute path
1085 
1087 {
1088  TGListTreeItem *parent, *itm = item;
1089  TString dirname = itm->GetText();
1090 
1091  while ((parent=itm->GetParent())) {
1092  char *s = gSystem->ConcatFileName(parent->GetText(), dirname);
1093  dirname = s;
1094  delete [] s;
1095  itm = parent;
1096  }
1097  gSystem->ExpandPathName(dirname);
1098 #ifdef R__WIN32
1099  // only handle .lnk files on Windows
1100  while (dirname.Contains(".lnk")) {
1101  Ssiz_t idx = dirname.Index(".lnk") + 4;
1102  TString resolved = dirname;
1103  resolved.Remove(idx);
1104  gSystem->ExpandPathName(resolved);
1105  dirname = resolved.Append(dirname.Remove(0, idx));
1106  }
1107 #endif
1108  return dirname;
1109 }
1110 
1111 ////////////////////////////////////////////////////////////////////////////////
1112 /// returns the directory path
1113 
1115 {
1116  TString dirname;
1117  TString fullpath = FullPathName(item);
1118 
1119 #ifdef WIN32
1120  char winDrive[256];
1121  char winDir[256];
1122  char winName[256];
1123  char winExt[256];
1124  _splitpath(fullpath.Data(), winDrive, winDir, winName, winExt);
1125  dirname = TString::Format("%s%s", winDrive, winDir);
1126 #else
1127  dirname = gSystem->GetDirName(fullpath);
1128 #endif
1129  return dirname;
1130 }
1131 
1132 ////////////////////////////////////////////////////////////////////////////////
1133 /// Returns true if given a text file
1134 /// Uses the specification given on p86 of the Camel book
1135 /// - Text files have no NULLs in the first block
1136 /// - and less than 30% of characters with high bit set
1137 
1138 static Bool_t IsTextFile(const char *candidate)
1139 {
1140  Int_t i;
1141  Int_t nchars;
1142  Int_t weirdcount = 0;
1143  char buffer[512];
1144  FILE *infile;
1145  FileStat_t buf;
1146 
1147  if (gSystem->GetPathInfo(candidate, buf) || !(buf.fMode & kS_IFREG))
1148  return kFALSE;
1149 
1150  infile = fopen(candidate, "r");
1151  if (infile) {
1152  // Read a block
1153  nchars = fread(buffer, 1, 512, infile);
1154  fclose (infile);
1155  // Examine the block
1156  for (i = 0; i < nchars; i++) {
1157  if (buffer[i] & 128)
1158  weirdcount++;
1159  if (buffer[i] == '\0')
1160  // No NULLs in text files
1161  return kFALSE;
1162  }
1163  if ((nchars > 0) && ((weirdcount * 100 / nchars) > 30))
1164  return kFALSE;
1165  } else {
1166  // Couldn't open it. Not a text file then
1167  return kFALSE;
1168  }
1169  return kTRUE;
1170 }
1171 
1172 ////////////////////////////////////////////////////////////////////////////////
1173 /// Create a symlink (shortcut on Windows) icon by merging the picture
1174 /// passed as argument and the slink_t.xpm icon (small arrow)
1175 
1176 static const TGPicture *MakeLinkPic(const TGPicture *pic)
1177 {
1178  const TGPicture *merged;
1179  TImage *img1, *img2;
1180  if (pic) {
1181  img1 = TImage::Create();
1182  if (img1 == 0) return pic;
1183  img1->SetImage(((const TGPicture *)pic)->GetPicture(),
1184  ((const TGPicture *)pic)->GetMask());
1185  img2 = TImage::Open("slink_t.xpm");
1186  if (img2) img1->Merge(img2);
1187  TString lnk_name = ((const TGPicture *)pic)->GetName();
1188  lnk_name.Prepend("lnk_");
1189  merged = gClient->GetPicturePool()->GetPicture(lnk_name.Data(),
1190  img1->GetPixmap(), img1->GetMask());
1191  if (img2) delete img2;
1192  delete img1;
1193  return merged;
1194  }
1195  return pic;
1196 }
1197 
1198 ////////////////////////////////////////////////////////////////////////////////
1199 /// Process double clicks in TGListTree.
1200 
1202 {
1203  const TGPicture *pic=0;
1204  TString dirname = DirName(item);
1205  TString fullpath = FullPathName(item);
1206  TGListTreeItem *itm;
1207  FileStat_t sbuf;
1208  Long64_t size;
1209  Long_t id, flags, modtime;
1210  char action[512];
1211  TString act;
1212  Bool_t is_link = kFALSE;
1213  if (!gSystem->GetPathInfo(item->GetText(), sbuf) && sbuf.fIsLink) {
1214  is_link = kTRUE;
1215  fullpath = item->GetText();
1216  gSystem->ExpandPathName(fullpath);
1217  }
1218 
1219  if (fNewBrowser)
1220  fNewBrowser->SetActBrowser(this);
1221  TCursorSwitcher switcher(this, fListTree);
1222  fListLevel = item;
1223  CheckSorted(item, kTRUE);
1224  CheckFiltered(item, kTRUE);
1225  CheckRemote(item);
1226  TGListTreeItem *pitem = item->GetParent();
1227  TObject *obj = (TObject *) item->GetUserData();
1228  if (obj && !obj->InheritsFrom("TSystemFile")) {
1229  TString ext = obj->GetName();
1230  if (obj->InheritsFrom("TDirectory") && (obj->IsA() != TClass::Class())) {
1231  if (((TDirectory *)obj)->GetListOfKeys())
1232  fNKeys = ((TDirectory *)obj)->GetListOfKeys()->GetEntries();
1233  else
1234  fNKeys = 0;
1235  }
1236  else if (obj->InheritsFrom("TKey") && (obj->IsA() != TClass::Class())) {
1237  Chdir(item);
1238  const char *clname = ((TKey *)obj)->GetClassName();
1239  if (clname) {
1240  TClass *cl = TClass::GetClass(clname);
1241  TString name = ((TKey *)obj)->GetName();
1242  name += ";";
1243  name += ((TKey *)obj)->GetCycle();
1244  void *add = gDirectory->FindObjectAny((char *) name.Data());
1245  if (add && cl->IsTObject()) {
1246  obj = (TObject*)add;
1247  // don't change the user data, to avoid deletion of the
1248  // list tree item by RecursiveRemove()
1249  // it is better to read the object each time anyway,
1250  // as it may have changed in the file
1251  if (obj->InheritsFrom("TDirectory") || obj->InheritsFrom("TList"))
1252  item->SetUserData(obj);
1253  }
1254  }
1255  }
1256  else if (obj->InheritsFrom("TLeaf") || obj->InheritsFrom("TBranch")) {
1257  Chdir(item);
1258  }
1259  else if (obj->InheritsFrom("TRemoteObject")) {
1260  // the real object is a TKey
1261  TRemoteObject *robj = (TRemoteObject *)obj;
1262  if (!strcmp(robj->GetClassName(), "TKey")) {
1263  TGListTreeItem *parent = item;
1264  TRemoteObject *probj = (TRemoteObject *)parent->GetUserData();
1265  // find the TFile remote object containing the TKey
1266  while ( probj && strcmp(probj->GetClassName(), "TFile")) {
1267  parent = parent->GetParent();
1268  probj = (TRemoteObject *)parent->GetUserData();
1269  }
1270  if (probj && !strcmp(probj->GetClassName(), "TFile")) {
1271  // remotely browse file (remotely call TFile::cd())
1274  TString::Format("((TApplicationServer *)gApplication)->BrowseFile(\"%s\");",
1275  probj->GetName()));
1276  gSystem->Sleep(250);
1277  }
1278  }
1279  if (gClient->GetMimeTypeList()->GetAction(obj->GetName(), action)) {
1280  act = action;
1281  act.ReplaceAll("%s", obj->GetName());
1282  if ((act[0] != '!') && (strcmp(pitem->GetText(), "ROOT Files"))) {
1283  // special case for remote object: remote process
1285  gApplication->ProcessLine(act.Data());
1286  }
1287  }
1288  if ((ext.EndsWith(".root")) && (strcmp(pitem->GetText(), "ROOT Files"))) {
1290  gApplication->ProcessLine("((TApplicationServer *)gApplication)->BrowseFile(0);");
1291  }
1292  }
1293  if (!obj->InheritsFrom("TObjString") ||
1294  gSystem->AccessPathName(fullpath.Data())) {
1296  fDblClick = kTRUE;
1297  if (gClient->GetMimeTypeList()->GetAction(obj->IsA()->GetName(), action)) {
1298  act = action;
1299  if (fBrowser && act.Contains("->Browse()")) obj->Browse(fBrowser);
1300  else if (act.Contains("->Draw()")) obj->Draw(GetDrawOption());
1301  else {
1302  if (act.Contains("%s")) act.ReplaceAll("%s", obj->GetName());
1303  else act.Prepend(obj->GetName());
1304  gInterpreter->SaveGlobalsContext();
1305  if (act[0] == '!') {
1306  act.Remove(0, 1);
1307  gSystem->Exec(act.Data());
1308  } else {
1309  // special case for remote object: remote process
1310  if (obj->InheritsFrom("TRemoteObject"))
1312  gApplication->ProcessLine(act.Data());
1313  }
1314  }
1315  }
1316  else if (obj->InheritsFrom("TCanvas") && fNewBrowser &&
1317  fNewBrowser->GetTabRight() &&
1318  fNewBrowser->GetTabRight()->GetTabTab(obj->GetName())) {
1319  // avoid potential crash when drawing a canvas with the same name
1320  // than a canvas already embedded in one of the browser's tab
1321  obj->DrawClone();
1322  }
1323  else if (fBrowser && !obj->InheritsFrom("TFormula") &&
1324  !obj->InheritsFrom("TMethodBrowsable"))
1325  obj->Browse(fBrowser);
1326  fDblClick = kFALSE;
1327  fNKeys = 0;
1328  fCnt = 0;
1330  if (gPad) gPad->Update();
1331  return;
1332  }
1333  }
1334  flags = id = size = modtime = 0;
1335  if (gSystem->GetPathInfo(fullpath.Data(), &id, &size, &flags, &modtime) != 0)
1336  return;
1337  Int_t isdir = (Int_t)flags & 2;
1338 
1339  TString savdir = gSystem->WorkingDirectory();
1340  if (isdir) {
1341  fCurrentDir = item;
1342  //fListTree->DeleteChildren(item);
1343  TSystemDirectory dir(item->GetText(),FullPathName(item));
1344  TList *files = dir.GetListOfFiles();
1345  if (files) {
1346  files->Sort();
1347  TIter next(files);
1348  TSystemFile *file;
1349  TString fname, pname;
1350  // directories first
1351  //fListTree->DeleteChildren(item);
1352  while ((file=(TSystemFile*)next())) {
1353  fname = file->GetName();
1354  if (file->IsDirectory()) {
1355  if (!fShowHidden && fname.BeginsWith("."))
1356  continue;
1357  if ((fname!="..") && (fname!=".")) { // skip it
1358  if (!fListTree->FindChildByName(item, fname)) {
1359  itm = fListTree->AddItem(item, fname);
1360  if (!gSystem->GetPathInfo(fname, sbuf) &&
1361  sbuf.fIsLink) {
1362  // change the pictures if it is a symlink
1363  // (shortcut on Windows)
1364  const TGPicture *opened = 0, *l_opened = 0;
1365  const TGPicture *closed = 0, *l_closed = 0;
1366  opened = fClient->GetPicture("ofolder_t.xpm");
1367  if (opened) l_opened = MakeLinkPic(opened);
1368  closed = fClient->GetPicture("folder_t.xpm");
1369  if (closed) l_closed = MakeLinkPic(closed);
1370  if (l_opened && l_closed)
1371  itm->SetPictures(l_opened, l_closed);
1372  if (opened) fClient->FreePicture(opened);
1373  if (closed) fClient->FreePicture(closed);
1374  if (l_opened) fClient->FreePicture(l_opened);
1375  if (l_closed) fClient->FreePicture(l_closed);
1376  }
1377  // uncomment line below to set directories as
1378  // DND targets
1379  //itm->SetDNDTarget(kTRUE);
1380  itm->SetUserData(0);
1381  }
1382  }
1383  }
1384  }
1385  // then files...
1386  TIter nextf(files);
1387  while ((file=(TSystemFile*)nextf())) {
1388  fname = pname = file->GetName();
1389  if (!file->IsDirectory() && (fFilter == 0 ||
1390  (fFilter && fname.Index(*fFilter) != kNPOS))) {
1391  if (!fShowHidden && fname.BeginsWith("."))
1392  continue;
1393  size = modtime = 0;
1394  if (gSystem->GetPathInfo(fname, sbuf) == 0) {
1395  size = sbuf.fSize;
1396  modtime = sbuf.fMtime;
1397  }
1398  if (sbuf.fIsLink && pname.EndsWith(".lnk"))
1399  pname.Remove(pname.Length()-4);
1400  pic = gClient->GetMimeTypeList()->GetIcon(pname, kTRUE);
1401  if (!pic)
1402  pic = fFileIcon;
1403  if (sbuf.fIsLink)
1404  pic = MakeLinkPic(pic);
1405  if (!fListTree->FindChildByName(item, fname)) {
1406  itm = fListTree->AddItem(item, fname, pic, pic);
1407  if (pic != fFileIcon)
1408  fClient->FreePicture(pic);
1409  if (sbuf.fIsLink) {
1410  TString fullname = file->GetName();
1411  gSystem->ExpandPathName(fullname);
1412  itm->SetUserData(new TObjString(TString::Format("file://%s\r\n",fullname.Data())), kTRUE);
1413  } else {
1414  itm->SetUserData(new TObjString(TString::Format("file://%s/%s\r\n",
1415  gSystem->UnixPathName(file->GetTitle()),
1416  file->GetName())), kTRUE);
1417  }
1418  itm->SetDNDSource(kTRUE);
1419  if (size && modtime) {
1420  char *tiptext = FormatFileInfo(fname.Data(), size, modtime);
1421  itm->SetTipText(tiptext);
1422  delete [] tiptext;
1423  }
1424  }
1425  }
1426  }
1427  files->Delete();
1428  delete files;
1429  }
1430  }
1431  else {
1432  TString lnkname = item->GetText();
1433  if (is_link && lnkname.EndsWith(".lnk"))
1434  lnkname.Remove(lnkname.Length()-4);
1435  fCurrentDir = item->GetParent();
1436  TSystemFile f(lnkname.Data(), fullpath.Data());
1437  TString fname = f.GetName();
1438  if (fname.EndsWith(".root")) {
1439  TDirectory *rfile = 0;
1440  gSystem->ChangeDirectory(dirname.Data());
1441  rfile = (TDirectory *)gROOT->GetListOfFiles()->FindObject(obj);
1442  if (!rfile) {
1443  rfile = (TDirectory *)gROOT->ProcessLine(TString::Format("new TFile(\"%s\")",fname.Data()));
1444  }
1445  if (rfile) {
1446  // replace actual user data (TObjString) by the TDirectory...
1447  if (item->GetUserData()) {
1448  // first delete the data to avoid memory leaks
1449  TObject *obj2 = static_cast<TObject *>(item->GetUserData());
1450  // only delete TObjString as they are the only objects
1451  // created who have to be deleted
1452  TObjString *ostr = dynamic_cast<TObjString *>(obj2);
1453  if (ostr) delete ostr;
1454  }
1455  item->SetUserData(rfile);
1456  fNKeys = rfile->GetListOfKeys()->GetEntries();
1457  fCnt = 0;
1458  if (fBrowser) rfile->Browse(fBrowser);
1459  fNKeys = 0;
1460  fCnt = 0;
1461  }
1462  }
1463  else if (fname.EndsWith(".png")) {
1464  gSystem->ChangeDirectory(dirname.Data());
1466  gSystem->ChangeDirectory(savdir.Data());
1467  }
1468  else if (IsTextFile(fullpath.Data())) {
1469  gSystem->ChangeDirectory(dirname.Data());
1470  if (fNewBrowser) {
1471  TGFrameElement *fe = 0;
1472  TGTab *tabRight = fNewBrowser->GetTabRight();
1473  TGCompositeFrame *frame = tabRight->GetCurrentContainer();
1474  if (frame)
1475  fe = (TGFrameElement *)frame->GetList()->First();
1476  if (fe) {
1477  TGCompositeFrame *embed = (TGCompositeFrame *)fe->fFrame;
1478  TString fullname = f.GetTitle();
1479  fullname.ReplaceAll("\\", "\\\\");
1480  if (embed->InheritsFrom("TGTextEditor")) {
1481  gROOT->ProcessLine(TString::Format("((TGTextEditor *)0x%lx)->LoadFile(\"%s\");",
1482  (ULong_t)embed, fullname.Data()));
1483  }
1484  else if (embed->InheritsFrom("TGTextEdit")) {
1485  gROOT->ProcessLine(TString::Format("((TGTextEdit *)0x%lx)->LoadFile(\"%s\");",
1486  (ULong_t)embed, fullname.Data()));
1487  }
1488  else {
1490  }
1491  }
1492  else {
1494  }
1495  }
1496  gSystem->ChangeDirectory(savdir.Data());
1497  }
1498  else {
1499  gSystem->ChangeDirectory(dirname.Data());
1501  gSystem->ChangeDirectory(savdir.Data());
1502  }
1503  }
1504  //gSystem->ChangeDirectory(savdir.Data());
1506 }
1507 
1508 ////////////////////////////////////////////////////////////////////////////////
1509 /// Execute default action for selected object (action is specified
1510 /// in the $HOME/.root.mimes or $ROOTSYS/etc/root.mimes file.
1511 
1513 {
1514  char action[512];
1515  TString act;
1516  TString ext = obj->GetName();
1518 
1519  if (gClient->GetMimeTypeList()->GetAction(obj->GetName(), action)) {
1520  act = action;
1521  act.ReplaceAll("%s", obj->GetName());
1522  gInterpreter->SaveGlobalsContext();
1523 
1524  if (act[0] == '!') {
1525  act.Remove(0, 1);
1526  gSystem->Exec(act.Data());
1527  return 0;
1528  } else {
1529  // special case for remote object: remote process
1530  if (obj->InheritsFrom("TRemoteObject"))
1532 
1533  const Long_t res = gApplication->ProcessLine(act.Data());
1534 #ifdef R__HAS_COCOA
1535  if (act.Contains(".x") || act.Contains(".X")) {
1536  if (gPad) gPad->Update();
1537  }
1538 #endif
1539  return res;
1540  }
1541  }
1542  return 0;
1543 }
1544 
1545 ////////////////////////////////////////////////////////////////////////////////
1546 /// Format file information to be displayed in the tooltip.
1547 
1548 char *TGFileBrowser::FormatFileInfo(const char *fname, Long64_t size, Long_t modtime)
1549 {
1550  Long64_t fsize, bsize;
1551  TString infos = fname;
1552  infos += "\n";
1553 
1554  fsize = bsize = size;
1555  if (fsize > 1024) {
1556  fsize /= 1024;
1557  if (fsize > 1024) {
1558  // 3.7MB is more informative than just 3MB
1559  infos += TString::Format("Size: %lld.%lldM", fsize/1024, (fsize%1024)/103);
1560  } else {
1561  infos += TString::Format("Size: %lld.%lldK", bsize/1024, (bsize%1024)/103);
1562  }
1563  } else {
1564  infos += TString::Format("Size: %lld", bsize);
1565  }
1566  struct tm *newtime;
1567  time_t loctime = (time_t) modtime;
1568  newtime = localtime(&loctime);
1569  if (newtime) {
1570  infos += "\n";
1571  infos += TString::Format("%d-%02d-%02d %02d:%02d",
1572  newtime->tm_year + 1900,
1573  newtime->tm_mon+1, newtime->tm_mday,
1574  newtime->tm_hour, newtime->tm_min);
1575  }
1576  return StrDup(infos.Data());
1577 }
1578 
1579 ////////////////////////////////////////////////////////////////////////////////
1580 /// Retrieve icons associated with class "name". Association is made
1581 /// via the user's ~/.root.mimes file or via $ROOTSYS/etc/root.mimes.
1582 
1584 {
1585  const char *clname = 0;
1586  TClass *objClass = 0;
1587  static TImage *im = 0;
1588  if (!im) {
1589  im = TImage::Create();
1590  }
1591 
1592  if (obj->IsA() == TClass::Class()) {
1593  objClass = obj->IsA();
1594  if (objClass)
1595  clname = objClass->GetName();
1596  }
1597  else if (obj->InheritsFrom("TKey")) {
1598  clname = ((TKey *)obj)->GetClassName();
1599  }
1600  else if (obj->InheritsFrom("TKeyMapFile")) {
1601  clname = ((TKeyMapFile *)obj)->GetTitle();
1602  }
1603  else if (obj->InheritsFrom("TRemoteObject")) {
1604  // special case for remote object: get real object class
1605  TRemoteObject *robj = (TRemoteObject *)obj;
1606  if (!strcmp(robj->GetClassName(), "TKey"))
1607  clname = robj->GetKeyClassName();
1608  else
1609  clname = robj->GetClassName();
1610  }
1611  else {
1612  objClass = obj->IsA();
1613  if (objClass)
1614  clname = objClass->GetName();
1615  }
1616  if (!clname) {
1617  clname = "Unknown";
1618  }
1619  const char *name = obj->GetIconName() ? obj->GetIconName() : clname;
1620  TString xpm_magic(name, 3);
1621  Bool_t xpm = xpm_magic == "/* ";
1622  const char *iconname = xpm ? obj->GetName() : name;
1623 
1624  if (obj->IsA()->InheritsFrom("TGeoVolume")) {
1625  iconname = obj->GetIconName() ? obj->GetIconName() : obj->IsA()->GetName();
1626  }
1627 
1628  if (fCachedPicName == iconname) {
1629  *pic = fCachedPic;
1630  return;
1631  }
1632  *pic = gClient->GetMimeTypeList()->GetIcon(iconname, kTRUE);
1633  if (!(*pic) && xpm) {
1634  if (im && im->SetImageBuffer((char**)&name, TImage::kXpm)) {
1635  im->Scale(im->GetWidth()/4, im->GetHeight()/4);
1636  *pic = gClient->GetPicturePool()->GetPicture(iconname, im->GetPixmap(),
1637  im->GetMask());
1638  }
1639  gClient->GetMimeTypeList()->AddType("[thumbnail]", iconname, iconname, iconname, "->Browse()");
1640  return;
1641  }
1642  if (fCachedPic && (fCachedPic != fFileIcon))
1644  if (*pic == 0) {
1645  if (!obj->IsFolder())
1646  *pic = fFileIcon;
1647  }
1648  fCachedPic = *pic;
1649  fCachedPicName = iconname;
1650 }
1651 
1652 ////////////////////////////////////////////////////////////////////////////////
1653 /// Go to the directory "path" and open all the parent list tree items.
1654 
1655 void TGFileBrowser::GotoDir(const char *path)
1656 {
1657  TGListTreeItem *item, *itm;
1658  ULong_t id;
1659  Long_t bsize, blocks, bfree;
1660  Bool_t expand = kTRUE;
1661  TString sPath(gSystem->UnixPathName(path));
1662  item = fRootDir;
1663  if (item == 0) return;
1664  fListTree->OpenItem(item);
1665  TObjArray *tokens = sPath.Tokenize("/");
1666  if (tokens->IsEmpty()) {
1667  fListTree->HighlightItem(item);
1668  DoubleClicked(item, 1);
1669  delete tokens;
1671  fListTree->AdjustPosition(item);
1672  return;
1673  }
1674  // if the Browser.ExpandDirectories option is set to "no", then don't
1675  // expand the parent directory tree (for example on nfs)
1676  TString str = gEnv->GetValue("Browser.ExpandDirectories", "yes");
1677  str.ToLower();
1678  expand = (str == "yes") ? kTRUE : kFALSE;
1679  TString first = ((TObjString*)tokens->At(0))->GetName();
1680  // always prevent expanding the parent directory tree on afs
1681  if (first == "afs")
1682  expand = kFALSE;
1683  // check also AFS_SUPER_MAGIC, NFS_SUPER_MAGIC, FUSE_SUPER_MAGIC,
1684  // CIFS_MAGIC_NUMBER and SMB_SUPER_MAGIC
1685  if (!gSystem->GetFsInfo(path, (Long_t *)&id, &bsize, &blocks, &bfree))
1686  if (id == 0x5346414f || id == 0x6969 || id == 0x65735546 || id == 0xff534d42 || id == 0x517b)
1687  expand = kFALSE;
1688  if (first.Length() == 2 && first.EndsWith(":")) {
1689  TList *curvol = gSystem->GetVolumes("cur");
1690  if (curvol) {
1691  TNamed *drive = (TNamed *)curvol->At(0);
1692  if (first == drive->GetName()) {
1693  TString infos = drive->GetTitle();
1694  if (infos.Contains("Network"))
1695  expand = kFALSE;
1696  }
1697  delete curvol;
1698  }
1699  }
1700  for (Int_t i = 0; i < tokens->GetEntriesFast(); ++i) {
1701  TString token = ((TObjString*)tokens->At(i))->GetName();
1702  if (token.Length() == 2 && token.EndsWith(":")) {
1703  token.Append("\\");
1704  itm = fListTree->FindChildByName(0, token);
1705  if (itm) {
1706  item = itm;
1707  fListTree->OpenItem(item);
1708  if (expand)
1709  DoubleClicked(item, 1);
1710  }
1711  continue;
1712  }
1713  itm = fListTree->FindChildByName(item, token);
1714  if (itm) {
1715  item = itm;
1716  fListTree->OpenItem(item);
1717  if (expand)
1718  DoubleClicked(item, 1);
1719  }
1720  else {
1721  itm = fListTree->AddItem(item, token);
1722  item = itm;
1723  fListTree->OpenItem(item);
1724  if (expand)
1725  DoubleClicked(item, 1);
1726  }
1727  }
1728  fListTree->HighlightItem(item);
1729  DoubleClicked(item, 1);
1730  delete tokens;
1732  fListTree->AdjustPosition(item);
1733 }
1734 
1735 ////////////////////////////////////////////////////////////////////////////////
1736 /// Slot used to switch to the tab containing the current pad/canvas (gPad)
1737 /// used e.g. when drawing a histogram by double-clicking on its list tree
1738 /// item in a root file.
1739 
1741 {
1742  if (fDblClick && fNewBrowser) {
1743  Int_t i;
1744  TGTab *tabRight = fNewBrowser->GetTabRight();
1745  for (i=0;i<tabRight->GetNumberOfTabs();++i) {
1746  TGFrameElement *fe = 0;
1747  TGCompositeFrame *embed = 0;
1748  TGCompositeFrame *frame = tabRight->GetTabContainer(i);
1749  if (frame)
1750  fe = (TGFrameElement *)frame->GetList()->First();
1751  if (fe)
1752  embed = (TGCompositeFrame *)fe->fFrame;
1753  if (embed && embed->InheritsFrom("TRootCanvas")) {
1754  ULong_t canvas = gROOT->ProcessLine(TString::Format("((TRootCanvas *)0x%lx)->Canvas();",
1755  (ULong_t)embed));
1756  if ((canvas) && (canvas == (ULong_t)gPad ||
1757  canvas == (ULong_t)gPad->GetCanvas())) {
1758  tabRight->SetTab(i, kTRUE);
1759  break;
1760  }
1761  }
1762  }
1763  }
1764 }
1765 
1766 ////////////////////////////////////////////////////////////////////////////////
1767 /// Open a dialog box asking for a string to be used as filter (regexp), and
1768 /// add an entry in the map of filtered entries. Entering "*" or empty string
1769 /// ("") will disable filtering on the current list tree item.
1770 
1772 {
1773  char filter[1024];
1774  if (!fListLevel)
1775  return;
1776  // initialize with previous (active) filter string
1777  snprintf(filter, sizeof(filter), "%s", fFilterStr.Data());
1778  new TGInputDialog(gClient->GetRoot(), this,
1779  "Enter filter expression:\n(empty string \"\" or \"*\" to remove filter)",
1780  filter, filter);
1781  // if user pressed cancel, update the status of the current list tree
1782  // item and return
1783  if ((filter[0] == 0) && (filter[1] == 0)) {
1785  return;
1786  }
1787  else if (((filter[0] == 0) && (filter[1] == 1)) || !strcmp(filter, "*")) {
1788  // if user entered "*" or "", just disable filtering for the current
1789  // list tree item
1791  fFilteredItems.erase(fListLevel);
1792  } else {
1793  // if user entered a string different from "*", use it to create an
1794  // entry in the filter map
1795  fFilterStr = filter;
1797  // if there is already a filter on this item, delete it
1799  fFilteredItems.erase(fListLevel);
1800  // insert a new entry for the current list tree item
1801  fFilteredItems.emplace(fListLevel, filter);
1802  }
1803  // finally update the list tree
1808 }
1809 
1810 ////////////////////////////////////////////////////////////////////////////////
1811 /// A ROOT File has been selected in TGHtmlBrowser.
1812 
1814 {
1815  TGListTreeItem *itm = fListTree->FindChildByData(0, gROOT->GetListOfFiles());
1816  if (itm) {
1818  fListLevel = itm;
1821  BrowseObj(gROOT->GetListOfFiles());
1824  }
1825 }
1826 
1827 ////////////////////////////////////////////////////////////////////////////////
1828 /// Toggle the sort mode and set the "sort button" state accordingly.
1829 
1831 {
1832  if (!fListLevel) return;
1833  TString itemname;
1834  TGListTreeItem *item = fListLevel;
1835  if (!fListLevel->GetFirstChild()) {
1836  item = fListLevel->GetParent();
1837  itemname = fListLevel->GetText();
1838  }
1839  if (!item)
1840  return;
1841  Bool_t is_sorted = CheckSorted(item);
1842  if (!is_sorted) {
1843  //alphabetical sorting
1844  fListTree->SortChildren(item);
1845  fSortedItems.push_back(item);
1847  } else {
1848  fListTree->DeleteChildren(item);
1849  DoubleClicked(item, 1);
1850  fSortedItems.remove(item);
1852  gClient->NeedRedraw(fListTree, kTRUE);
1853  gClient->HandleInput();
1854  if (itemname.Length() > 0) {
1855  TGListTreeItem *itm = fListTree->FindChildByName(item, itemname);
1856  if (itm) {
1858  Clicked(itm, 1, 0, 0);
1859  itm->SetActive(kTRUE);
1860  fListTree->SetSelected(itm);
1862  }
1863  }
1864  }
1867 }
1868 
1869 
TGComboBox.h
TGListTree::SortChildren
Int_t SortChildren(TGListTreeItem *item)
Sort children of item.
Definition: TGListTree.cxx:2217
TGCompositeFrame::GetDefaultSize
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:353
TGButton::SetToolTipText
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:398
TGListBox
Definition: TGListBox.h:288
filters
const char * filters[]
Definition: TGFileBrowser.cxx:61
TSystem::GetPathInfo
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
Definition: TSystem.cxx:1396
TGComboBox::GetSelectedEntry
virtual TGLBEntry * GetSelectedEntry() const
Definition: TGComboBox.h:135
TGFileBrowser
Definition: TGFileBrowser.h:36
TGFileBrowser::ToggleSort
void ToggleSort()
Toggle the sort mode and set the "sort button" state accordingly.
Definition: TGFileBrowser.cxx:1830
TApplication::ApplicationName
virtual const char * ApplicationName() const
Definition: TApplication.h:124
first
Definition: first.py:1
TSystemDirectory::GetListOfFiles
virtual TList * GetListOfFiles() const
Returns a TList of TSystemFile objects representing the contents of the directory.
Definition: TSystemDirectory.cxx:84
TQObject::Disconnect
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1022
TGFileBrowser::ApplyFilter
void ApplyFilter(Int_t id)
Apply filter selected in combo box to the file tree view.
Definition: TGFileBrowser.cxx:820
TGTab::GetCurrentContainer
TGCompositeFrame * GetCurrentContainer() const
Definition: TGTab.h:110
TBrowser
Definition: TBrowser.h:37
TGWindow
Definition: TGWindow.h:31
TGListTree::FindChildByName
TGListTreeItem * FindChildByName(TGListTreeItem *item, const char *name)
Find child of item by name.
Definition: TGListTree.cxx:2285
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TGFileBrowser::CreateBrowser
void CreateBrowser()
Create the actual file browser.
Definition: TGFileBrowser.cxx:121
TObject::TestBit
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
TGCompositeFrame::GetList
virtual TList * GetList() const
Definition: TGFrame.h:347
TGMainFrame
Definition: TGFrame.h:444
snprintf
#define snprintf
Definition: civetweb.c:1540
TObjArray
Definition: TObjArray.h:37
TGInputDialog.h
TGPicture
Definition: TGPicture.h:36
TDirectory::GetListOfKeys
virtual TList * GetListOfKeys() const
Definition: TDirectory.h:168
f
#define f(i)
Definition: RSha256.hxx:122
TImage::Merge
virtual void Merge(const TImage *, const char *="alphablend", Int_t=0, Int_t=0)
Definition: TImage.h:172
TGFileBrowser::PadModified
void PadModified()
Slot used to switch to the tab containing the current pad/canvas (gPad) used e.g.
Definition: TGFileBrowser.cxx:1740
TSystem::ChangeDirectory
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
Definition: TSystem.cxx:861
TKeyMapFile.h
TGFileBrowser::AddKey
void AddKey(TGListTreeItem *itm, TObject *obj, const char *name=0)
display content of ROOT file
Definition: TGFileBrowser.cxx:772
TGFileBrowser::TGFileBrowser
TGFileBrowser(const TGWindow *p, TBrowser *b=0, UInt_t w=200, UInt_t h=400)
TGFileBrowser constructor.
Definition: TGFileBrowser.cxx:106
kNPOS
const Ssiz_t kNPOS
Definition: RtypesCore.h:115
TCollection::GetEntries
virtual Int_t GetEntries() const
Definition: TCollection.h:177
TGedEditor::SetModel
virtual void SetModel(TVirtualPad *pad, TObject *obj, Int_t event, Bool_t force=kFALSE)
Activate object editors according to the selected object.
Definition: TGedEditor.cxx:350
TImage::Create
static TImage * Create()
Create an image.
Definition: TImage.cxx:35
TString::Prepend
TString & Prepend(const char *cs)
Definition: TString.h:661
TGFileBrowser::fBotFrame
TGHorizontalFrame * fBotFrame
Definition: TGFileBrowser.h:47
gEnv
R__EXTERN TEnv * gEnv
Definition: TEnv.h:171
TString::Atoll
Long64_t Atoll() const
Return long long value of string.
Definition: TString.cxx:1947
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
TGTab::GetTabContainer
TGCompositeFrame * GetTabContainer(Int_t tabIndex) const
Return container of tab with index tabIndex.
Definition: TGTab.cxx:565
TList::Delete
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition: TList.cxx:469
TString::Data
const char * Data() const
Definition: TString.h:369
kLHintsTop
@ kLHintsTop
Definition: TGLayout.h:40
TGLayout.h
TGListTree::ClearHighlighted
void ClearHighlighted()
Un highlight items.
Definition: TGListTree.cxx:2397
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
Form
char * Form(const char *fmt,...)
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:54
TGComboBox::AddEntry
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:106
TObjString.h
FileStat_t
Definition: TSystem.h:124
TImage::SetImageBuffer
virtual Bool_t SetImageBuffer(char **, EImageFileTypes=TImage::kPng)
Definition: TImage.h:242
FileStat_t::fMtime
Long_t fMtime
Definition: TSystem.h:131
TRootBrowser.h
TObject::GetIconName
virtual const char * GetIconName() const
Returns mime type name of object.
Definition: TObject.cxx:369
kLHintsLeft
@ kLHintsLeft
Definition: TGLayout.h:37
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TGTextEntry::SetToolTipText
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
Definition: TGTextEntry.cxx:1663
TGLabel
Definition: TGLabel.h:32
TGCompositeFrame::Cleanup
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:952
TGListTree::HighlightItem
void HighlightItem(TGListTreeItem *item)
Highlight item.
Definition: TGListTree.cxx:2387
TGFileBrowser::fRootIcon
const TGPicture * fRootIcon
Definition: TGFileBrowser.h:59
TContextMenu::Popup
virtual void Popup(Int_t x, Int_t y, TObject *obj, TVirtualPad *c=nullptr, TVirtualPad *p=nullptr)
Popup context menu at given location in canvas c and pad p for selected object.
Definition: TContextMenu.cxx:411
TGedEditor.h
TGListTree::FindChildByData
TGListTreeItem * FindChildByData(TGListTreeItem *item, void *userData)
Find child of item by userData.
Definition: TGListTree.cxx:2308
TGListBox::Resize
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1420
TRootBrowser::Checked
virtual void Checked(TObject *obj, Bool_t check)
Emits signal when double clicking on icon.
Definition: TRootBrowser.cxx:1242
TGFileBrowser::Checked
void Checked(TObject *obj, Bool_t check)
Emits signal when double clicking on icon.
Definition: TGFileBrowser.cxx:517
kButtonUp
@ kButtonUp
Definition: TGButton.h:59
gInterpreter
#define gInterpreter
Definition: TInterpreter.h:558
TSystemDirectory
Definition: TSystemDirectory.h:32
TGListTreeItem::GetText
virtual const char * GetText() const =0
TGFileBrowser::fRefreshButton
TGPictureButton * fRefreshButton
Definition: TGFileBrowser.h:57
TGListTree::GetSelected
TGListTreeItem * GetSelected() const
Definition: TGListTree.h:397
TObject::GetObjectInfo
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Returns string containing info about the object at position (px,py).
Definition: TObject.cxx:388
TObject::DrawClone
virtual TObject * DrawClone(Option_t *option="") const
Draw a clone of this object in the current selected pad for instance with: gROOT->SetSelectedPad(gPad...
Definition: TObject.cxx:221
TBaseClass
Definition: TBaseClass.h:33
kS_IXUSR
@ kS_IXUSR
Definition: TSystem.h:104
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
TGComboBox::GetTextEntry
virtual TGTextEntry * GetTextEntry() const
Definition: TGComboBox.h:131
TGFileBrowser::fTopFrame
TGHorizontalFrame * fTopFrame
Definition: TGFileBrowser.h:46
Int_t
int Int_t
Definition: RtypesCore.h:45
TGListTree::DeleteChildren
Int_t DeleteChildren(TGListTreeItem *item)
Delete children of item from list.
Definition: TGListTree.cxx:2095
TGFileBrowser::Refresh
virtual void Refresh(Bool_t force=kFALSE)
Refresh content of the list tree.
Definition: TGFileBrowser.cxx:624
TQClass.h
TGFileBrowser::fFile
TSystemFile * fFile
Definition: TGFileBrowser.h:65
TBrowser.h
TGListTree
Definition: TGListTree.h:210
TString::Contains
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
TImage
Definition: TImage.h:29
TString::EndsWith
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition: TString.cxx:2177
x
Double_t x[n]
Definition: legend1.C:17
TGFileBrowser::fShowHidden
Bool_t fShowHidden
Definition: TGFileBrowser.h:69
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
TGMimeTypes.h
TBaseClass.h
TClass.h
TEnv::GetValue
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition: TEnv.cxx:491
TImage::GetHeight
virtual UInt_t GetHeight() const
Definition: TImage.h:229
TGFileBrowser::RecursiveRemove
virtual void RecursiveRemove(TObject *obj)
Recursively remove object.
Definition: TGFileBrowser.cxx:587
TGFileBrowser::~TGFileBrowser
virtual ~TGFileBrowser()
Destructor.
Definition: TGFileBrowser.cxx:251
TVirtualX.h
TKeyMapFile
Definition: TKeyMapFile.h:20
TGClient::FreePicture
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition: TGClient.cxx:309
TGFileBrowser::GetDrawOption
Option_t * GetDrawOption() const
returns drawing option
Definition: TGFileBrowser.cxx:526
TGHorizontalFrame
Definition: TGFrame.h:423
TGFileBrowser::fSortButton
TGPictureButton * fSortButton
Definition: TGFileBrowser.h:56
TGListTree::FindItemByObj
TGListTreeItem * FindItemByObj(TGListTreeItem *item, void *ptr)
Find item with fUserData == ptr.
Definition: TGListTree.cxx:2835
TGFileBrowser::AddRemoteFile
void AddRemoteFile(TObject *obj)
Add remote file in list tree.
Definition: TGFileBrowser.cxx:431
TGListTree::AddItem
void AddItem(TGListTreeItem *parent, TGListTreeItem *item)
Add given item to list tree.
Definition: TGListTree.cxx:1965
TObjArray::At
TObject * At(Int_t idx) const
Definition: TObjArray.h:166
TString::Format
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition: TString.cxx:2311
TObject::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TObject.cxx:403
TGListTree::DeleteItem
Int_t DeleteItem(TGListTreeItem *item)
Delete item from list tree.
Definition: TGListTree.cxx:2023
TGFileBrowser::fGroupSize
Int_t fGroupSize
Definition: TGFileBrowser.h:66
TEnv.h
TImage::Open
static TImage * Open(const char *file, EImageFileTypes type=kUnknown)
Open a specified image file.
Definition: TImage.cxx:118
TBaseClass::GetClassPointer
TClass * GetClassPointer(Bool_t load=kTRUE)
Get pointer to the base class TClass.
Definition: TBaseClass.cxx:63
TGFileBrowser::FormatFileInfo
char * FormatFileInfo(const char *fname, Long64_t size, Long_t modtime)
Format file information to be displayed in the tooltip.
Definition: TGFileBrowser.cxx:1548
TString
Definition: TString.h:136
TSystem::AccessPathName
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition: TSystem.cxx:1294
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TGObject::GetId
Handle_t GetId() const
Definition: TGObject.h:47
R_ISREG
Bool_t R_ISREG(Int_t mode)
Definition: TSystem.h:118
TObject::InheritsFrom
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:445
text
TText * text
Definition: entrylist_figure1.C:10
TString::Clear
void Clear()
Clear string without changing its capacity.
Definition: TString.cxx:1176
b
#define b(i)
Definition: RSha256.hxx:118
TSystem::GetDirName
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:1030
TGListTree::GetFirstItem
TGListTreeItem * GetFirstItem() const
Definition: TGListTree.h:396
TGFrame::MapWindow
virtual void MapWindow()
map window
Definition: TGFrame.h:229
TRemoteObject.h
bool
TSystem::WorkingDirectory
virtual const char * WorkingDirectory()
Return working directory.
Definition: TSystem.cxx:870
TString::ReplaceAll
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
TGFrame::GetWidth
UInt_t GetWidth() const
Definition: TGFrame.h:249
TGFileBrowser::BrowseObj
virtual void BrowseObj(TObject *obj)
Browse object.
Definition: TGFileBrowser.cxx:468
id
XFontStruct * id
Definition: TGX11.cxx:109
TGFrameElement::fFrame
TGFrame * fFrame
Definition: TGLayout.h:119
kWatch
@ kWatch
Definition: GuiTypes.h:374
TImage.h
TVirtualPadEditor::GetPadEditor
static TVirtualPadEditor * GetPadEditor(Bool_t load=kTRUE)
Returns the pad editor dialog. Static method.
Definition: TVirtualPadEditor.cxx:74
TGFileBrowser::Show
virtual void Show()
Definition: TGFileBrowser.h:86
TList::Sort
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
Definition: TList.cxx:936
TROOT.h
TObjString
Definition: TObjString.h:28
gClient
#define gClient
Definition: TGClient.h:166
TApplication.h
TList::First
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:658
TContextMenu
Definition: TContextMenu.h:44
TObject::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:359
TRefCnt::AddReference
void AddReference()
Definition: TRefCnt.h:46
TGListTree::AdjustPosition
void AdjustPosition(TGListTreeItem *item)
Move content to position of item.
Definition: TGListTree.cxx:1289
TObject::Browse
virtual void Browse(TBrowser *b)
Browse object. May be overridden for another default action.
Definition: TObject.cxx:121
TRegexp.h
TList::At
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Definition: TList.cxx:356
TRemoteObject
Definition: TRemoteObject.h:34
TContextMenu.h
TString::Tokenize
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Definition: TString.cxx:2197
TGFileBrowser::fCanvas
TGCanvas * fCanvas
Definition: TGFileBrowser.h:48
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TSystemDirectory.h
TGFileBrowser::fCnt
Long_t fCnt
Definition: TGFileBrowser.h:67
TGFileBrowser::Clicked
void Clicked(TGListTreeItem *item, Int_t btn, Int_t x, Int_t y)
Process mouse clicks in TGListTree.
Definition: TGFileBrowser.cxx:993
TVirtualPadEditor.h
TBrowserImp
Definition: TBrowserImp.h:29
TApplication::kProcessRemotely
@ kProcessRemotely
Definition: TApplication.h:44
TGFileBrowser::fDblClick
Bool_t fDblClick
Definition: TGFileBrowser.h:70
TSystem.h
kLHintsCenterY
@ kLHintsCenterY
Definition: TGLayout.h:41
TSystemFile
Definition: TSystemFile.h:29
h
#define h(i)
Definition: RSha256.hxx:124
TImage::Scale
virtual void Scale(UInt_t, UInt_t)
Definition: TImage.h:141
TGListTree::SetSelected
void SetSelected(TGListTreeItem *item)
Definition: TGListTree.h:368
kButton3
@ kButton3
Definition: GuiTypes.h:213
TObject::SetBit
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:696
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:317
TApplication::ProcessLine
virtual Long_t ProcessLine(const char *line, Bool_t sync=kFALSE, Int_t *error=0)
FileStat_t::fMode
Int_t fMode
Definition: TSystem.h:127
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1149
kButtonEngaged
@ kButtonEngaged
Definition: TGButton.h:61
TClass::GetListOfBases
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Definition: TClass.cxx:3555
TGListTreeItem::SetUserData
virtual void SetUserData(void *, Bool_t=kFALSE)
Definition: TGListTree.h:94
TGFileBrowser::RequestFilter
void RequestFilter()
Open a dialog box asking for a string to be used as filter (regexp), and add an entry in the map of f...
Definition: TGFileBrowser.cxx:1771
FileStat_t::fIsLink
Bool_t fIsLink
Definition: TSystem.h:132
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:590
FileStat_t::fSize
Long64_t fSize
Definition: TSystem.h:130
TObjArray::GetEntriesFast
Int_t GetEntriesFast() const
Definition: TObjArray.h:64
TGTextEntry
Definition: TGTextEntry.h:39
IsObjectEditable
static Bool_t IsObjectEditable(TClass *cl)
Helper function checking if a class has a graphic properties editor.
Definition: TGFileBrowser.cxx:269
TString::Remove
TString & Remove(Ssiz_t pos)
Definition: TString.h:673
TGListTree::CheckItem
void CheckItem(TGListTreeItem *item, Bool_t check=kTRUE)
Set check button state for the node 'item'.
Definition: TGListTree.cxx:2767
TNamed
Definition: TNamed.h:29
TGFileBrowser::fCachedPicName
TString fCachedPicName
Definition: TGFileBrowser.h:62
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
MakeLinkPic
static const TGPicture * MakeLinkPic(const TGPicture *pic)
Create a symlink (shortcut on Windows) icon by merging the picture passed as argument and the slink_t...
Definition: TGFileBrowser.cxx:1176
TString::Append
TString & Append(const char *cs)
Definition: TString.h:564
TGFileBrowser.h
TSystem::Exec
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition: TSystem.cxx:654
TImage::GetMask
virtual Pixmap_t GetMask()
Definition: TImage.h:236
TGFileBrowser::fListTree
TGListTree * fListTree
Definition: TGFileBrowser.h:49
Long_t
long Long_t
Definition: RtypesCore.h:54
kLHintsRight
@ kLHintsRight
Definition: TGLayout.h:39
TGListTreeItem::SetDNDSource
void SetDNDSource(Bool_t onoff)
Definition: TGListTree.h:123
TGLayoutHints
Definition: TGLayout.h:57
gDirectory
#define gDirectory
Definition: TDirectory.h:236
gApplication
R__EXTERN TApplication * gApplication
Definition: TApplication.h:166
StrDup
char * StrDup(const char *str)
Duplicate the string str.
Definition: TString.cxx:2490
TTimer::SingleShot
static void SingleShot(Int_t milliSec, const char *receiver_class, void *receiver, const char *method)
This static function calls a slot after a given time interval.
Definition: TTimer.cxx:256
TGTab
Definition: TGTab.h:62
TMVA::TMVAGlob::GetListOfKeys
UInt_t GetListOfKeys(TList &keys, TString inherits, TDirectory *dir=0)
Definition: tmvaglob.cxx:375
TGClient::GetPicture
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:290
TGFileBrowser::fSortedItems
sLTI_t fSortedItems
Definition: TGFileBrowser.h:72
TVirtualPad.h
TString::BeginsWith
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition: TString.h:615
TGContainer::ClearViewPort
virtual void ClearViewPort()
Clear view port and redraw full content.
Definition: TGCanvas.cxx:887
TRootBrowser::GetTabRight
TGTab * GetTabRight() const
Definition: TRootBrowser.h:141
TGTab.h
TClass::GetClass
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition: TClass.cxx:2925
TGFileBrowser::fContextMenu
TContextMenu * fContextMenu
Definition: TGFileBrowser.h:55
TGComboBox::GetListBox
virtual TGListBox * GetListBox() const
Definition: TGComboBox.h:130
y
Double_t y[n]
Definition: legend1.C:17
TGFileBrowser::GetFilePictures
void GetFilePictures(const TGPicture **pic, Int_t file_type, Bool_t is_link, const char *name)
Determine the file picture for the given file type.
Definition: TGFileBrowser.cxx:534
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
rootdir
const char rootdir[]
Definition: TGFileBrowser.cxx:58
kLHintsExpandY
@ kLHintsExpandY
Definition: TGLayout.h:44
TSystem::ExpandPathName
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
Definition: TSystem.cxx:1272
TGTab::SetTab
virtual Bool_t SetTab(Int_t tabIndex, Bool_t emit=kTRUE)
Brings the composite frame with the index tabIndex to the front and generate the following event if t...
Definition: TGTab.cxx:509
TSystem::Sleep
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
Definition: TSystem.cxx:438
TGClient.h
TGFileBrowser::Update
void Update()
Update content of the list tree.
Definition: TGFileBrowser.cxx:646
TGListTreeItem::GetFirstChild
TGListTreeItem * GetFirstChild() const
Definition: TGListTree.h:74
kPointer
@ kPointer
Definition: GuiTypes.h:374
TClass::IsTObject
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Definition: TClass.cxx:5757
TRemoteObject::GetKeyClassName
const char * GetKeyClassName() const
Definition: TRemoteObject.h:56
TGButton::SetStyle
virtual void SetStyle(UInt_t newstyle)
Set the button style (modern or classic).
Definition: TGButton.cxx:224
TGListTreeItem::SetTipText
virtual void SetTipText(const char *)
Definition: TGListTree.h:92
TGFileBrowser::GotoDir
void GotoDir(const char *path)
Go to the directory "path" and open all the parent list tree items.
Definition: TGFileBrowser.cxx:1655
unsigned int
TGFileBrowser::Add
virtual void Add(TObject *obj, const char *name=0, Int_t check=-1)
Add items to the browser.
Definition: TGFileBrowser.cxx:338
TGComboBox
Definition: TGComboBox.h:67
TGButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:188
TRegexp
Definition: TRegexp.h:31
kHorizontalFrame
@ kHorizontalFrame
Definition: GuiTypes.h:382
TString::Index
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:639
TGFileBrowser::CheckRemote
void CheckRemote(TGListTreeItem *item)
Check if the current list tree item points to a remote object.
Definition: TGFileBrowser.cxx:867
TGFileBrowser::GetObjPicture
void GetObjPicture(const TGPicture **pic, TObject *obj)
Retrieve icons associated with class "name".
Definition: TGFileBrowser.cxx:1583
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TKey
Definition: TKey.h:28
TGFileBrowser::fFilterButton
TGPictureButton * fFilterButton
Definition: TGFileBrowser.h:58
TImage::GetWidth
virtual UInt_t GetWidth() const
Definition: TImage.h:228
TGListTree::GetPathnameFromItem
void GetPathnameFromItem(TGListTreeItem *item, char *path, Int_t depth=0)
Get pathname from item.
Definition: TGListTree.cxx:2406
TGLabel.h
TGFileBrowser::fCachedPic
const TGPicture * fCachedPic
Definition: TGFileBrowser.h:61
TRootBrowser::SetActBrowser
void SetActBrowser(TBrowserImp *b)
Definition: TRootBrowser.h:149
TDirectory::Browse
void Browse(TBrowser *b) override
Browse the content of the directory.
Definition: TDirectory.cxx:216
TGFileBrowser::fDrawOption
TGComboBox * fDrawOption
Definition: TGFileBrowser.h:53
TObject::Draw
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition: TObject.cxx:197
TGFileBrowser::CheckSorted
Bool_t CheckSorted(TGListTreeItem *item, Bool_t but=kFALSE)
Check if the list tree item children are alphabetically sorted.
Definition: TGFileBrowser.cxx:971
kButton1Down
@ kButton1Down
Definition: Buttons.h:23
TString::IsNull
Bool_t IsNull() const
Definition: TString.h:407
TGListTree::SetToolTipItem
void SetToolTipItem(TGListTreeItem *item, const char *string)
Set tooltip text for this item.
Definition: TGListTree.cxx:2085
TQObject::Connect
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition: TQObject.cxx:864
TGFileBrowser::fFileIcon
const TGPicture * fFileIcon
Definition: TGFileBrowser.h:60
TObject::kNotDeleted
@ kNotDeleted
object has not been deleted
Definition: TObject.h:78
TGFileBrowser::AddFSDirectory
void AddFSDirectory(const char *entry, const char *path=0, Option_t *opt="")
Add file system directory in the list tree.
Definition: TGFileBrowser.cxx:731
TGListTreeItem::SetActive
virtual void SetActive(Bool_t)
Definition: TGListTree.h:84
TGPictureButton
Definition: TGButton.h:228
TObjArray.h
kS_IFREG
@ kS_IFREG
Definition: TSystem.h:93
TGFileBrowser::fFilterStr
TString fFilterStr
Definition: TGFileBrowser.h:74
TSystem::UnixPathName
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition: TSystem.cxx:1061
TGFileBrowser::DoubleClicked
void DoubleClicked(TGListTreeItem *item, Int_t btn)
Process double clicks in TGListTree.
Definition: TGFileBrowser.cxx:1201
TGObject::fClient
TGClient * fClient
Definition: TGObject.h:37
TGWindow::GetMainFrame
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Definition: TGWindow.cxx:133
TInterpreter.h
R_ISDIR
Bool_t R_ISDIR(Int_t mode)
Definition: TSystem.h:115
TClass
Definition: TClass.h:80
TGListTreeItem::GetUserData
virtual void * GetUserData() const =0
file
Definition: file.py:1
TGFileBrowser::fFilteredItems
mFiltered_t fFilteredItems
Definition: TGFileBrowser.h:73
TGFileBrowser::fListLevel
TGListTreeItem * fListLevel
Definition: TGFileBrowser.h:50
TGFileBrowser::Selected
void Selected(char *)
A ROOT File has been selected in TGHtmlBrowser.
Definition: TGFileBrowser.cxx:1813
TObject
Definition: TObject.h:37
TGTextEntry.h
TGListTree.h
TImage::GetPixmap
virtual Pixmap_t GetPixmap()
Definition: TImage.h:235
TGFileBrowser::fNewBrowser
TRootBrowser * fNewBrowser
Definition: TGFileBrowser.h:45
TGFileBrowser::fFilter
TRegexp * fFilter
Definition: TGFileBrowser.h:63
name
char name[80]
Definition: TGX11.cxx:110
TGFileBrowser::fCurrentDir
TGListTreeItem * fCurrentDir
Definition: TGFileBrowser.h:51
TGTextLBEntry
Definition: TGListBox.h:83
TGFileBrowser::XXExecuteDefaultAction
Long_t XXExecuteDefaultAction(TObject *obj)
Execute default action for selected object (action is specified in the $HOME/.root....
Definition: TGFileBrowser.cxx:1512
kDeepCleanup
@ kDeepCleanup
Definition: TGFrame.h:51
TObjArray::IsEmpty
Bool_t IsEmpty() const
Definition: TObjArray.h:71
TGListTreeItem::GetNextSibling
TGListTreeItem * GetNextSibling() const
Definition: TGListTree.h:77
TGFileBrowser::fFileType
TGComboBox * fFileType
Definition: TGFileBrowser.h:54
TGFrameElement
Definition: TGLayout.h:112
TRemoteObject::GetClassName
const char * GetClassName() const
Definition: TRemoteObject.h:54
TDirectory
Definition: TDirectory.h:40
TGTextEntry::GetText
const char * GetText() const
Definition: TGTextEntry.h:134
TSystem::ConcatFileName
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
Definition: TSystem.cxx:1069
gPad
#define gPad
Definition: TVirtualPad.h:287
TIter
Definition: TCollection.h:233
TBrowser::SetDrawOption
void SetDrawOption(Option_t *option="")
Set drawing option for object.
Definition: TBrowser.h:103
TGInputDialog
Definition: TGInputDialog.h:29
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:43
TImage::SetImage
virtual void SetImage(const Double_t *, UInt_t, UInt_t, TImagePalette *=0)
Definition: TImage.h:116
TGFileBrowser::fNKeys
Long_t fNKeys
Definition: TGFileBrowser.h:67
TGCompositeFrame::SetCleanup
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1057
TGTextLBEntry::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TGListBox.h:116
TGTab::GetNumberOfTabs
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition: TGTab.cxx:660
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:53
TVirtualPadEditor
Definition: TVirtualPadEditor.h:27
type
int type
Definition: TGX11.cxx:121
TGFileBrowser::sLTI_i
sLTI_t::iterator sLTI_i
Definition: TGFileBrowser.h:40
TKey.h
TGFileBrowser::fRootDir
TGListTreeItem * fRootDir
Definition: TGFileBrowser.h:52
Class
void Class()
Definition: Class.C:29
TString::ToLower
void ToLower()
Change string to lower-case.
Definition: TString.cxx:1125
TGTab::GetTabTab
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
Definition: TGTab.cxx:614
TGFileBrowser::DirName
TString DirName(TGListTreeItem *item)
returns the directory path
Definition: TGFileBrowser.cxx:1114
TGCompositeFrame
Definition: TGFrame.h:324
TGCanvas
Definition: TGCanvas.h:202
TSystem::GetFsInfo
virtual int GetFsInfo(const char *path, Long_t *id, Long_t *bsize, Long_t *blocks, Long_t *bfree)
Get info about a file system: fs type, block size, number of blocks, number of free blocks.
Definition: TSystem.cxx:1470
TGListTreeItem
Definition: TGListTree.h:43
TGFileBrowser::fDir
TSystemDirectory * fDir
Definition: TGFileBrowser.h:64
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1102
IsTextFile
static Bool_t IsTextFile(const char *candidate)
Returns true if given a text file Uses the specification given on p86 of the Camel book.
Definition: TGFileBrowser.cxx:1138
TObject::IsFolder
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: TObject.cxx:475
TGListTree::RecursiveDeleteItem
Int_t RecursiveDeleteItem(TGListTreeItem *item, void *userData)
Delete item with fUserData == ptr.
Definition: TGListTree.cxx:2065
TGListTreeItem::SetPictures
virtual void SetPictures(const TGPicture *, const TGPicture *)
Definition: TGListTree.h:98
TGFileBrowser::Chdir
void Chdir(TGListTreeItem *item)
Make object associated with item the current directory.
Definition: TGFileBrowser.cxx:849
TGListTree::OpenItem
void OpenItem(TGListTreeItem *item)
Open item in list tree (i.e. show child items).
Definition: TGListTree.cxx:2040
TGListTreeItem::GetParent
TGListTreeItem * GetParent() const
Definition: TGListTree.h:73
TGedEditor
Definition: TGedEditor.h:41
TGListTreeItem::Rename
void Rename(const char *new_name)
Definition: TGListTree.h:86
TGFileBrowser::FullPathName
TString FullPathName(TGListTreeItem *item)
returns an absolute path
Definition: TGFileBrowser.cxx:1086
TList
Definition: TList.h:44
FormatToolTip
static const char * FormatToolTip(TObject *obj, Int_t maxlen=0)
Format the tooltip information, based on the object passed in argument.
Definition: TGFileBrowser.cxx:287
TApplication::GetAppRemote
TApplication * GetAppRemote() const
Definition: TApplication.h:146
TBrowserImp::fBrowser
TBrowser * fBrowser
Definition: TBrowserImp.h:32
TRemoteObject::GetFileStat
Bool_t GetFileStat(FileStat_t *sbuf)
Get remote file status.
Definition: TRemoteObject.cxx:194
gROOT
#define gROOT
Definition: TROOT.h:406
TImage::kXpm
@ kXpm
Definition: TImage.h:37
int
TRootBrowser
Definition: TRootBrowser.h:53
TGFileBrowser::CheckFiltered
Bool_t CheckFiltered(TGListTreeItem *item, Bool_t but=kFALSE)
Check if there is a filter active on the children of the list tree item.
Definition: TGFileBrowser.cxx:935
TSystem::GetVolumes
virtual TList * GetVolumes(Option_t *) const
Definition: TSystem.h:453