Logo ROOT  
Reference Guide
TRootBrowserLite.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 27/02/98
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, 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//////////////////////////////////////////////////////////////////////////
13// //
14// TRootBrowserLite //
15// //
16// This class creates a ROOT object browser (looking like Windows //
17// Explorer). The widgets used are the new native ROOT GUI widgets. //
18// //
19//////////////////////////////////////////////////////////////////////////
20
21#include "RConfigure.h"
22
23#include "TRootBrowserLite.h"
24#include "TRootApplication.h"
25#include "TGCanvas.h"
26#include "TGMenu.h"
27#include "TGFileDialog.h"
28#include "TGStatusBar.h"
29#include "TGFSComboBox.h"
30#include "TGLabel.h"
31#include "TGButton.h"
32#include "TGListView.h"
33#include "TGListTree.h"
34#include "TGToolBar.h"
35#include "TGSplitter.h"
36#include "TG3DLine.h"
37#include "TGFSContainer.h"
38#include "TGMimeTypes.h"
39#include "TRootHelpDialog.h"
40#include "TGTextEntry.h"
41#include "TGTextEdit.h"
42#include "TGTextEditDialogs.h"
43
44#include "TROOT.h"
45#include "TEnv.h"
46#include "TBrowser.h"
47#include "TApplication.h"
48#include "TFile.h"
49#include "TKey.h"
50#include "TKeyMapFile.h"
51#include "TClass.h"
52#include "TContextMenu.h"
53#include "TSystem.h"
54#include "TSystemDirectory.h"
55#include "TSystemFile.h"
56#include "TRemoteObject.h"
57#include "TInterpreter.h"
58#include "TGuiBuilder.h"
59#include "TImage.h"
60#include "TVirtualPad.h"
61#include "KeySymbols.h"
62#include "THashTable.h"
63#include "TColor.h"
64#include "TObjString.h"
65#include "TGDNDManager.h"
66#include "TBufferFile.h"
67#include "TFolder.h"
68#include "Getline.h"
69#include "TVirtualX.h"
70
71#include "HelpText.h"
72
73#ifdef WIN32
74#include "TWin32SplashThread.h"
75#endif
76
77// Browser menu command ids
89
103
104 kViewArrangeByName, // Arrange submenu
110
113
116
117 kOneLevelUp, // One level up toolbar button
118 kFSComboBox, // File system combobox in toolbar
119
129
130
131//----- Struct for default icons
132
133struct DefaultIcon_t {
134 const char *fPicnamePrefix;
135 const TGPicture *fIcon[2];
136};
137
138#if 0
139static DefaultIcon_t gDefaultIcon[] = {
140 { "folder", { 0, 0 } },
141 { "app", { 0, 0 } },
142 { "doc", { 0, 0 } },
143 { "slink", { 0, 0 } },
144 { "histo", { 0, 0 } },
145 { "object", { 0, 0 } }
146};
147#endif
148
149
150//----- Toolbar stuff...
151
153 { "tb_uplevel.xpm", "Up One Level", kFALSE, kOneLevelUp, 0 },
154 { "", "", kFALSE, -1, 0 },
155 { "tb_bigicons.xpm", "Large Icons", kTRUE, kViewLargeIcons, 0 },
156 { "tb_smicons.xpm", "Small Icons", kTRUE, kViewSmallIcons, 0 },
157 { "tb_list.xpm", "List", kTRUE, kViewList, 0 },
158 { "tb_details.xpm", "Details", kTRUE, kViewDetails, 0 },
159 { "", "", kFALSE, -1, 0 },
160 { "tb_back.xpm", "Back", kFALSE, kHistoryBack, 0 },
161 { "tb_forw.xpm", "Forward", kFALSE, kHistoryForw, 0 },
162 { "tb_refresh.xpm", "Refresh (F5)", kFALSE, kViewRefresh, 0 },
163 { "", "", kFALSE, -1, 0 },
164 { "tb_find.xpm", "Find (Ctrl-F)", kFALSE, kViewFind, 0 },
165 { "", "", kFALSE, -1, 0 },
166 { "macro_t.xpm", "Execute Macro", kFALSE, kViewExec, 0 },
167 { "interrupt.xpm", "Interrupt Macro",kFALSE, kViewInterrupt, 0 },
168 { "filesaveas.xpm", "Save Macro", kFALSE, kViewSave, 0 },
169 { 0, 0, kFALSE, 0, 0 }
170};
171
172
173//----- TGFileDialog file types
174
175static const char *gOpenTypes[] = { "ROOT files", "*.root",
176 "All files", "*",
177 0, 0 };
178
179////////////////////////////////////////////////////////////////////////////////////
180class TRootBrowserHistoryCursor : public TObject {
181public:
182 TGListTreeItem *fItem;
183
184 TRootBrowserHistoryCursor(TGListTreeItem *item) : fItem(item) {}
185 void Print(Option_t *) const { if (fItem) printf("%s\n", fItem->GetText()); }
186};
187
188
189////////////////////////////////////////////////////////////////////////////////////
190class TRootBrowserHistory : public TList {
191public:
192 void RecursiveRemove(TObject *obj) {
193 TRootBrowserHistoryCursor *cur;
194 TIter next(this);
195
196 while ((cur = (TRootBrowserHistoryCursor*)next())) {
197 if (cur->fItem->GetUserData() == obj) {
198 Remove(cur);
199 delete cur;
200 }
201 }
202 }
203
204 void DeleteItem(TGListTreeItem *item) {
205 TRootBrowserHistoryCursor *cur;
206 TIter next(this);
207
208 while ((cur = (TRootBrowserHistoryCursor*)next())) {
209 if (cur->fItem == item) {
210 Remove(cur);
211 delete cur;
212 }
213 }
214 }
215};
216
217
218////////////////////////////////////////////////////////////////////////////////////
219class TRootBrowserCursorSwitcher {
220private:
221 TGWindow *fW1;
222 TGWindow *fW2;
223public:
224 TRootBrowserCursorSwitcher(TGWindow *w1, TGWindow *w2) : fW1(w1), fW2(w2) {
225 if (w1) gVirtualX->SetCursor(w1->GetId(), gVirtualX->CreateCursor(kWatch));
226 if (w2) gVirtualX->SetCursor(w2->GetId(), gVirtualX->CreateCursor(kWatch));
227 }
228 ~TRootBrowserCursorSwitcher() {
229 if (fW1) gVirtualX->SetCursor(fW1->GetId(), gVirtualX->CreateCursor(kPointer));
230 if (fW2) gVirtualX->SetCursor(fW2->GetId(), gVirtualX->CreateCursor(kPointer));
231 }
232};
233
234////////////////////////////////////////////////////////////////////////////////////
235class TIconBoxThumb : public TObject {
236public:
237 TString fName;
238 const TGPicture *fSmall;
239 const TGPicture *fLarge;
240
241 TIconBoxThumb(const char *name, const TGPicture *spic, const TGPicture *pic) {
242 fName = name;
243 fSmall = spic;
244 fLarge = pic;
245 }
246 ULong_t Hash() const { return fName.Hash(); }
247 const char *GetName() const { return fName.Data(); }
248};
249
250
251
252//----- Special ROOT object item (this are items in the icon box, see
253//----- TRootIconBox)
254////////////////////////////////////////////////////////////////////////////////////
255class TRootObjItem : public TGFileItem {
256public:
257 TRootObjItem(const TGWindow *p, const TGPicture *bpic,
258 const TGPicture *spic, TGString *name,
259 TObject *obj, TClass *cl, EListViewMode viewMode = kLVSmallIcons);
260
261 virtual TDNDData *GetDNDData(Atom_t) {
262 TObject *object = 0;
263 if (fObj->IsA() == TKey::Class())
264 object = ((TKey *)fObj)->ReadObj();
265 else
266 object = fObj;
267 if (object) {
268 if (!fBuf) fBuf = new TBufferFile(TBuffer::kWrite);
269 fBuf->WriteObject(object);
270 fDNDData.fData = fBuf->Buffer();
271 fDNDData.fDataLength = fBuf->Length();
272 }
273 fDNDData.fDataType = gVirtualX->InternAtom("application/root", kFALSE);
274 return &fDNDData;
275 }
276
277 virtual Bool_t HandleDNDFinished() {
278 if (GetParent())
279 return ((TGFrame *)GetParent())->HandleDNDFinished();
280 return kFALSE;
281 }
282
283protected:
284 TObject *fObj;
286};
287
288////////////////////////////////////////////////////////////////////////////////
289/// Create an icon box item.
290
291TRootObjItem::TRootObjItem(const TGWindow *p, const TGPicture *bpic,
292 const TGPicture *spic, TGString *name,
293 TObject *obj, TClass *, EListViewMode viewMode) :
294 TGFileItem(p, bpic, 0, spic, 0, name, 0, 0, 0, 0, 0, viewMode)
295{
296 fObj = obj;
297 fDNDData.fData = 0;
298 fDNDData.fDataLength = 0;
299
300 if (fSubnames) {
301 for (Int_t i = 0; fSubnames[i] != 0; ++i) delete fSubnames[i];
302 }
303 delete [] fSubnames;
304 fSubnames = new TGString* [2];
305
306 fSubnames[0] = new TGString(obj->GetTitle());
307
308 fSubnames[1] = 0;
309
310 if (obj->IsA()->HasDefaultConstructor()) {
311 SetDNDSource(kTRUE);
312 }
313 if ((obj->IsA() == TFolder::Class()) ||
314 (obj->IsA() == TClass::Class())) {
315 SetDNDSource(kFALSE);
316 }
317
318 int i;
319 for (i = 0; fSubnames[i] != 0; ++i)
320 ;
321 fCtw = new int[i];
322 for (i = 0; fSubnames[i] != 0; ++i)
323 fCtw[i] = gVirtualX->TextWidth(fFontStruct, fSubnames[i]->GetString(),
324 fSubnames[i]->GetLength());
325}
326
327class TRootIconBox;
328////////////////////////////////////////////////////////////////////////////////////
329class TRootIconList : public TList {
330
331private:
332 TRootIconBox *fIconBox; // iconbox to which list belongs
333 const TGPicture *fPic; // list view icon
334
335public:
336 TRootIconList(TRootIconBox* box = 0);
337 virtual ~TRootIconList();
338 void UpdateName();
339 const char *GetTitle() const { return "ListView Container"; }
340 Bool_t IsFolder() const { return kFALSE; }
341 void Browse(TBrowser *b);
342 const TGPicture *GetPicture() const { return fPic; }
343};
344
345////////////////////////////////////////////////////////////////////////////////
346/// constructor
347
348TRootIconList::TRootIconList(TRootIconBox* box)
349{
350 fPic = gClient->GetPicture("listview.xpm");
351 fIconBox = box;
352 fName = "empty";
353}
354
355////////////////////////////////////////////////////////////////////////////////
356/// destructor
357
358TRootIconList::~TRootIconList()
359{
360 gClient->FreePicture(fPic);
361}
362
363////////////////////////////////////////////////////////////////////////////////
364/// composite name
365
366void TRootIconList::UpdateName()
367{
368 if (!First()) return;
369
370 if (fSize==1) {
371 fName = First()->GetName();
372 return;
373 }
374
375 fName = First()->GetName();
376 fName += "-";
377 fName += Last()->GetName();
378}
379
380//----- Special ROOT object container (this is the icon box on the
381//----- right side of the browser)
382////////////////////////////////////////////////////////////////////////////////////
383class TRootIconBox : public TGFileContainer {
384friend class TRootIconList;
385friend class TRootBrowserLite;
386
387private:
388 Bool_t fCheckHeaders; // if true check headers
389 TRootIconList *fCurrentList; //
390 TRootObjItem *fCurrentItem; //
391 Bool_t fGrouped; //
392 TString fCachedPicName; //
393 TList *fGarbage; // garbage for TRootIconList's
394 Int_t fGroupSize; // the total number of items when icon box switched to "global view" mode
395 TGString *fCurrentName; //
396 const TGPicture *fLargeCachedPic; //
397 const TGPicture *fSmallCachedPic; //
398 Bool_t fWasGrouped;
399 TObject *fActiveObject; //
400 Bool_t fIsEmpty;
401 THashTable *fThumbnails; // hash table with thumbnailed pictures
402 Bool_t fAutoThumbnail; //
404
405 void *FindItem(const TString& name,
406 Bool_t direction = kTRUE,
407 Bool_t caseSensitive = kTRUE,
408 Bool_t beginWith = kFALSE);
409 void RemoveGarbage();
410
411public:
413 UInt_t options = kSunkenFrame,
415
416 virtual ~TRootIconBox();
417
418 void AddObjItem(const char *name, TObject *obj, TClass *cl);
419 void GetObjPictures(const TGPicture **pic, const TGPicture **spic,
420 TObject *obj, const char *name);
421 void SetObjHeaders();
422 void Refresh();
423 void RemoveAll();
424 void SetGroupSize(Int_t siz) { fGroupSize = siz; }
425 Int_t GetGroupSize() const { return fGroupSize; }
426 TGFrameElement *FindFrame(Int_t x, Int_t y, Bool_t exclude=kTRUE) { return TGContainer::FindFrame(x,y,exclude); }
427 Bool_t WasGrouped() const { return fWasGrouped; }
428};
429
430////////////////////////////////////////////////////////////////////////////////
431/// Create iconbox containing ROOT objects in browser.
432
433TRootIconBox::TRootIconBox(TRootBrowserLite *browser, TGListView *lv, UInt_t options,
434 ULong_t back) : TGFileContainer(lv, options, back)
435{
436 fListView = lv;
437 fBrowser = browser;
438
439 fCheckHeaders = kTRUE;
440 fTotal = 0;
441 fGarbage = new TList();
442 fCurrentList = 0;
443 fCurrentItem = 0;
444 fGrouped = kFALSE;
445 fGroupSize = 1000;
446 fCurrentName = 0;
447 fWasGrouped = kFALSE;
448 fActiveObject = 0;
449 fIsEmpty = kTRUE;
450 fLargeCachedPic = 0;
451 fSmallCachedPic = 0;
452
453 // Don't use timer HERE (timer is set in TBrowser).
454 StopRefreshTimer();
455 fRefresh = 0;
456 fThumbnails = new THashTable(50);
457 fAutoThumbnail = kTRUE;
458}
459
460////////////////////////////////////////////////////////////////////////////////
461/// destructor
462
463TRootIconBox::~TRootIconBox()
464{
465 RemoveAll();
466 RemoveGarbage();
467 delete fGarbage;
468 delete fThumbnails;
469}
470
471////////////////////////////////////////////////////////////////////////////////
472/// Retrieve icons associated with class "name". Association is made
473/// via the user's ~/.root.mimes file or via $ROOTSYS/etc/root.mimes.
474
475void TRootIconBox::GetObjPictures(const TGPicture **pic, const TGPicture **spic,
476 TObject *obj, const char *name)
477{
478 static TImage *im = 0;
479 if (!im) {
480 im = TImage::Create();
481 }
482
483 TString xpm_magic(name, 3);
484 Bool_t xpm = xpm_magic == "/* ";
485 const char *iconname = xpm ? obj->GetName() : name;
486
487 if (obj->IsA()->InheritsFrom("TGeoVolume")) {
488 iconname = obj->GetIconName() ? obj->GetIconName() : obj->IsA()->GetName();
489 }
490
491 if (fCachedPicName == iconname) {
492 *pic = fLargeCachedPic;
493 *spic = fSmallCachedPic;
494 return;
495 }
496
497 *pic = fClient->GetMimeTypeList()->GetIcon(iconname, kFALSE);
498
499 if (!(*pic) && xpm) {
500 if (im && im->SetImageBuffer((char**)&name, TImage::kXpm)) {
501 *pic = fClient->GetPicturePool()->GetPicture(iconname, im->GetPixmap(),
502 im->GetMask());
503 im->Scale(im->GetWidth()/2, im->GetHeight()/2);
504 *spic = fClient->GetPicturePool()->GetPicture(iconname, im->GetPixmap(),
505 im->GetMask());
506 }
507
508 fClient->GetMimeTypeList()->AddType("[thumbnail]", iconname, iconname, iconname, "->Browse()");
509 return;
510 }
511
512 if (*pic == 0) {
513 if (obj->IsFolder()) {
514 *pic = fFolder_s;
515 } else {
516 *pic = fDoc_s;
517 }
518 }
519 fLargeCachedPic = *pic;
520
521 *spic = fClient->GetMimeTypeList()->GetIcon(iconname, kTRUE);
522
523 if (*spic == 0) {
524 if (obj->IsFolder())
525 *spic = fFolder_t;
526 else
527 *spic = fDoc_t;
528 }
529 fSmallCachedPic = *spic;
530 fCachedPicName = iconname;
531}
532
533////////////////////////////////////////////////////////////////////////////////
534/// delete all TRootIconLists from garbage
535
536void TRootIconBox::RemoveGarbage()
537{
538 TIter next(fGarbage);
539 TList *li;
540
541 while ((li=(TList *)next())) {
542 li->Clear("nodelete");
543 }
544 fGarbage->Delete();
545}
546
547////////////////////////////////////////////////////////////////////////////////
548/// Add object to iconbox. Class is used to get the associated icons
549/// via the mime file (see GetObjPictures()).
550
551void TRootIconBox::AddObjItem(const char *name, TObject *obj, TClass *cl)
552{
553 if (!cl) return;
554
555 Bool_t isSystemFile = kFALSE;
556 TGFileItem *fi;
557 fWasGrouped = kFALSE;
558 const TGPicture *pic = 0;
559 const TGPicture *spic = 0;
560
561 if (obj->InheritsFrom("TRemoteObject")) {
562 // check if the real remote object is a system file or directory
563 TRemoteObject *robj = (TRemoteObject *)obj;
564 if ((TString(robj->GetClassName()) == "TSystemFile") ||
565 (TString(robj->GetClassName()) == "TSystemDirectory"))
566 isSystemFile = kTRUE;
567 }
568
569 if (isSystemFile || obj->IsA() == TSystemFile::Class() ||
570 obj->IsA() == TSystemDirectory::Class()) {
571 if (fCheckHeaders) {
572 if (strcmp(fListView->GetHeader(1), "Attributes")) {
575 if (buttons) {
576 buttons[0]->Connect("Clicked()", "TRootBrowserLite", fBrowser,
577 TString::Format("SetSortMode(=%d)", kViewArrangeByName));
578 buttons[1]->Connect("Clicked()", "TRootBrowserLite", fBrowser,
579 TString::Format("SetSortMode(=%d)", kViewArrangeByType));
580 buttons[2]->Connect("Clicked()", "TRootBrowserLite", fBrowser,
581 TString::Format("SetSortMode(=%d)", kViewArrangeBySize));
582 buttons[5]->Connect("Clicked()", "TRootBrowserLite", fBrowser,
583 TString::Format("SetSortMode(=%d)", kViewArrangeByDate));
584 }
585 }
586 fCheckHeaders = kFALSE;
587 }
588
589 TIconBoxThumb *thumb = 0;
590 char *thumbname = gSystem->ConcatFileName(gSystem->WorkingDirectory(), name);
591 thumb = (TIconBoxThumb *)fThumbnails->FindObject(gSystem->IsAbsoluteFileName(name) ? name :
592 thumbname);
593 delete []thumbname;
594
595 if (thumb) {
596 spic = thumb->fSmall;
597 pic = thumb->fLarge;
598 }
599
600 if (obj->InheritsFrom("TRemoteObject"))
601 // special case for remote object
602 fi = AddRemoteFile(obj, spic, pic);
603 else
604 fi = AddFile(name, spic, pic);
605 if (fi) {
606 fi->SetUserData(obj);
607 if (obj->IsA() == TSystemFile::Class()) {
608 TString str;
609 TDNDData data;
610 str = TString::Format("file://%s/%s\r\n",
612 obj->GetName());
613 data.fData = (void *)str.Data();
614 data.fDataLength = str.Length()+1;
615 data.fDataType = gVirtualX->InternAtom("text/uri-list", kFALSE);
616 fi->SetDNDData(&data);
617 fi->SetDNDSource(kTRUE);
618 }
619 }
620
621 fIsEmpty = kFALSE;
622 return;
623 }
624
625 if (!fCurrentList) {
626 fCurrentList = new TRootIconList(this);
627 fGarbage->Add(fCurrentList);
628 }
629
630 fCurrentList->Add(obj);
631 fCurrentList->UpdateName();
632 fIsEmpty = kFALSE;
633
634 TGFrameElement *el;
635 TIter next(fList);
636 while ((el = (TGFrameElement *) next())) {
637 TGLVEntry *f = (TGLVEntry *) el->fFrame;
638 if (f->GetUserData() == obj) {
639 return;
640 }
641 }
642
643 if (fGrouped && fCurrentItem && (fCurrentList->GetSize()>1)) {
644 fCurrentName->SetString(fCurrentList->GetName());
645 }
646
648
649 if ((fCurrentList->GetSize() < fGroupSize) && !fGrouped) {
650 GetObjPictures(&pic, &spic, obj, obj->GetIconName() ?
651 obj->GetIconName() : cl->GetName());
652
653 if (fCheckHeaders) {
654 if (strcmp(fListView->GetHeader(1), "Title")) {
655 SetObjHeaders();
656 }
657 fCheckHeaders = kFALSE;
658 }
659
660 fi = new TRootObjItem(this, pic, spic, new TGString(name), obj, cl, view);
661
662 fi->SetUserData(obj);
663 AddItem(fi);
664 return;
665 }
666
667 if (fGrouped && (fCurrentList->GetSize()==1)) {
668 fCurrentName = new TGString(fCurrentList->GetName());
669 fCurrentItem = new TRootObjItem(this, fCurrentList->GetPicture(), fCurrentList->GetPicture(),
670 fCurrentName,fCurrentList, TList::Class(), view);
671 fCurrentItem->SetUserData(fCurrentList);
672 AddItem(fCurrentItem);
673 fTotal = fList->GetSize();
674 return;
675 }
676
677 if ((fCurrentList->GetSize()==fGroupSize) && !fGrouped) {
678 fGrouped = kTRUE;
679
680 // clear fList
681 TGFrameElement *el2;
682 TIter nextl(fList);
683
684 while ((el2 = (TGFrameElement *) nextl())) {
685 el2->fFrame->DestroyWindow();
686 delete el2->fFrame;
687 fList->Remove(el2);
688 delete el2;
689 }
690
691 fCurrentName = new TGString(fCurrentList->GetName());
692 fi = new TRootObjItem(this, fCurrentList->GetPicture(), fCurrentList->GetPicture(),
693 fCurrentName, fCurrentList, TList::Class(), view);
694 fi->SetUserData(fCurrentList);
695 AddItem(fi);
696
697 fCurrentList = new TRootIconList(this);
698 fGarbage->Add(fCurrentList);
699 fTotal = 1;
700 return;
701 }
702
703 if ((fCurrentList->GetSize()==fGroupSize) && fGrouped) {
704 fCurrentList = new TRootIconList(this);
705 fGarbage->Add(fCurrentList);
706 return;
707 }
708}
709
710////////////////////////////////////////////////////////////////////////////////
711/// browse icon list
712
713void TRootIconList::Browse(TBrowser *)
714{
715 if (!fIconBox) return;
716
717 TObject *obj;
718 TGFileItem *fi;
719 const TGPicture *pic = 0;
720 const TGPicture *spic = 0;
721 TClass *cl;
723 TKey *key = 0;
724
725 fIconBox->RemoveAll();
726 TObjLink *lnk = FirstLink();
727
728 while (lnk) {
729 obj = lnk->GetObject();
730 lnk = lnk->Next();
731
732 if (obj->IsA() == TKey::Class()) {
733 cl = TClass::GetClass(((TKey *)obj)->GetClassName());
734 key = (TKey *)obj;
735 } else if (obj->IsA() == TKeyMapFile::Class()) {
736 cl = TClass::GetClass(((TKeyMapFile *)obj)->GetTitle());
737 } else if (obj->InheritsFrom("TRemoteObject")) {
738 // special case for remote object: get real object class
739 TRemoteObject *robj = (TRemoteObject *)obj;
740 cl = TClass::GetClass(robj->GetClassName());
741 } else {
742 cl = obj->IsA();
743 }
744
745 name = obj->GetName();
746
747 if (key && obj->IsA() == TKey::Class()) {
748 name += ";";
749 name += key->GetCycle();
750 }
751
752 fIconBox->GetObjPictures(&pic, &spic, obj, obj->GetIconName() ?
753 obj->GetIconName() : cl->GetName());
754
755 fi = new TRootObjItem((const TGWindow*)fIconBox, pic, spic, new TGString(name.Data()),
756 obj, cl, (EListViewMode)fIconBox->GetViewMode());
757 fi->SetUserData(obj);
758 fIconBox->AddItem(fi);
759 fIconBox->fTotal++;
760
761 if (obj==fIconBox->fActiveObject) {
762 fIconBox->ActivateItem((TGFrameElement*)fIconBox->fList->Last());
763 }
764 }
765
766 fIconBox->fGarbage->Remove(this);
767 fIconBox->RemoveGarbage();
768 fIconBox->fGarbage->Add(this); // delete this later
769
770 fIconBox->Refresh();
771 fIconBox->AdjustPosition();
772
773 fIconBox->fWasGrouped = kTRUE;
774}
775
776////////////////////////////////////////////////////////////////////////////////
777/// Find a frame which assosiated object has a name containing a "name" string.
778
779void *TRootIconBox::FindItem(const TString& name, Bool_t direction,
780 Bool_t caseSensitive,Bool_t beginWith)
781{
782 if (!fGrouped) {
783 return TGContainer::FindItem(name, direction, caseSensitive, beginWith);
784 }
785
786 if (name.IsNull()) return 0;
787 int idx = kNPOS;
788
789 TGFrameElement* el = 0;
790 TString str;
792
793 fLastDir = direction;
794 fLastCase = caseSensitive;
795 fLastName = name;
796
797 if (fLastActiveEl) {
798 el = fLastActiveEl;
799
800 if (direction) {
801 el = (TGFrameElement *)fList->After(el);
802 } else {
803 el = (TGFrameElement *)fList->Before(el);
804 }
805 } else {
806 if (direction) el = (TGFrameElement *)fList->First();
807 else el = (TGFrameElement *)fList->Last();
808 }
809
810 TGLVEntry* lv = 0;
811 TObject* obj = 0;
812 TList* li = 0;
813
814 while (el) {
815 lv = (TGLVEntry*)el->fFrame;
816 li = (TList*)lv->GetUserData();
817
818 TIter next(li);
819
820 while ((obj=next())) {
821 str = obj->GetName();
822 idx = str.Index(name,0,cmp);
823
824 if (idx!=kNPOS) {
825 if (beginWith) {
826 if (idx==0) {
827 fActiveObject = obj;
828 return el;
829 }
830 } else {
831 fActiveObject = obj;
832 return el;
833 }
834 }
835 }
836 if (direction) {
837 el = (TGFrameElement *)fList->After(el);
838 } else {
839 el = (TGFrameElement *)fList->Before(el);
840 }
841 }
842 fActiveObject = 0;
843 return 0;
844}
845
846////////////////////////////////////////////////////////////////////////////////
847/// Set list box headers used to display detailed object iformation.
848/// Currently this is only "Name" and "Title".
849
850void TRootIconBox::SetObjHeaders()
851{
854 fListView->SetHeader("Title", kTextLeft, kTextLeft, 1);
855}
856
857////////////////////////////////////////////////////////////////////////////////
858/// Sort icons, and send message to browser with number of objects
859/// in box.
860
861void TRootIconBox::Refresh()
862{
863 // This automatically calls layout
864 Sort(fSortType);
865
866 // Make TRootBrowserLite display total objects in status bar
867 SendMessage(fMsgWindow, MK_MSG(kC_CONTAINER, kCT_SELCHANGED), fTotal, fSelected);
868
871}
872
873////////////////////////////////////////////////////////////////////////////////
874/// Remove all items from icon box
875
876void TRootIconBox::RemoveAll()
877{
878 if (fIsEmpty) return;
879
880 fCheckHeaders = kTRUE;
882 fGrouped = kFALSE;
883 fCurrentItem = 0;
884 fCurrentList = 0;
885 fIsEmpty = kTRUE;
886}
887
888
889//_____________________________________________________________________________
890//
891// TRootBrowserLite
892//
893// ROOT object browser (looking like Windows Explorer).
894//_____________________________________________________________________________
895
897
898////////////////////////////////////////////////////////////////////////////////
899/// Create browser with a specified width and height.
900
902 : TGMainFrame(gClient->GetDefaultRoot(), width, height), TBrowserImp(b)
903{
905
906 Resize(width, height);
907 if (b) Show();
908}
909
910////////////////////////////////////////////////////////////////////////////////
911/// Create browser with a specified width and height and at position x, y.
912
914 UInt_t width, UInt_t height)
915 : TGMainFrame(gClient->GetDefaultRoot(), width, height), TBrowserImp(b)
916{
918
919 MoveResize(x, y, width, height);
920 SetWMPosition(x, y);
921 if (b) Show();
922}
923
924////////////////////////////////////////////////////////////////////////////////
925/// Browser destructor.
926
928{
929 if (fIconPic) gClient->FreePicture(fIconPic);
930
931 delete fToolBarSep;
932
933 fToolBar->Cleanup();
934 delete fToolBar;
935 delete fStatusBar;
936 delete fV1;
937 delete fV2;
938 delete fLbl1;
939 delete fLbl2;
940 delete fHf;
941 delete fTreeHdr;
942 delete fListHdr;
943 delete fIconBox;
944 delete fListView;
945 delete fLt;
946 delete fTreeView;
947
948 delete fMenuBar;
949 delete fFileMenu;
950 delete fViewMenu;
951 delete fOptionMenu;
952 delete fHelpMenu;
953 delete fSortMenu;
954
955 delete fMenuBarLayout;
956 delete fMenuBarItemLayout;
957 delete fMenuBarHelpLayout;
958 delete fBarLayout;
959
960 delete fTextEdit;
961
962 if (fWidgets) fWidgets->Delete();
963 delete fWidgets;
964
965 fHistory->Delete();
966 delete fHistory;
967}
968
969////////////////////////////////////////////////////////////////////////////////
970/// Create the actual browser.
971
973{
974 fWidgets = new TList;
975 fHistory = new TRootBrowserHistory;
976 fHistoryCursor = 0;
978
979 // Create menus
981 fFileMenu->AddEntry("&New Browser", kFileNewBrowser);
982 fFileMenu->AddEntry("New Browser &Lite", kFileNewBrowserLite);
983 fFileMenu->AddEntry("New Canvas", kFileNewCanvas);
984 fFileMenu->AddEntry("&Gui Builder", kFileNewBuilder);
985 fFileMenu->AddEntry("&Open...", kFileOpen);
987 fFileMenu->AddEntry("&Save", kFileSave);
988 fFileMenu->AddEntry("Save &As...", kFileSaveAs);
990 fFileMenu->AddEntry("&Print...", kFilePrint);
992 fFileMenu->AddEntry("&Close Browser", kFileCloseBrowser);
994 fFileMenu->AddEntry("&Quit ROOT", kFileQuit);
995
996 //fFileMenu->DefaultEntry(kFileNewCanvas);
1000
1007 fSortMenu->AddEntry("&Auto Arrange", kViewArrangeAuto);
1008
1010
1012 fViewMenu->AddEntry("&Toolbar", kViewToolBar);
1013 fViewMenu->AddEntry("Status &Bar", kViewStatusBar);
1015 fViewMenu->AddEntry("Lar&ge Icons", kViewLargeIcons);
1016 fViewMenu->AddEntry("S&mall Icons", kViewSmallIcons);
1017 fViewMenu->AddEntry("&List", kViewList);
1018 fViewMenu->AddEntry("&Details", kViewDetails);
1020 fViewMenu->AddEntry("Show &Hidden", kViewHidden);
1021 fViewMenu->AddPopup("Arrange &Icons", fSortMenu);
1022 fViewMenu->AddEntry("Lin&e up Icons", kViewLineUp);
1023 fViewMenu->AddEntry("&Group Icons", kViewGroupLV);
1024
1026 fViewMenu->AddEntry("&Refresh (F5)", kViewRefresh);
1027
1030
1031 if (fBrowser) {
1032 if (gEnv->GetValue("Browser.ShowHidden", 0)) {
1035 } else {
1038 }
1039 }
1040
1042 fOptionMenu->AddEntry("&Show Cycles", kOptionShowCycles);
1043 fOptionMenu->AddEntry("&AutoThumbnail", kOptionAutoThumbnail);
1044
1046 fHelpMenu->AddEntry("&About ROOT...", kHelpAbout);
1048 fHelpMenu->AddEntry("Help On Browser...", kHelpOnBrowser);
1049 fHelpMenu->AddEntry("Help On Canvas...", kHelpOnCanvas);
1050 fHelpMenu->AddEntry("Help On Menus...", kHelpOnMenus);
1051 fHelpMenu->AddEntry("Help On Graphics Editor...", kHelpOnGraphicsEd);
1052 fHelpMenu->AddEntry("Help On Objects...", kHelpOnObjects);
1053 fHelpMenu->AddEntry("Help On PostScript...", kHelpOnPS);
1054 fHelpMenu->AddEntry("Help On Remote Session...", kHelpOnRemote);
1055
1056 // This main frame will process the menu commands
1057 fFileMenu->Associate(this);
1058 fViewMenu->Associate(this);
1059 fSortMenu->Associate(this);
1060 fOptionMenu->Associate(this);
1061 fHelpMenu->Associate(this);
1062
1063 // Create menubar layout hints
1067
1068 // Create menubar
1069 fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
1074
1076
1077 // Create toolbar and separator
1078
1079 fToolBarSep = new TGHorizontal3DLine(this);
1080 fToolBar = new TGToolBar(this, 60, 20, kHorizontalFrame);
1082
1086 fFSComboBox->Associate(this);
1087
1088 int spacing = 8;
1089
1090 for (int i = 0; gToolBarData[i].fPixmap; i++) {
1091 if (strlen(gToolBarData[i].fPixmap) == 0) {
1092 spacing = 8;
1093 continue;
1094 }
1095 fToolBar->AddButton(this, &gToolBarData[i], spacing);
1096 spacing = 0;
1097 }
1098
1099 fDrawOption = new TGComboBox(fToolBar, "");
1100 TGTextEntry *dropt_entry = fDrawOption->GetTextEntry();
1101 dropt_entry->SetToolTipText("Object Draw Option", 300);
1102 fDrawOption->Resize(80, 10);
1104 lb->Resize(lb->GetWidth(), 120);
1105 Int_t dropt = 1;
1106 fDrawOption->AddEntry("", dropt++);
1107 fDrawOption->AddEntry("same", dropt++);
1108 fDrawOption->AddEntry("box", dropt++);
1109 fDrawOption->AddEntry("lego", dropt++);
1110 fDrawOption->AddEntry("colz", dropt++);
1111 fDrawOption->AddEntry("alp", dropt++);
1112 fDrawOption->AddEntry("text", dropt++);
1113
1115 fToolBar->AddFrame(new TGLabel(fToolBar,"Option"),
1116 new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2,2,2,0));
1117
1121
1122 // Create panes
1123
1124 fHf = new TGHorizontalFrame(this, 10, 10);
1125
1126 fV1 = new TGVerticalFrame(fHf, 10, 10, kFixedWidth);
1127 fV2 = new TGVerticalFrame(fHf, 10, 10);
1128 fTreeHdr = new TGCompositeFrame(fV1, 10, 10, kSunkenFrame);
1129 fListHdr = new TGCompositeFrame(fV2, 10, 10, kSunkenFrame);
1130
1131 fLbl1 = new TGLabel(fTreeHdr, "All Folders");
1132 fLbl2 = new TGLabel(fListHdr, "Contents of \".\"");
1133
1134 TGLayoutHints *lo;
1135
1136 lo = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 0, 0, 0);
1137 fWidgets->Add(lo);
1138 fTreeHdr->AddFrame(fLbl1, lo);
1139 fListHdr->AddFrame(fLbl2, lo);
1140
1141 lo = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0, 0, 1, 2);
1142 fWidgets->Add(lo);
1143 fV1->AddFrame(fTreeHdr, lo);
1144 fV2->AddFrame(fListHdr, lo);
1145
1147
1149 fWidgets->Add(lo);
1150 fHf->AddFrame(fV1, lo);
1151
1153 splitter->SetFrame(fV1, kTRUE);
1156 fWidgets->Add(lo);
1157 fHf->AddFrame(splitter, lo);
1158
1160 fWidgets->Add(lo);
1161 fHf->AddFrame(fV2, lo);
1162
1163 // Create tree
1164 fTreeView = new TGCanvas(fV1, 10, 10, kSunkenFrame | kDoubleBorder); // canvas
1166 fLt->Associate(this);
1167 fLt->SetAutoTips();
1168
1172
1173 // Create list view (icon box)
1174 fListView = new TGListView(fV2, 520, 250); // canvas
1175 // container
1177 fIconBox->Associate(this);
1178 fListView->SetIncrements(1, 19); // set vertical scroll one line height at a time
1180
1181 TString str = gEnv->GetValue("Browser.AutoThumbnail", "yes");
1182 str.ToLower();
1183 fIconBox->fAutoThumbnail = (str == "yes") || atoi(str.Data());
1186
1187 str = gEnv->GetValue("Browser.GroupView", "10000");
1188 Int_t igv = atoi(str.Data());
1189
1190 if (igv>10) {
1192 fIconBox->SetGroupSize(igv);
1193 }
1194
1195 // reuse lo from "create tree"
1197
1198 AddFrame(fHf, lo);
1199
1200 // Statusbar
1201
1202 int parts[] = { 26, 74 };
1203 fStatusBar = new TGStatusBar(this, 60, 10);
1204 fStatusBar->SetParts(parts, 2);
1205 lo = new TGLayoutHints(kLHintsBottom | kLHintsExpandX, 0, 0, 3, 0);
1206 AddFrame(fStatusBar, lo);
1207
1208 fTextEdit = 0;
1209
1210 // Misc
1211 TString bname(name);
1212 bname.Prepend("Old ");
1213 SetWindowName(bname.Data());
1214 SetIconName(bname.Data());
1215 fIconPic = SetIconPixmap("rootdb_s.xpm");
1216 SetClassHints("ROOT", "Browser");
1217
1218 SetWMSizeHints(600, 350, 10000, 10000, 2, 2);
1219
1220 fListLevel = 0;
1221 fTreeLock = kFALSE;
1222
1223 gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Escape), 0, kTRUE);
1224 gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_F5), 0, kTRUE);
1225 gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Right), kKeyMod1Mask, kTRUE);
1226 gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Left), kKeyMod1Mask, kTRUE);
1227 ClearHistory();
1229
1230 gVirtualX->SetDNDAware(fId, fDNDTypeList);
1231 MapSubwindows();
1232 SetDefaults();
1233 Resize();
1235
1236 printf("\n You are using the old ROOT browser! A new version is available. To use it:\n");
1237 printf(" Select the \"New Browser\" entry from the \"File\" menu in the browser, or change\n");
1238 printf(" \"Browser.Name:\" from \"TRootBrowserLite\" to \"TRootBrowser\" in system.rootrc\n\n");
1239
1240 Connect(fLt, "Checked(TObject*, Bool_t)", "TRootBrowserLite",
1241 this, "Checked(TObject *,Bool_t)");
1242}
1243
1244////////////////////////////////////////////////////////////////////////////////
1245/// handle keys
1246
1248{
1249 if (event->fType == kGKeyPress) {
1250 UInt_t keysym;
1251 char input[10];
1252 gVirtualX->LookupString(event, input, sizeof(input), keysym);
1253
1254 if (!event->fState && (EKeySym)keysym == kKey_F5) {
1255 Refresh(kTRUE);
1256 return kTRUE;
1257 }
1258 if (!event->fState && (EKeySym)keysym == kKey_Escape) {
1260 }
1261
1262 if (event->fState & kKeyMod1Mask) {
1263 switch ((EKeySym)keysym & ~0x20) {
1264 case kKey_Right:
1266 return kTRUE;
1267 case kKey_Left:
1269 return kTRUE;
1270 default:
1271 break;
1272 }
1273 }
1274 }
1275 return TGMainFrame::HandleKey(event);
1276}
1277
1278////////////////////////////////////////////////////////////////////////////////
1279/// Add items to the browser. This function has to be called
1280/// by the Browse() member function of objects when they are
1281/// called by a browser. If check < 0 (default) no check box is drawn,
1282/// if 0 then unchecked checkbox is added, if 1 checked checkbox is added.
1283
1284void TRootBrowserLite::Add(TObject *obj, const char *name, Int_t check)
1285{
1286 if (!obj)
1287 return;
1288 if (obj->InheritsFrom("TObjectSpy"))
1289 return;
1290 if (!name) name = obj->GetName();
1291
1292 AddToBox(obj, name);
1293 if (check > -1) {
1294 TGFrameElement *el;
1295 TIter next(fIconBox->fList);
1296 if (!obj->IsFolder()) {
1297 while ((el = (TGFrameElement *) next())) {
1298 TGLVEntry *f = (TGLVEntry *) el->fFrame;
1299 if (f->GetUserData() == obj) {
1300 f->SetCheckedEntry(check);
1301 }
1302 }
1303 }
1304 }
1305
1306 // Don't show current dir and up dir links in the tree
1307 if (name[0] == '.' && ((name[1] == '\0') || (name[1] == '.' && name[2] == '\0')))
1308 return;
1309
1310 if (obj->IsFolder())
1311 AddToTree(obj, name, check);
1312}
1313
1314////////////////////////////////////////////////////////////////////////////////
1315/// Add a checkbox in the TGListTreeItem corresponding to obj
1316/// and a checkmark on TGLVEntry if check = kTRUE.
1317
1319{
1320 if (obj) {
1322 while (item) {
1323 fLt->SetCheckBox(item, kTRUE);
1324 fLt->CheckItem(item, check);
1325 item = fLt->FindItemByObj(item->GetNextSibling(), obj);
1326 }
1327 TGFrameElement *el;
1328 TIter next(fIconBox->fList);
1329 while ((el = (TGFrameElement *) next())) {
1330 TGLVEntry *f = (TGLVEntry *) el->fFrame;
1331 if (f->GetUserData() == obj) {
1332 f->SetCheckedEntry(check);
1333 }
1334 }
1335 }
1336}
1337
1338////////////////////////////////////////////////////////////////////////////////
1339/// Check / uncheck the TGListTreeItem corresponding to this
1340/// object and add a checkmark on TGLVEntry if check = kTRUE.
1341
1343{
1344 if (obj) {
1346 while (item) {
1347 fLt->CheckItem(item, check);
1348 item = fLt->FindItemByObj(item->GetNextSibling(), obj);
1349 TGFrameElement *el;
1350 TIter next(fIconBox->fList);
1351 if (!obj->IsFolder()) {
1352 while ((el = (TGFrameElement *) next())) {
1353 TGLVEntry *f = (TGLVEntry *) el->fFrame;
1354 if (f->GetUserData() == obj) {
1355 f->SetCheckedEntry(check);
1356 }
1357 }
1358 }
1359 }
1360 }
1361}
1362
1363////////////////////////////////////////////////////////////////////////////////
1364/// Remove checkbox from TGListTree and checkmark from TGListView.
1365
1367{
1368 if (obj) {
1370 while (item) {
1371 fLt->SetCheckBox(item, kFALSE);
1372 item = fLt->FindItemByObj(item->GetNextSibling(), obj);
1373 TGFrameElement *el;
1374 TIter next(fIconBox->fList);
1375 if (!obj->IsFolder()) {
1376 while ((el = (TGFrameElement *) next())) {
1377 TGLVEntry *f = (TGLVEntry *) el->fFrame;
1378 if (f->GetUserData() == obj) {
1379 f->SetCheckedEntry(kFALSE);
1380 }
1381 }
1382 }
1383 }
1384 }
1385}
1386
1387////////////////////////////////////////////////////////////////////////////////
1388/// Add items to the iconbox of the browser.
1389
1391{
1392 if (obj) {
1393 if (!name) name = obj->GetName() ? obj->GetName() : "NoName";
1394 //const char *titlePtr = obj->GetTitle() ? obj->GetTitle() : " ";
1395
1396 TClass *objClass = 0;
1397
1398 if (obj->IsA() == TKey::Class())
1399 objClass = TClass::GetClass(((TKey *)obj)->GetClassName());
1400 else if (obj->IsA() == TKeyMapFile::Class())
1401 objClass = TClass::GetClass(((TKeyMapFile *)obj)->GetTitle());
1402 else if (obj->InheritsFrom("TRemoteObject")) {
1403 // special case for remote object: get real object class
1404 TRemoteObject *robj = (TRemoteObject *)obj;
1405 if (!strcmp(robj->GetClassName(), "TKey"))
1406 objClass = TClass::GetClass(robj->GetKeyClassName());
1407 else
1408 objClass = TClass::GetClass(robj->GetClassName());
1409 }
1410 else
1411 objClass = obj->IsA();
1412
1413 fIconBox->AddObjItem(name, obj, objClass);
1414 }
1415}
1416
1417////////////////////////////////////////////////////////////////////////////////
1418/// Add items to the current TGListTree of the browser.
1419
1420void TRootBrowserLite::AddToTree(TObject *obj, const char *name, Int_t check)
1421{
1422 if (!obj)
1423 return;
1424 if (obj->InheritsFrom("TApplication"))
1425 fListLevel = 0;
1426 if (!fTreeLock) {
1427 if (!name) name = obj->GetName();
1428 if (name[0] == '.' && name[1] == '.')
1429 Info("AddToTree", "up one level %s", name);
1430 if(check > -1) {
1431 TGListTreeItem *item = fLt->AddItem(fListLevel, name, obj, 0, 0, kTRUE);
1432 if (item) fLt->CheckItem(item, (Bool_t)check);
1433 TString tip(obj->ClassName());
1434 if (obj->GetTitle()) {
1435 tip += " ";
1436 tip += obj->GetTitle();
1437 }
1438 fLt->SetToolTipItem(item, tip.Data());
1439 } else {
1440 // special case for remote object
1441 if (obj->InheritsFrom("TRemoteObject")) {
1442 // Nothing to do
1443 } else if (fListLevel) {
1444 // check also if one of its parents is a remote object
1446 while (top->GetParent()) {
1447 TObject *tobj = (TObject *) top->GetUserData();
1448 if (tobj && (tobj->InheritsFrom("TRemoteObject") ||
1449 tobj->InheritsFrom("TApplicationRemote"))) {
1450 break;
1451 }
1452 top = top->GetParent();
1453 }
1454 }
1455 // add the object only if not already in the list
1456 if ((!fLt->FindChildByName(fListLevel, name)) &&
1457 (!fLt->FindChildByData(fListLevel, obj))) {
1459 Long64_t bsize, fsize, objsize = 0;
1460 TString objinfo = obj->GetObjectInfo(1, 1);
1461 TString infos = obj->GetName();
1462 infos += "\n";
1463 infos += obj->GetTitle();
1464 if (!objinfo.IsNull() && !objinfo.BeginsWith("x=")) {
1465 objsize = objinfo.Atoll();
1466 if (objsize > 0) {
1467 infos += "\n";
1468 bsize = fsize = objsize;
1469 if (fsize > 1024) {
1470 fsize /= 1024;
1471 if (fsize > 1024) {
1472 // 3.7MB is more informative than just 3MB
1473 infos += TString::Format("Size: %lld.%lldM", fsize/1024,
1474 (fsize%1024)/103);
1475 } else {
1476 infos += TString::Format("Size: %lld.%lldK", bsize/1024,
1477 (bsize%1024)/103);
1478 }
1479 } else {
1480 infos += TString::Format("Size: %lld bytes", bsize);
1481 }
1482 }
1483 }
1484 if (it)
1485 it->SetTipText(infos.Data());
1486 }
1487 }
1488 }
1489}
1490
1491////////////////////////////////////////////////////////////////////////////////
1492/// Browse object. This, in turn, will trigger the calling of
1493/// TRootBrowserLite::Add() which will fill the IconBox and the tree.
1494/// Emits signal "BrowseObj(TObject*)".
1495
1497{
1498 TGPosition pos = fIconBox->GetPagePosition();
1499 Emit("BrowseObj(TObject*)", (Long_t)obj);
1500
1501 if (obj != gROOT) {
1502 if (!fLt->FindItemByObj(fLt->GetFirstItem(), obj)) {
1503 fListLevel = 0;
1504 Add(obj);
1507 if (obj->IsFolder())
1509 fLt->ClearViewPort();
1511 }
1512 }
1513
1514 if (obj->IsFolder()) fIconBox->RemoveAll();
1515 obj->Browse(fBrowser);
1516 if ((fListLevel && obj->IsFolder()) || (!fListLevel && (obj == gROOT))) {
1517 fIconBox->Refresh();
1518 }
1519
1520 if (fBrowser) {
1522 }
1524
1525 fIconBox->SetHsbPosition(pos.fX);
1526 fIconBox->SetVsbPosition(pos.fY);
1527}
1528
1529////////////////////////////////////////////////////////////////////////////////
1530/// add new draw option to the "history"
1531
1533{
1534 TString opt = GetDrawOption();
1537
1538 TIter next(lbc->GetList());
1539 TGFrameElement *el;
1540
1541 while ((el = (TGFrameElement *)next())) {
1542 TGTextLBEntry *lbe = (TGTextLBEntry *)el->fFrame;
1543 if (lbe->GetText()->GetString() == opt) {
1544 return;
1545 }
1546 }
1547
1549 fDrawOption->AddEntry(opt.Data(), nn);
1550 fDrawOption->Select(nn);
1551}
1552
1553////////////////////////////////////////////////////////////////////////////////
1554/// returns pointer to fIconBox object
1555
1557{
1558 return (TGFileContainer*)fIconBox;
1559}
1560
1561////////////////////////////////////////////////////////////////////////////////
1562/// Really delete the browser and the this GUI.
1563
1565{
1567 delete this;
1568}
1569
1570////////////////////////////////////////////////////////////////////////////////
1571/// In case window is closed via WM we get here.
1572
1574{
1575 DeleteWindow();
1576}
1577
1578////////////////////////////////////////////////////////////////////////////////
1579/// Display in statusbar total number of objects and number of
1580/// selected objects in IconBox.
1581
1583{
1584 char tmp[64];
1585 const char *fmt;
1586
1587 if (selected)
1588 fmt = "%d Object%s, %d selected.";
1589 else
1590 fmt = "%d Object%s.";
1591
1592 snprintf(tmp, 64, fmt, total, (total == 1) ? "" : "s", selected);
1593 fStatusBar->SetText(tmp, 0);
1594}
1595
1596////////////////////////////////////////////////////////////////////////////////
1597/// Display current directory in second label, fLbl2.
1598
1600{
1601 char *p, path[1024];
1602
1604 p = path;
1605 while (*p && *(p+1) == '/') ++p;
1606 if (!p[0])
1607 fLbl2->SetText(new TGString("Contents of \".\""));
1608 else
1609 fLbl2->SetText(new TGString(Form("Contents of \"%s\"", p)));
1610 fListHdr->Layout();
1611
1612 // Get full pathname for FS combobox (previously truncated to 12 levels deep)
1614 p = path;
1615 while (*p && *(p+1) == '/') ++p;
1616 fFSComboBox->Update(p);
1617
1618 if (fListLevel) {
1619 // disable/enable up level navigation
1621 TString dirname = gSystem->GetDirName(p);
1622
1624 Bool_t disableUp = dirname == "/";
1625
1626 // normal file directory
1627 if (disableUp && (obj) && (obj->IsA() == TSystemDirectory::Class())) {
1628 disableUp = strlen(p) == 1;
1629 }
1630 btn->SetState(disableUp ? kButtonDisabled : kButtonUp);
1632 }
1633}
1634
1635////////////////////////////////////////////////////////////////////////////////
1636/// Execute default action for selected object (action is specified
1637/// in the $HOME/.root.mimes or $ROOTSYS/etc/root.mimes file.
1638/// Emits signal "ExecuteDefaultAction(TObject*)".
1639
1641{
1642 TRootBrowserCursorSwitcher cursorSwitcher(fIconBox, fLt);
1643 char action[512];
1645 TVirtualPad *wasp = gPad ? (TVirtualPad*)gPad->GetCanvas() : 0;
1646 TFile *wasf = gFile;
1647
1648 // Special case for file system objects...
1649 if (obj->IsA() == TSystemFile::Class() ||
1650 obj->InheritsFrom("TRemoteObject")) {
1651 TString act;
1652 TString ext = obj->GetName();
1653
1654 if (fClient->GetMimeTypeList()->GetAction(obj->GetName(), action)) {
1655 act = action;
1656 act.ReplaceAll("%s", obj->GetName());
1657 gInterpreter->SaveGlobalsContext();
1658
1659 if (act[0] == '!') {
1660 act.Remove(0, 1);
1661 gSystem->Exec(act.Data());
1662 } else {
1663 // special case for remote object: remote process
1664 if (obj->InheritsFrom("TRemoteObject"))
1667 }
1668 Emit("ExecuteDefaultAction(TObject*)", (Long_t)obj);
1669 }
1670
1671 // special case for remote object: browse real object
1672 if (obj->InheritsFrom("TRemoteObject") && ext.EndsWith(".root")) {
1673 TRootBrowserCursorSwitcher cursorSwitcher2(fIconBox, fLt);
1675 gApplication->ProcessLine("((TApplicationServer *)gApplication)->BrowseFile(0);");
1676 Refresh();
1677 }
1678 ////////// new TFile was opened. Add it to the browser /////
1679 if (gFile && (wasf != gFile) && ext.EndsWith(".root")) {
1680 TGListTreeItem *itm = fLt->FindChildByData(0, gROOT->GetListOfFiles());
1681
1682 if (itm) {
1684 fListLevel = itm;
1687 itm = fLt->AddItem(fListLevel, gFile->GetName());
1688 itm->SetUserData(gFile);
1690 return;
1691 }
1692 }
1693
1694 // only valid for local text files
1695 if (!obj->InheritsFrom("TRemoteObject"))
1696 BrowseTextFile(obj->GetName());
1697
1698 /////////////// cache and change file's icon ///////////////////////
1699 TVirtualPad *nowp = gPad ? (TVirtualPad*)gPad->GetCanvas() : 0;
1700
1701 if (fIconBox->fAutoThumbnail && nowp && (nowp != wasp)) {
1702 TSystemFile *sf = (TSystemFile*)obj;
1703 const TGPicture *pic, *spic;
1704
1705 TString path;
1706 if (gSystem->IsAbsoluteFileName(sf->GetName())) {
1707 path = sf->GetName();
1708 } else {
1709 char *buf = gSystem->ConcatFileName(gSystem->WorkingDirectory(), sf->GetName());
1710 path = buf;
1711 delete [] buf;
1712 }
1713
1714 TIconBoxThumb *thumb = (TIconBoxThumb*)fIconBox->fThumbnails->FindObject(path.Data());
1715
1716 if (thumb) {
1717 spic = thumb->fSmall;
1718 pic = thumb->fLarge;
1719 } else {
1720 TImage *img = TImage::Create();
1721 nowp->Modified();
1722 nowp->Update();
1723 img->FromPad(nowp);
1724
1725 if (!img->IsValid()) {
1726 return;
1727 }
1728
1729 static const UInt_t sz = 72;
1730 UInt_t w = sz;
1731 UInt_t h = sz;
1732
1733 auto imgw = img->GetWidth();
1734 auto imgh = img->GetHeight();
1735
1736 if (imgw > imgh) {
1737 h = (imgh*sz) / (imgw > 0 ? imgw : 1);
1738 } else {
1739 w = (imgw*sz) / (imgh > 0 ? imgh : 1);
1740 }
1741
1742 w = (w < 54) ? 54 : w;
1743 h = (h < 54) ? 54 : h;
1744
1745 img->Scale(w, h);
1746 img->Merge(img, "tint"); // contrasting
1747 img->DrawBox(0, 0, w, h, "#ffff00", 1); // yellow frame
1748
1749 pic = fClient->GetPicturePool()->GetPicture(path.Data(), img->GetPixmap(), 0);
1750 img->Scale(w/3, h/3);
1751 spic = fClient->GetPicturePool()->GetPicture(path.Data(), img->GetPixmap(), 0);
1752
1753 thumb = new TIconBoxThumb(path.Data(), spic, pic);
1754 fIconBox->fThumbnails->Add(thumb);
1755 delete img;
1756 }
1757 }
1758 return;
1759 }
1760
1761 // For other objects the default action is still hard coded in
1762 // their Browse() member function.
1763}
1764
1765////////////////////////////////////////////////////////////////////////////////
1766/// Handle menu and other command generated by the user.
1767
1769{
1770 TRootHelpDialog *hd;
1771 TRootBrowserCursorSwitcher *cursorSwitcher = 0;
1772 TDirectory *tdir = 0;
1773 TString cmd;
1774
1775 if (GET_SUBMSG(msg) != kCT_SELCHANGED) {
1776 cursorSwitcher = new TRootBrowserCursorSwitcher(fIconBox, fLt);
1777 }
1778
1779 TObject *obj;
1780 TGListTreeItem *item = 0;
1781
1782 gVirtualX->Update();
1783
1784 switch (GET_MSG(msg)) {
1785
1786 case kC_COMMAND:
1787
1788 switch (GET_SUBMSG(msg)) {
1789
1790 case kCM_BUTTON:
1791 // fallthrough
1792 case kCM_MENU:
1793
1794 switch ((ERootBrowserCommands)parm1) {
1795 // Handle File menu items...
1797 new TBrowser("Browser", "ROOT Object Browser");
1798 break;
1799 case kFileNewBrowser:
1800 gEnv->SetValue("Browser.Name", "TRootBrowser");
1801 new TBrowser();
1802 gEnv->SetValue("Browser.Name", "TRootBrowserLite");
1803 break;
1804 case kFileNewCanvas:
1805 gROOT->MakeDefCanvas();
1806 break;
1807 case kFileNewBuilder:
1809 break;
1810 case kFileOpen:
1811 {
1812 static TString dir(".");
1813 TGFileInfo fi;
1815 fi.SetIniDir(dir);
1816 new TGFileDialog(fClient->GetDefaultRoot(), this,
1817 kFDOpen,&fi);
1818 dir = fi.fIniDir;
1819 if (fi.fMultipleSelection && fi.fFileNamesList) {
1820 TObjString *el;
1821 TIter next(fi.fFileNamesList);
1822 while ((el = (TObjString *) next())) {
1823 new TFile(el->GetString(), "update");
1824 }
1825 }
1826 else if (fi.fFilename) {
1827 new TFile(fi.fFilename, "update");
1828 }
1829 }
1830 break;
1831 case kFileSave:
1832 case kFileSaveAs:
1833 break;
1834 case kFilePrint:
1835 break;
1836 case kFileCloseBrowser:
1838 break;
1839 case kFileQuit:
1841 break;
1842
1843 // Handle View menu items...
1844 case kViewToolBar:
1847 else
1848 ShowToolBar();
1849 break;
1850 case kViewStatusBar:
1853 else
1854 ShowStatusBar();
1855 break;
1856 case kViewLargeIcons:
1857 case kViewSmallIcons:
1858 case kViewList:
1859 case kViewDetails:
1860 SetViewMode((Int_t)parm1);
1861 break;
1862 case kViewHidden:
1866 } else {
1869 }
1870 Refresh(kTRUE);
1871 break;
1872 case kViewArrangeByName:
1873 case kViewArrangeByType:
1874 case kViewArrangeBySize:
1875 case kViewArrangeByDate:
1876 SetSortMode((Int_t)parm1);
1877 break;
1878 case kViewLineUp:
1879 break;
1880 case kViewRefresh:
1881 Refresh(kTRUE);
1882 break;
1883 case kViewGroupLV:
1886 TString gv = gEnv->GetValue("Browser.GroupView", "10000");
1887 Int_t igv = atoi(gv.Data());
1888
1889 if (igv > 10) {
1890 fIconBox->SetGroupSize(igv);
1891 }
1892 } else {
1894 fIconBox->SetGroupSize(10000000); // very large value
1895 }
1896 break;
1897
1898 // Handle Option menu items...
1899 case kOptionShowCycles:
1900 printf("Currently the browser always shows all cycles\n");
1901 break;
1902
1906 fIconBox->fThumbnails->Delete();
1907 fIconBox->fAutoThumbnail = kFALSE;
1908 Refresh(kTRUE);
1909 } else {
1911 fIconBox->fAutoThumbnail = kTRUE;
1912 }
1913 break;
1914
1915 // Handle toolbar button...
1916 case kOneLevelUp:
1917 {
1918 if (fBrowseTextFile) {
1919 HideTextEdit();
1920 break;
1921 }
1922 if (!fListLevel || !fListLevel->IsActive()) break;
1923
1924 if (fListLevel && fIconBox->WasGrouped()) {
1925 if (fListLevel) {
1926 item = fListLevel->GetParent();
1927 if (item) fListLevel = item;
1928 obj = (TObject *) fListLevel->GetUserData();
1930 if (obj) BrowseObj(obj);
1931 }
1932
1934 break;
1935 }
1936 if (fListLevel) item = fListLevel->GetParent();
1937
1938
1939 if (item) {
1940 fListLevel = item;
1941 obj = (TObject *)fListLevel->GetUserData();
1944 if (obj) BrowseObj(obj);
1946 } else {
1947 obj = (TObject *)fListLevel->GetUserData();
1948 if (obj) ToSystemDirectory(gSystem->GetDirName(obj->GetTitle()));
1949 }
1950 break;
1951 }
1952
1953 // toolbar buttons
1954 case kHistoryBack:
1956 break;
1957 case kHistoryForw:
1959 break;
1960
1961 case kViewFind:
1962 Search();
1963 break;
1964
1965 // Handle Help menu items...
1966 case kHelpAbout:
1967 {
1968#ifdef R__UNIX
1969 TString rootx = TROOT::GetBinDir() + "/root -a &";
1970 gSystem->Exec(rootx);
1971#else
1972#ifdef WIN32
1974#else
1975 char str[32];
1976 sprintf(str, "About ROOT %s...", gROOT->GetVersion());
1977 hd = new TRootHelpDialog(this, str, 600, 400);
1978 hd->SetText(gHelpAbout);
1979 hd->Popup();
1980#endif
1981#endif
1982 }
1983 break;
1984 case kHelpOnCanvas:
1985 hd = new TRootHelpDialog(this, "Help on Canvas...", 600, 400);
1986 hd->SetText(gHelpCanvas);
1987 hd->Popup();
1988 break;
1989 case kHelpOnMenus:
1990 hd = new TRootHelpDialog(this, "Help on Menus...", 600, 400);
1992 hd->Popup();
1993 break;
1994 case kHelpOnGraphicsEd:
1995 hd = new TRootHelpDialog(this, "Help on Graphics Editor...", 600, 400);
1997 hd->Popup();
1998 break;
1999 case kHelpOnBrowser:
2000 hd = new TRootHelpDialog(this, "Help on Browser...", 600, 400);
2002 hd->Popup();
2003 break;
2004 case kHelpOnObjects:
2005 hd = new TRootHelpDialog(this, "Help on Objects...", 600, 400);
2006 hd->SetText(gHelpObjects);
2007 hd->Popup();
2008 break;
2009 case kHelpOnPS:
2010 hd = new TRootHelpDialog(this, "Help on PostScript...", 600, 400);
2012 hd->Popup();
2013 break;
2014 case kHelpOnRemote:
2015 hd = new TRootHelpDialog(this, "Help on Browser...", 600, 400);
2016 hd->SetText(gHelpRemote);
2017 hd->Popup();
2018 break;
2019 default:
2020 break;
2021 }
2022 break;
2023 case kCM_COMBOBOX:
2024 if (parm1 == kFSComboBox) {
2026 if (e) {
2027 const char *dirname = e->GetPath()->GetString();
2028 item = fLt->FindItemByPathname(dirname);
2029 if (item) {
2030 fListLevel = item;
2034 } else {
2035 ToSystemDirectory(dirname);
2036 }
2037 }
2038 }
2039 break;
2040 default:
2041 break;
2042 }
2043
2044 break;
2045
2046 case kC_LISTTREE:
2047 switch (GET_SUBMSG(msg)) {
2048
2049 case kCT_ITEMCLICK:
2050 // tell coverity that parm1 is a Long_t, and not an enum (even
2051 // if we compare it with an enum value) and the meaning of
2052 // parm1 depends on GET_MSG(msg) and GET_SUBMSG(msg)
2053 // coverity[mixed_enums]
2054 if (((EMouseButton)parm1 == kButton1) ||
2055 ((EMouseButton)parm1 == kButton3)) {
2056 HideTextEdit();
2057 TGListTreeItem *item2;
2058 TObject *obj2 = 0;
2059 if ((item2 = fLt->GetSelected()) != 0 ) {
2060 ListTreeHighlight(item2);
2061 fStatusBar->SetText("", 1); // clear
2062 }
2063 if (item2 && parm1 == kButton3) {
2064 Int_t x = (Int_t)(parm2 & 0xffff);
2065 Int_t y = (Int_t)((parm2 >> 16) & 0xffff);
2066 obj2 = (TObject *) item2->GetUserData();
2067 if (obj2) {
2068 if (obj2->InheritsFrom("TTree")) {
2069 // if a tree not attached to any directory (e.g. in a TFolder)
2070 // then attach it to the current directory (gDirectory)
2071 cmd = TString::Format("((TTree *)0x%lx)->GetDirectory();",
2072 (ULong_t)obj2);
2073 tdir = (TDirectory *)gROOT->ProcessLine(cmd.Data());
2074 if (!tdir) {
2075 cmd = TString::Format("((TTree *)0x%lx)->SetDirectory(gDirectory);",
2076 (ULong_t)obj2);
2077 gROOT->ProcessLine(cmd.Data());
2078 }
2079 }
2080 fBrowser->GetContextMenu()->Popup(x, y, obj2, fBrowser);
2081 }
2082 }
2085 fListView->Layout();
2086 }
2087 break;
2088
2089 case kCT_ITEMDBLCLICK:
2090 if (parm1 == kButton1) {
2091 if (fBrowseTextFile) {
2092 HideTextEdit();
2093 }
2094 if (fListLevel && fIconBox->WasGrouped()) {
2095 TObject *obj2;
2096 TGListTreeItem *item2;
2097
2098 if (fListLevel) {
2099 item2 = fListLevel->GetParent();
2100 if (item2) fListLevel = item2;
2101
2102 obj2 = (TObject *) fListLevel->GetUserData();
2104 if (obj2) {
2105 BrowseObj(obj2);
2106 }
2107 }
2108 break;
2109 }
2110 }
2111
2112 default:
2113 break;
2114 }
2115 break;
2116
2117 case kC_CONTAINER:
2118 switch (GET_SUBMSG(msg)) {
2119
2120 case kCT_ITEMCLICK:
2121 if (fIconBox->NumSelected() == 1) {
2122 // display title of selected object
2123 TGFileItem *item2;
2124 void *p = 0;
2125 if ((item2 = (TGFileItem *)fIconBox->GetNextSelected(&p)) != 0) {
2126 TObject *obj2 = (TObject *)item2->GetUserData();
2127
2128 TGListTreeItem *itm = 0;
2129 if (!fListLevel) itm = fLt->GetFirstItem();
2130 else itm = fListLevel->GetFirstChild();
2131 //Bool_t found = kFALSE;
2132
2133 while (itm) {
2134 if (itm->GetUserData() == obj2) break;
2135 itm = itm->GetNextSibling();
2136 }
2137
2138 if (itm) {
2139 if ((fListLevel && fListLevel->IsOpen()) || !fListLevel) {
2141 fLt->HighlightItem(itm);
2143 }
2144 }
2145
2146 if (obj2) fStatusBar->SetText(obj2->GetName(), 1);
2147 }
2148 }
2149 if (parm1 == kButton3) {
2150 // show context menu for selected object
2151 if (fIconBox->NumSelected() == 1) {
2152 void *p = 0;
2153 TGFileItem *item2;
2154 if ((item2 = (TGFileItem *) fIconBox->GetNextSelected(&p)) != 0) {
2155 Int_t x = (Int_t)(parm2 & 0xffff);
2156 Int_t y = (Int_t)((parm2 >> 16) & 0xffff);
2157 TObject *obj2 = (TObject *)item2->GetUserData();
2158 if (obj2) {
2159 if (obj2->IsA() == TKey::Class()) {
2160 TKey *key = (TKey*)obj2;
2161 TClass *cl = TClass::GetClass(key->GetClassName());
2162 TString name = key->GetName();
2163 name += ";";
2164 name += key->GetCycle();
2165 //void *add = gROOT->FindObject((char *) name.Data());//key->GetName());
2166 void *add = gDirectory->FindObjectAny((char *) name.Data());
2167 if (cl->IsTObject()) {
2168 obj2 = (TObject*)add; // cl->DynamicCast(TObject::Class(),startadd);
2169 item2->SetUserData(obj2);
2170 } else {
2171 Error("ProcessMessage","do not support non TObject (like %s) yet",
2172 cl->GetName());
2173 break;
2174 }
2175 }
2176 if (obj2 && obj2->InheritsFrom("TTree")) {
2177 // if a tree not attached to any directory (e.g. in a TFolder)
2178 // then attach it to the current directory (gDirectory)
2179 cmd = TString::Format("((TTree *)0x%lx)->GetDirectory();",
2180 (ULong_t)obj2);
2181 tdir = (TDirectory *)gROOT->ProcessLine(cmd.Data());
2182 if (!tdir) {
2183 cmd = TString::Format("((TTree *)0x%lx)->SetDirectory(gDirectory);",
2184 (ULong_t)obj2);
2185 gROOT->ProcessLine(cmd.Data());
2186 }
2187 }
2188 fBrowser->GetContextMenu()->Popup(x, y, obj2, fBrowser);
2189 }
2190 }
2191 }
2192 }
2193 break;
2194 case kCT_ITEMDBLCLICK:
2195 if (parm1 == kButton1) {
2196 if (fIconBox->NumSelected() == 1) {
2197 void *p = 0;
2198 TGFileItem *item2;
2199 if ((item2 = (TGFileItem *) fIconBox->GetNextSelected(&p)) != 0) {
2200 TObject *obj2 = (TObject *)item2->GetUserData();
2201 if (obj2) {
2202 DoubleClicked(obj2);
2203 IconBoxAction(obj2);
2204 }
2205 delete cursorSwitcher;
2206 return kTRUE; //
2207 }
2208 }
2209 }
2210 break;
2211 case kCT_SELCHANGED:
2212 DisplayTotal((Int_t)parm1, (Int_t)parm2);
2213 break;
2214 default:
2215 break;
2216 }
2217
2218 break;
2219
2220 default:
2221 break;
2222 }
2223
2224 delete cursorSwitcher;
2225
2227 return kTRUE;
2228}
2229
2230////////////////////////////////////////////////////////////////////////////////
2231/// Make object associated with item the current directory.
2232
2234{
2235 if (item) {
2236 TGListTreeItem *i = item;
2237 TString dir;
2238 while (i) {
2239 TObject *obj = (TObject*) i->GetUserData();
2240 if (obj) {
2241 if (obj->IsA() == TDirectoryFile::Class()) {
2242 dir = "/" + dir;
2243 dir = obj->GetName() + dir;
2244 }
2245 if (obj->IsA() == TFile::Class()) {
2246 dir = ":/" + dir;
2247 dir = obj->GetName() + dir;
2248 }
2249 if (obj->IsA() == TKey::Class()) {
2250 if (strcmp(((TKey*)obj)->GetClassName(), "TDirectoryFile") == 0) {
2251 dir = "/" + dir;
2252 dir = obj->GetName() + dir;
2253 }
2254 }
2255 }
2256 i = i->GetParent();
2257 }
2258
2259 if (gDirectory && dir.Length()) gDirectory->cd(dir.Data());
2260 }
2261}
2262
2263////////////////////////////////////////////////////////////////////////////////
2264/// helper method to track history
2265
2267{
2268 if (!fListLevel) return;
2269
2272}
2273
2274////////////////////////////////////////////////////////////////////////////////
2275/// helper method to track history
2276
2278{
2280
2281 if (!item || (fHistoryCursor &&
2282 (item == ((TRootBrowserHistoryCursor*)fHistoryCursor)->fItem))) return;
2283
2284 TRootBrowserHistoryCursor *cur = (TRootBrowserHistoryCursor*)fHistoryCursor;
2285
2286 while ((cur = (TRootBrowserHistoryCursor*)fHistory->After(fHistoryCursor))) {
2287 fHistory->Remove(cur);
2288 delete cur;
2289 }
2290
2291 cur = new TRootBrowserHistoryCursor(item);
2292 fHistory->Add(cur);
2293 fHistoryCursor = cur;
2294 btn->SetState(kButtonUp);
2295}
2296
2297////////////////////////////////////////////////////////////////////////////////
2298/// clear navigation history
2299
2301{
2302 fHistory->Delete();
2307}
2308
2309////////////////////////////////////////////////////////////////////////////////
2310/// go to the past
2311
2313{
2314 if (fBrowseTextFile) {
2315 HideTextEdit();
2316 return kFALSE;
2317 }
2318 TRootBrowserHistoryCursor *cur = (TRootBrowserHistoryCursor*)fHistory->Before(fHistoryCursor);
2321
2322 if (!cur) {
2324 return kFALSE;
2325 }
2326
2328 fHistoryCursor = cur;
2329 fListLevel = cur->fItem;
2333
2334 btn2->SetState(kButtonUp);
2335 cur = (TRootBrowserHistoryCursor*)fHistory->Before(fHistoryCursor);
2336 if (!cur) {
2338 return kFALSE;
2339 }
2340
2341 return kTRUE;
2342}
2343
2344////////////////////////////////////////////////////////////////////////////////
2345/// go to the future
2346
2348{
2349 if (fBrowseTextFile) {
2350 HideTextEdit();
2351 return kFALSE;
2352 }
2353
2354 TRootBrowserHistoryCursor *cur = (TRootBrowserHistoryCursor*)fHistory->After(fHistoryCursor);
2357
2358 if (!cur) {
2360 return kFALSE;
2361 }
2362
2364 fHistoryCursor = cur;
2365 fListLevel = cur->fItem;
2369
2370 btn2->SetState(kButtonUp);
2371
2372 cur = (TRootBrowserHistoryCursor*)fHistory->After(fHistoryCursor);
2373 if (!cur) {
2375 return kFALSE;
2376 }
2377
2378 return kTRUE;
2379}
2380
2381////////////////////////////////////////////////////////////////////////////////
2382/// delete list tree item, remove it from history
2383
2385{
2386 ((TRootBrowserHistory*)fHistory)->DeleteItem(item);
2387 fLt->DeleteItem(item);
2388}
2389
2390////////////////////////////////////////////////////////////////////////////////
2391/// Open tree item and list in iconbox its contents.
2392
2394{
2395 if (item) {
2396 TObject *obj = (TObject *) item->GetUserData();
2397
2398 if (obj) {
2399 if (obj->IsA() == TKey::Class()) {
2400
2401 TKey *key = (TKey *)obj;
2402 TString name = obj->GetName();
2403 name += ";";
2404 name += key->GetCycle();
2405 Chdir(item->GetParent());
2406 //TObject *k_obj = gROOT->FindObject(name);
2407 TObject *k_obj = gDirectory->FindObjectAny(name);
2408
2409 if (k_obj) {
2410 item->SetUserData(k_obj);
2411 obj = k_obj;
2412 }
2413 } else if (obj->InheritsFrom(TDirectoryFile::Class())) {
2414 Chdir(item->GetParent());
2415 }
2416 else if (obj->InheritsFrom("TApplicationRemote")) {
2417 if (!gApplication->GetAppRemote()) {
2418 gROOT->ProcessLine(Form(".R %s", item->GetText()));
2419 if (gApplication->GetAppRemote()) {
2420 Getlinem(kInit, TString::Format("\n%s:root [0]",
2422 }
2423 }
2424 }
2425 else if (obj->InheritsFrom("TRemoteObject")) {
2426 // special case for remote object
2427 TRemoteObject *robj = (TRemoteObject *)obj;
2428 // the real object is a TKey
2429 if (!strcmp(robj->GetClassName(), "TKey")) {
2430 TGListTreeItem *parent = item;
2431 TRemoteObject *probj = (TRemoteObject *)parent->GetUserData();
2432 // find the TFile remote object containing the TKey
2433 while ( probj && strcmp(probj->GetClassName(), "TFile")) {
2434 parent = parent->GetParent();
2435 probj = (TRemoteObject *)parent->GetUserData();
2436 }
2437 if (probj) {
2438 // remotely browse file (remotely call TFile::cd())
2441 TString::Format("((TApplicationServer *)gApplication)->BrowseFile(\"%s\");",
2442 probj->GetName()));
2443 }
2444 }
2445 }
2446 if (item->GetParent() && item->GetParent()->GetUserData() &&
2447 ((TObject *)item->GetParent()->GetUserData())->InheritsFrom("TApplicationRemote")) {
2448 // switch to remote session
2449 if (!gApplication->GetAppRemote()) {
2450 gROOT->ProcessLine(Form(".R %s", item->GetParent()->GetText()));
2451 if (gApplication->GetAppRemote()) {
2452 Getlinem(kInit, TString::Format("\n%s:root [0]",
2454 }
2455 }
2456 else if (!strcmp(item->GetText(), "ROOT Files")) {
2457 // update list of files opened in the remote session
2459 gApplication->ProcessLine("((TApplicationServer *)gApplication)->BrowseFile(0);");
2460 }
2461 }
2462 else {
2463 // check if the listtree item is from a local session or
2464 // from a remote session, then switch to the session it belongs to
2465 TGListTreeItem *top = item;
2466 while (top->GetParent()) {
2467 top = top->GetParent();
2468 }
2469 TObject *topobj = (TObject *) top->GetUserData();
2470 if (topobj && topobj->InheritsFrom("TApplicationRemote")) {
2471 // it belongs to a remote session
2472 if (!gApplication->GetAppRemote()) {
2473 // switch to remote session if not already in
2474 gROOT->ProcessLine(Form(".R %s", top->GetText()));
2475 if (gApplication->GetAppRemote()) {
2476 Getlinem(kInit, TString::Format("\n%s:root [0]",
2478 }
2479 }
2480 }
2481 else if (gApplication->GetAppRemote()) {
2482 // switch back to local session if not already in
2484 Getlinem(kInit, "\nroot [0]");
2485 }
2486 }
2487
2488 if (!fListLevel || !fListLevel->IsActive()) {
2489 fListLevel = item;
2490 BrowseObj(obj);
2492 }
2493 }
2495 }
2496}
2497
2498////////////////////////////////////////////////////////////////////////////////
2499/// display directory
2500
2502{
2503 TString dir = dirname;
2504
2505 if (fListLevel) {
2507
2508 if (obj && (obj->IsA() == TSystemDirectory::Class())) {
2509 TObject* old = obj;
2510 fListLevel->Rename(dir.Data());
2511 obj = new TSystemDirectory(dir.Data(), dir.Data());
2512 while (fListLevel->GetFirstChild())
2515
2516 fListLevel->SetUserData(obj);
2517 gROOT->GetListOfBrowsables()->Remove(old);
2518 delete old;
2519 gROOT->GetListOfBrowsables()->Add(obj);
2520 fTreeLock = kTRUE;
2521 BrowseObj(obj);
2522 fTreeLock = kFALSE;
2523
2527 //gSystem->ChangeDirectory(dir.Data());
2528 fStatusBar->SetText(dir.Data(), 1);
2529 ClearHistory(); // clear browsing history
2530 }
2531 }
2532 return;
2533}
2534
2535////////////////////////////////////////////////////////////////////////////////
2536/// sets drawing option
2537
2539{
2540 fDrawOption->GetTextEntry()->SetText(option);
2541}
2542
2543////////////////////////////////////////////////////////////////////////////////
2544/// returns drawing option
2545
2547{
2548 return fDrawOption->GetTextEntry()->GetText();
2549}
2550////////////////////////////////////////////////////////////////////////////////
2551/// Emits signal when double clicking on icon.
2552
2554{
2555 Emit("DoubleClicked(TObject*)", (Long_t)obj);
2556}
2557
2558////////////////////////////////////////////////////////////////////////////////
2559/// Emits signal when double clicking on icon.
2560
2562{
2563 Long_t args[2];
2564
2565 args[0] = (Long_t)obj;
2566 args[1] = checked;
2567
2568 Emit("Checked(TObject*,Bool_t)", args);
2569}
2570
2571////////////////////////////////////////////////////////////////////////////////
2572/// Default action when double clicking on icon.
2573
2575{
2576 Bool_t browsable = kFALSE;
2577 if (obj) {
2578
2579 TRootBrowserCursorSwitcher cursorSwitcher(fIconBox, fLt);
2580
2581 Bool_t useLock = kTRUE;
2582
2583 if (obj->IsA()->GetMethodWithPrototype("Browse", "TBrowser*"))
2584 browsable = kTRUE;
2585
2586 if (obj->InheritsFrom("TLeaf")) {
2587 TObject *dir = (TObject *)gROOT->ProcessLine(Form("((%s *)0x%lx)->GetBranch()->GetDirectory();",
2588 obj->ClassName(), (ULong_t)obj));
2589 if (!dir) {
2590 browsable = kFALSE;
2591 }
2592 }
2593 if (obj->InheritsFrom("TBranchElement")) {
2594 TObject *dir = (TObject *)gROOT->ProcessLine(Form("((%s *)0x%lx)->GetDirectory();",
2595 obj->ClassName(), (ULong_t)obj));
2596 if (!dir) {
2597 browsable = kFALSE;
2598 }
2599 }
2600
2601 if (obj->InheritsFrom("TKey")) {
2602 TKey *key = dynamic_cast<TKey*>(obj);
2603 if (key && key->GetClassName() && (!strcmp(key->GetClassName(), "TFormula")))
2604 browsable = kFALSE;
2605 }
2606
2607 if (obj->IsA() == TSystemDirectory::Class()) {
2608 useLock = kFALSE;
2609
2610 TString t(obj->GetName());
2611 if (t == ".") goto out;
2612 if (t == "..") {
2613 if (fListLevel && fListLevel->GetParent()) {
2615 obj = (TObject*)fListLevel->GetUserData();
2616 if (fListLevel->GetParent()) {
2618 } else {
2619 obj = (TObject*)fListLevel->GetUserData();
2620 fListLevel = 0;
2621 }
2622 } else {
2623 TString dirname = gSystem->GetDirName(gSystem->pwd());
2624 ToSystemDirectory(dirname);
2625 return;
2626 }
2627 }
2628 }
2629
2630 if (obj && obj->IsFolder()) {
2631 fIconBox->RemoveAll();
2632 TGListTreeItem *itm = nullptr;
2633
2634 if (fListLevel) {
2636 itm = fListLevel->GetFirstChild();
2637 } else {
2638 itm = fLt->GetFirstItem();
2639 }
2640
2641 while (itm && (itm->GetUserData() != obj)) {
2642 itm = itm->GetNextSibling();
2643 }
2644
2645 if (!itm && fListLevel) {
2646 // special case for remote objects
2647 Bool_t isRemote = kFALSE;
2648 if (obj->InheritsFrom("TRemoteObject"))
2649 isRemote = kTRUE;
2650 else if (fListLevel) {
2651 // check also if one of its parents is a remote object
2653 while (top->GetParent()) {
2654 TObject *tobj = (TObject *) top->GetUserData();
2655 if (tobj && (tobj->InheritsFrom("TRemoteObject") ||
2656 tobj->InheritsFrom("TApplicationRemote"))) {
2657 isRemote = kTRUE;
2658 break;
2659 }
2660 top = top->GetParent();
2661 }
2662 }
2663 if (isRemote) {
2664 // add the remote object only if not already in the list
2665 if ((!fLt->FindChildByName(fListLevel, obj->GetName())) &&
2666 (!fLt->FindChildByData(fListLevel, obj))) {
2667 itm = fLt->AddItem(fListLevel, obj->GetName());
2668 if (itm) itm->SetUserData(obj);
2669 }
2670 else {
2671 // set the current item to the one found in the list
2672 itm = fLt->FindChildByData(fListLevel, obj) ?
2675 }
2676 }
2677 else {
2678 itm = fLt->AddItem(fListLevel, obj->GetName());
2679 if (itm) itm->SetUserData(obj);
2680 }
2681 }
2682
2683 if (itm) {
2684 fListLevel = itm;
2686 TObject *kobj = (TObject *)itm->GetUserData();
2687
2688 if (kobj && kobj->IsA() == TKey::Class()) {
2690 //kobj = gROOT->FindObject(kobj->GetName());
2691 kobj = gDirectory->FindObjectAny(kobj->GetName());
2692
2693 if (kobj) {
2694 TGListTreeItem *parent = fListLevel->GetParent();
2696 TGListTreeItem *kitem = fLt->AddItem(parent, kobj->GetName(), kobj);
2697 if (kitem) {
2698 obj = kobj;
2699 useLock = kFALSE;
2700 kitem->SetUserData(kobj);
2701 fListLevel = kitem;
2702 } else
2703 fListLevel = parent;
2704 }
2705 }
2707 }
2708 }
2709
2710 if (browsable) {
2711 if (useLock) fTreeLock = kTRUE;
2712 Emit("BrowseObj(TObject*)", (Long_t)obj);
2713 if (obj) obj->Browse(fBrowser);
2714 if (useLock) fTreeLock = kFALSE;
2715 }
2716
2717out:
2718 if (obj && obj->IsA() != TSystemFile::Class()) {
2719 if (obj->IsFolder()) {
2720 fIconBox->Refresh();
2721 }
2722
2723 if (fBrowser) {
2725 }
2726
2729 }
2730 }
2731}
2732
2733////////////////////////////////////////////////////////////////////////////////
2734/// Recursively remove object from browser.
2735
2737{
2738 // don't delete fIconBox items here (it's status will be updated
2739 // via TBrowser::Refresh() which should be called once all objects have
2740 // been removed.
2741
2743 if (item == 0)
2744 return;
2745 if (fListLevel && (item == fListLevel)) {
2746 TGListTreeItem *parent = item->GetParent();
2747 if (parent) {
2748 fListLevel = parent;
2752 }
2753 else
2754 fListLevel = 0;
2755 }
2756 DeleteListTreeItem(item);
2757}
2758
2759////////////////////////////////////////////////////////////////////////////////
2760/// Refresh the browser contents.
2761
2763{
2764 Bool_t refresh = fBrowser && fBrowser->GetRefreshFlag();
2765
2766 if (fTextEdit && !gROOT->IsExecutingMacro() && force) {
2769 return;
2770 }
2771
2772 if ( (refresh || force) && !fIconBox->WasGrouped()
2773 && fIconBox->NumItems()<fIconBox->GetGroupSize() ) {
2774
2775 TRootBrowserCursorSwitcher cursorSwitcher(fIconBox, fLt);
2776 static UInt_t prev = 0;
2777 UInt_t curr = gROOT->GetListOfBrowsables()->GetSize();
2778 if (!prev) prev = curr;
2779
2780 if (prev != curr) { // refresh gROOT
2782 fListLevel = 0;
2784 fListLevel = sav;
2785 prev = curr;
2786 }
2787
2788 // Refresh the IconBox
2789 if (fListLevel) {
2791 if (obj) {
2792 fTreeLock = kTRUE;
2793 BrowseObj(obj);
2794 fTreeLock = kFALSE;
2795 }
2796 }
2797 }
2799}
2800
2801////////////////////////////////////////////////////////////////////////////////
2802/// Show or hide toolbar.
2803
2805{
2806 if (show) {
2810 } else {
2814 }
2815}
2816
2817////////////////////////////////////////////////////////////////////////////////
2818/// Show or hide statusbar.
2819
2821{
2822 if (show) {
2825 } else {
2828 }
2829}
2830
2831////////////////////////////////////////////////////////////////////////////////
2832/// Set defaults depending on settings in the user's .rootrc.
2833
2834void TRootBrowserLite::SetDefaults(const char *iconStyle, const char *sortBy)
2835{
2836 const char *opt;
2837
2838 // IconStyle: big, small, list, details
2839 if (iconStyle)
2840 opt = iconStyle;
2841 else
2842 opt = gEnv->GetValue("Browser.IconStyle", "small");
2843 if (!strcasecmp(opt, "big"))
2845 else if (!strcasecmp(opt, "small"))
2847 else if (!strcasecmp(opt, "list"))
2849 else if (!strcasecmp(opt, "details"))
2851 else
2853
2854 // SortBy: name, type, size, date
2855 if (sortBy)
2856 opt = sortBy;
2857 else
2858 opt = gEnv->GetValue("Browser.SortBy", "name");
2859 if (!strcasecmp(opt, "name"))
2861 else if (!strcasecmp(opt, "type"))
2863 else if (!strcasecmp(opt, "size"))
2865 else if (!strcasecmp(opt, "date"))
2867 else
2869
2870 fIconBox->Refresh();
2871}
2872
2873////////////////////////////////////////////////////////////////////////////////
2874/// Set iconbox's view mode and update menu and toolbar buttons accordingly.
2875
2877{
2878 int i, bnum;
2880
2881 if (force || (fViewMode != new_mode)) {
2882
2883 switch (new_mode) {
2884 default:
2885 if (!force)
2886 return;
2887 else
2888 new_mode = kViewLargeIcons;
2889 // intentionally no break
2890 case kViewLargeIcons:
2891 bnum = 2;
2892 lv = kLVLargeIcons;
2893 break;
2894 case kViewSmallIcons:
2895 bnum = 3;
2896 lv = kLVSmallIcons;
2897 break;
2898 case kViewList:
2899 bnum = 4;
2900 lv = kLVList;
2901 break;
2902 case kViewDetails:
2903 bnum = 5;
2904 lv = kLVDetails;
2905 break;
2906 }
2907
2908 fViewMode = new_mode;
2910
2911 for (i = 2; i <= 5; ++i)
2912 gToolBarData[i].fButton->SetState((i == bnum) ? kButtonEngaged : kButtonUp);
2913
2916 if ((lv == kLVDetails) && (buttons)) {
2917 if (!strcmp(fListView->GetHeader(1), "Attributes")) {
2918 buttons[0]->Connect("Clicked()", "TRootBrowserLite", this,
2919 TString::Format("SetSortMode(=%d)", kViewArrangeByName));
2920 buttons[1]->Connect("Clicked()", "TRootBrowserLite", this,
2921 TString::Format("SetSortMode(=%d)", kViewArrangeByType));
2922 buttons[2]->Connect("Clicked()", "TRootBrowserLite", this,
2923 TString::Format("SetSortMode(=%d)", kViewArrangeBySize));
2924 buttons[5]->Connect("Clicked()", "TRootBrowserLite", this,
2925 TString::Format("SetSortMode(=%d)", kViewArrangeByDate));
2926 }
2927 }
2928 fIconBox->AdjustPosition();
2929 }
2930}
2931
2932////////////////////////////////////////////////////////////////////////////////
2933/// Set iconbox's sort mode and update menu radio buttons accordingly.
2934
2936{
2937 EFSSortMode smode;
2938
2939 switch (new_mode) {
2940 default:
2941 new_mode = kViewArrangeByName;
2942 // intentionally no break
2943 case kViewArrangeByName:
2944 smode = kSortByName;
2945 break;
2946 case kViewArrangeByType:
2947 smode = kSortByType;
2948 break;
2949 case kViewArrangeBySize:
2950 smode = kSortBySize;
2951 break;
2952 case kViewArrangeByDate:
2953 smode = kSortByDate;
2954 break;
2955 }
2956
2957 fSortMode = new_mode;
2959
2960 fIconBox->Sort(smode);
2961}
2962
2963////////////////////////////////////////////////////////////////////////////////
2964/// starts serach dialog
2965
2967{
2968 if (!fTextEdit) {
2969 fIconBox->Search(kFALSE);
2970 } else {
2972 }
2973}
2974
2975////////////////////////////////////////////////////////////////////////////////
2976/// test
2977
2978static Bool_t isBinary(const char *str, int len)
2979{
2980 for (int i = 0; i < len; i++) {
2981 char c = str[i];
2982 if (((c < 32) || (c > 126)) && (c != '\t') && (c != '\r') && (c != '\n')) {
2983 return kTRUE;
2984 }
2985 }
2986 return kFALSE;
2987}
2988
2989////////////////////////////////////////////////////////////////////////////////
2990/// hide text edit
2991
2993{
2994 if (!fTextEdit) return;
2995
3001 savbtn->Disconnect();
3003 delete fTextEdit;
3004 fTextEdit = 0;
3006 fV2->MapSubwindows();
3007 fV2->Layout();
3009 fTextFileName = "";
3010}
3011
3012////////////////////////////////////////////////////////////////////////////////
3013/// browse text file
3014
3016{
3017 Bool_t loaded = (fTextEdit != 0);
3019 if (loaded) {
3021 }
3022 return;
3023 }
3024 const int bufferSize = 1024;
3025 char buffer[bufferSize];
3026
3027 FILE *fd = fopen(file, "rb");
3028 if (fd == 0) {
3029 if (loaded) {
3031 }
3032 return;
3033 }
3034 int sz = fread(buffer, 1, bufferSize, fd);
3035 fclose(fd);
3036
3037 if ((sz > 0) && isBinary(buffer, sz)) {
3038 if (loaded) {
3040 }
3041 return;
3042 }
3043
3044 if (!fTextEdit) {
3047 TColor *col = gROOT->GetColor(19);
3048 if (col)
3051 TGSearchDialog::SearchDialog()->Connect("TextEntered(char *)", "TGTextEdit",
3052 fTextEdit, "Search(char *,Bool_t,Bool_t)");
3053 }
3056 savbtn->Connect("Released()", "TGTextEdit", fTextEdit, "SaveFile(=0,kTRUE)");
3057 }
3060 if (loaded) return;
3061
3062 if (fTextFileName.EndsWith(".C")) {
3064 } else {
3066 }
3070 fV2->MapSubwindows();
3071 fV2->Layout();
3073
3074 if (fListLevel) {
3076 }
3078
3079 if (btn) {
3081 }
3082
3084
3085 if (btn2) {
3086 btn2->SetState(kButtonUp);
3087 }
3088}
3089
3090////////////////////////////////////////////////////////////////////////////////
3091/// executed browsed text macro
3092
3094{
3095 char *tmpfile = gSystem->ConcatFileName(gSystem->TempDirectory(),
3097
3098 gROOT->SetExecutingMacro(kTRUE);
3099 fTextEdit->SaveFile(tmpfile, kFALSE);
3100 gROOT->Macro(tmpfile);
3101 gSystem->Unlink(tmpfile);
3102 delete [] tmpfile;
3103 gROOT->SetExecutingMacro(kFALSE);
3104}
3105
3106////////////////////////////////////////////////////////////////////////////////
3107/// interrupt browsed macro execution
3108
3110{
3111 gROOT->SetInterrupt(kTRUE);
3112}
3113
3114////////////////////////////////////////////////////////////////////////////////
3115/// show/hide macro buttons
3116
3118{
3122
3123 static Bool_t connected = kFALSE;
3124
3125 if (!show) {
3126 bt1->UnmapWindow();
3127 bt2->UnmapWindow();
3128 bt3->UnmapWindow();
3129 } else {
3130 bt1->MapWindow();
3131 bt2->MapWindow();
3132 bt3->MapWindow();
3133
3134 if (!connected && fTextEdit) {
3135 bt1->Connect("Pressed()", "TRootBrowserLite", this, "ExecMacro()");
3136 bt2->Connect("Pressed()", "TRootBrowserLite", this, "InterruptMacro()");
3137 connected = kTRUE;
3138 }
3139 }
3140}
3141
3142////////////////////////////////////////////////////////////////////////////////
3143/// Set text in column col in status bar.
3144
3145void TRootBrowserLite::SetStatusText(const char *txt, Int_t col)
3146{
3148 TGStatusBar* status = GetStatusBar();
3149 if (status!=0) {
3150 status->SetText(txt, col);
3151 }
3152}
3153
3154////////////////////////////////////////////////////////////////////////////////
3155/// Interface method to the old browser.
3156
3158 UInt_t width, UInt_t height,
3159 Option_t * /*opt*/)
3160{
3161 TRootBrowserLite *browser = new TRootBrowserLite(b, title, width, height);
3162 return (TBrowserImp *)browser;
3163}
3164
3165////////////////////////////////////////////////////////////////////////////////
3166/// Interface method to the old browser.
3167
3169 Int_t y, UInt_t width, UInt_t height,
3170 Option_t * /*opt*/)
3171{
3172 TRootBrowserLite *browser = new TRootBrowserLite(b, title, x, y, width, height);
3173 return (TBrowserImp *)browser;
3174}
void Class()
Definition: Class.C:29
size_t fSize
@ kGKeyPress
Definition: GuiTypes.h:59
const Mask_t kKeyMod1Mask
Definition: GuiTypes.h:197
@ kSunkenFrame
Definition: GuiTypes.h:383
@ kDoubleBorder
Definition: GuiTypes.h:385
@ kFixedWidth
Definition: GuiTypes.h:387
@ kHorizontalFrame
Definition: GuiTypes.h:382
Handle_t Atom_t
Definition: GuiTypes.h:36
@ kWatch
Definition: GuiTypes.h:374
@ kPointer
Definition: GuiTypes.h:374
EMouseButton
Definition: GuiTypes.h:213
@ kButton3
Definition: GuiTypes.h:213
@ kButton1
Definition: GuiTypes.h:213
R__EXTERN const char gHelpObjects[]
Definition: HelpText.h:23
R__EXTERN const char gHelpPullDownMenus[]
Definition: HelpText.h:21
R__EXTERN const char gHelpRemote[]
Definition: HelpText.h:25
R__EXTERN const char gHelpAbout[]
Definition: HelpText.h:14
R__EXTERN const char gHelpGraphicsEditor[]
Definition: HelpText.h:20
R__EXTERN const char gHelpCanvas[]
Definition: HelpText.h:22
R__EXTERN const char gHelpBrowserLite[]
Definition: HelpText.h:16
R__EXTERN const char gHelpPostscript[]
Definition: HelpText.h:18
EKeySym
Definition: KeySymbols.h:25
@ kKey_Right
Definition: KeySymbols.h:42
@ kKey_F5
Definition: KeySymbols.h:61
@ kKey_Left
Definition: KeySymbols.h:40
@ kKey_Escape
Definition: KeySymbols.h:26
#define b(i)
Definition: RSha256.hxx:100
#define f(i)
Definition: RSha256.hxx:104
#define c(i)
Definition: RSha256.hxx:101
#define h(i)
Definition: RSha256.hxx:106
#define e(i)
Definition: RSha256.hxx:103
const Ssiz_t kNPOS
Definition: RtypesCore.h:113
int Int_t
Definition: RtypesCore.h:43
unsigned int UInt_t
Definition: RtypesCore.h:44
const Bool_t kFALSE
Definition: RtypesCore.h:90
unsigned long ULong_t
Definition: RtypesCore.h:53
long Long_t
Definition: RtypesCore.h:52
bool Bool_t
Definition: RtypesCore.h:61
long long Long64_t
Definition: RtypesCore.h:71
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassImp(name)
Definition: Rtypes.h:361
R__EXTERN TApplication * gApplication
Definition: TApplication.h:166
#define gDirectory
Definition: TDirectory.h:229
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
R__EXTERN TEnv * gEnv
Definition: TEnv.h:171
#define gFile
Definition: TFile.h:342
@ kButtonDisabled
Definition: TGButton.h:56
@ kButtonUp
Definition: TGButton.h:53
@ kButtonEngaged
Definition: TGButton.h:55
#define gClient
Definition: TGClient.h:166
R__EXTERN TGDNDManager * gDNDManager
Definition: TGDNDManager.h:203
EFSSortMode
Definition: TGFSContainer.h:28
@ kSortByDate
Definition: TGFSContainer.h:32
@ kSortByName
Definition: TGFSContainer.h:29
@ kSortByType
Definition: TGFSContainer.h:30
@ kSortBySize
Definition: TGFSContainer.h:31
@ kFDOpen
Definition: TGFileDialog.h:38
@ kLHintsRight
Definition: TGLayout.h:33
@ kLHintsExpandY
Definition: TGLayout.h:38
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsCenterY
Definition: TGLayout.h:35
@ kLHintsBottom
Definition: TGLayout.h:36
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
EListViewMode
Definition: TGListView.h:39
@ kLVDetails
Definition: TGListView.h:43
@ kLVSmallIcons
Definition: TGListView.h:41
@ kLVList
Definition: TGListView.h:42
@ kLVLargeIcons
Definition: TGListView.h:40
@ kTextLeft
Definition: TGWidget.h:34
static unsigned int total
char name[80]
Definition: TGX11.cxx:109
#define gInterpreter
Definition: TInterpreter.h:556
#define gROOT
Definition: TROOT.h:406
ERootBrowserCommands
@ kFSComboBox
@ kFilePrint
@ kHistoryBack
@ kHelpOnCanvas
@ kViewArrangeByName
@ kViewArrangeAuto
@ kViewLineUp
@ kFileSaveAs
@ kViewLargeIcons
@ kViewRefresh
@ kFileQuit
@ kViewArrangeByDate
@ kFileCloseBrowser
@ kHelpOnGraphicsEd
@ kFileNewBrowser
@ kFileNewCanvas
@ kOptionAutoThumbnail
@ kViewSave
@ kViewInterrupt
@ kViewStatusBar
@ kViewToolBar
@ kViewArrangeByType
@ kHelpOnObjects
@ kViewExec
@ kFileNewBrowserLite
@ kHelpOnBrowser
@ kOneLevelUp
@ kHelpOnRemote
@ kViewHidden
@ kHelpOnMenus
@ kViewSmallIcons
@ kViewGroupLV
@ kHelpOnPS
@ kViewList
@ kFileNewBuilder
@ kViewFind
@ kOptionShowCycles
@ kViewDetails
@ kHistoryForw
@ kHelpAbout
@ kFileSave
@ kFileOpen
@ kViewArrangeBySize
static Bool_t isBinary(const char *str, int len)
test
static ToolBarData_t gToolBarData[]
static const char * gOpenTypes[]
char * Form(const char *fmt,...)
@ kReadPermission
Definition: TSystem.h:46
R__EXTERN TSystem * gSystem
Definition: TSystem.h:556
#define gPad
Definition: TVirtualPad.h:287
#define gVirtualX
Definition: TVirtualX.h:338
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Int_t GET_MSG(Long_t val)
@ kCT_SELCHANGED
@ kCM_COMBOBOX
@ kCM_MENU
@ kCT_ITEMCLICK
@ kC_COMMAND
@ kCM_BUTTON
@ kC_LISTTREE
@ kCT_ITEMDBLCLICK
@ kC_CONTAINER
Int_t GET_SUBMSG(Long_t val)
#define snprintf
Definition: civetweb.c:1540
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
TApplication * GetAppRemote() const
Definition: TApplication.h:146
virtual const char * ApplicationName() const
Definition: TApplication.h:124
virtual Long_t ProcessLine(const char *line, Bool_t sync=kFALSE, Int_t *error=0)
Process a single command line, either a C++ statement or an interpreter command starting with a "....
ABC describing GUI independent browser implementation protocol.
Definition: TBrowserImp.h:29
TBrowser * fBrowser
Definition: TBrowserImp.h:32
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
void SetDrawOption(Option_t *option="")
Set drawing option for object.
Definition: TBrowser.h:103
void SetRefreshFlag(Bool_t flag)
Definition: TBrowser.h:97
TContextMenu * GetContextMenu() const
Definition: TBrowser.h:94
@ kNoHidden
Definition: TBrowser.h:53
Bool_t GetRefreshFlag() const
Definition: TBrowser.h:95
void SetBrowserImp(TBrowserImp *i)
Definition: TBrowser.h:93
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
Definition: TBufferFile.h:46
void WriteObject(const TObject *obj, Bool_t cacheReuse=kTRUE) override
Write object to I/O buffer.
Definition: TBufferIO.cxx:530
@ kWrite
Definition: TBuffer.h:72
Int_t Length() const
Definition: TBuffer.h:99
char * Buffer() const
Definition: TBuffer.h:95
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Definition: TClass.cxx:5901
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:2948
void Browse(TBrowser *b)
Browse this collection (called by TBrowser).
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: TCollection.h:187
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
The color creation and management class.
Definition: TColor.h:19
ULong_t GetPixel() const
Return pixel value corresponding to this color.
Definition: TColor.cxx:1437
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.
Atom_t fDataType
Definition: TGDNDManager.h:75
Int_t fDataLength
Definition: TGDNDManager.h:78
void * fData
Definition: TGDNDManager.h:77
Describe directory structure in memory.
Definition: TDirectory.h:40
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition: TEnv.cxx:491
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=0)
Set the value of a resource or create a new resource.
Definition: TEnv.cxx:736
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:53
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:187
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:234
TGMimeTypes * GetMimeTypeList() const
Definition: TGClient.h:155
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:372
TGPicturePool * GetPicturePool() const
Definition: TGClient.h:135
virtual TGLBEntry * GetSelectedEntry() const
Definition: TGComboBox.h:135
virtual TGTextEntry * GetTextEntry() const
Definition: TGComboBox.h:131
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:106
virtual TGListBox * GetListBox() const
Definition: TGComboBox.h:130
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
Definition: TGComboBox.cxx:451
virtual Int_t GetNumberOfEntries() const
Definition: TGComboBox.h:127
virtual TList * GetList() const
Definition: TGFrame.h:347
TGCompositeFrame(const TGCompositeFrame &)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:349
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1241
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1148
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1188
TList * fList
Definition: TGFrame.h:329
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:351
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
Definition: TGFrame.cxx:1006
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1133
virtual void RemoveAll()
Remove all frames from composite frame.
Definition: TGFrame.cxx:1115
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1174
virtual void Associate(const TGWindow *w)
Definition: TGCanvas.h:99
virtual void ClearViewPort()
Clear view port and redraw full content.
Definition: TGCanvas.cxx:886
virtual TGFrameElement * FindFrame(Int_t x, Int_t y, Bool_t exclude=kTRUE)
Find frame located int container at position x,y.
Definition: TGCanvas.cxx:1652
virtual void RemoveAll()
Remove all items from the container.
Definition: TGCanvas.cxx:636
virtual void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t subString=kFALSE)
Definition: TGCanvas.cxx:1685
Bool_t IsDragging() const
Definition: TGDNDManager.h:175
Bool_t EndDrag()
End dragging.
virtual void Update(const char *path)
Update file system combo box.
TList * fFileNamesList
Definition: TGFileDialog.h:67
char * fFilename
Definition: TGFileDialog.h:61
const char ** fFileTypes
Definition: TGFileDialog.h:63
char * fIniDir
Definition: TGFileDialog.h:62
Bool_t fMultipleSelection
Definition: TGFileDialog.h:66
void SetIniDir(const char *inidir)
Set directory name.
TBufferFile * fBuf
Definition: TGFSContainer.h:61
TDNDData fDNDData
Definition: TGFSContainer.h:62
void SetDNDData(TDNDData *data)
Set drag and drop data.
virtual Bool_t HandleDNDFinished()
TGFrame * fFrame
Definition: TGLayout.h:119
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:629
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:667
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:260
void SetDNDSource(Bool_t onoff)
Definition: TGFrame.h:293
virtual TDNDData * GetDNDData(Atom_t)
Definition: TGFrame.h:300
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
UInt_t GetHeight() const
Definition: TGFrame.h:250
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
Definition: TGFrame.cxx:613
virtual void MapWindow()
map window
Definition: TGFrame.h:229
static Pixel_t fgWhitePixel
Definition: TGFrame.h:128
UInt_t GetWidth() const
Definition: TGFrame.h:249
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
void * GetUserData() const
Definition: TGListView.h:113
void SetUserData(void *userData)
Definition: TGListView.h:112
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:178
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1420
virtual TGFrame * GetContainer() const
Definition: TGListBox.h:335
TGListTreeItem * GetFirstChild() const
Definition: TGListTree.h:74
void Rename(const char *new_name)
Definition: TGListTree.h:86
virtual Bool_t IsActive() const =0
virtual const char * GetText() const =0
TGListTreeItem * GetNextSibling() const
Definition: TGListTree.h:77
TGListTreeItem * GetParent() const
Definition: TGListTree.h:73
virtual void SetTipText(const char *)
Definition: TGListTree.h:92
virtual Bool_t IsOpen() const
Definition: TGListTree.h:79
virtual void * GetUserData() const =0
virtual void SetUserData(void *, Bool_t=kFALSE)
Definition: TGListTree.h:94
TGListTreeItem * FindItemByObj(TGListTreeItem *item, void *ptr)
Find item with fUserData == ptr.
void ClearHighlighted()
Un highlight items.
void AddItem(TGListTreeItem *parent, TGListTreeItem *item)
Add given item to list tree.
void CheckItem(TGListTreeItem *item, Bool_t check=kTRUE)
Set check button state for the node 'item'.
void SetAutoTips(Bool_t on=kTRUE)
Definition: TGListTree.h:366
void SetCheckBox(TGListTreeItem *item, Bool_t on=kTRUE)
Set check button state for the node 'item'.
void OpenItem(TGListTreeItem *item)
Open item in list tree (i.e. show child items).
TGListTreeItem * GetSelected() const
Definition: TGListTree.h:397
Int_t RecursiveDeleteItem(TGListTreeItem *item, void *userData)
Delete item with fUserData == ptr.
Int_t DeleteItem(TGListTreeItem *item)
Delete item from list tree.
TGListTreeItem * GetFirstItem() const
Definition: TGListTree.h:396
TGListTreeItem * FindChildByName(TGListTreeItem *item, const char *name)
Find child of item by name.
void AdjustPosition(TGListTreeItem *item)
Move content to position of item.
void HighlightItem(TGListTreeItem *item)
Highlight item.
TGListTreeItem * FindItemByPathname(const char *path)
Find item by pathname.
TGListTreeItem * FindChildByData(TGListTreeItem *item, void *userData)
Find child of item by userData.
void SetToolTipItem(TGListTreeItem *item, const char *string)
Set tooltip text for this item.
void GetPathnameFromItem(TGListTreeItem *item, char *path, Int_t depth=0)
Get pathname from item.
virtual void AdjustHeaders()
Definition: TGListView.h:172
virtual void Layout()
Layout list view components (container and contents of container).
virtual void SetHeader(const char *s, Int_t hmode, Int_t cmode, Int_t idx)
Set header button idx [0-fNColumns>, hmode is the x text alignmode (ETextJustification) for the heade...
virtual void SetIncrements(Int_t hInc, Int_t vInc)
Set horizontal and vertical scrollbar increments.
EListViewMode GetViewMode() const
Definition: TGListView.h:179
TGTextButton ** GetHeaderButtons()
Definition: TGListView.h:177
virtual void SetViewMode(EListViewMode viewMode)
Set list view mode.
virtual void SetHeaders(Int_t ncolumns)
Set number of headers, i.e.
virtual void SetDefaultHeaders()
Default headers are: Name, Attributes, Size, Owner, Group, Modified.
virtual void LayoutHeader(TGFrame *head)
Layout list view components (container and contents of container).
virtual const char * GetHeader(Int_t idx) const
Returns name of header idx.
Atom_t * fDNDTypeList
Definition: TGFrame.h:460
virtual void SendCloseMessage()
Send close message to self.
Definition: TGFrame.cxx:1704
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
Definition: TGFrame.cxx:1816
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition: TGFrame.cxx:1761
virtual Bool_t HandleKey(Event_t *event)
Handle keyboard events.
Definition: TGFrame.cxx:1566
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition: TGFrame.cxx:1839
void SetWMSizeHints(UInt_t wmin, UInt_t hmin, UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc)
Give the window manager minimum and maximum size hints.
Definition: TGFrame.cxx:1864
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1748
const TGPicture * SetIconPixmap(const char *iconName)
Set window icon pixmap by name.
Definition: TGFrame.cxx:1776
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
Add popup menu to menu bar.
Definition: TGMenu.cxx:416
void AddType(const char *type, const char *pat, const char *icon, const char *sicon, const char *action)
Add a mime type to the list of mime types.
const TGPicture * GetIcon(const char *filename, Bool_t small_icon)
Return icon belonging to mime type of filename.
Bool_t GetAction(const char *filename, char *action)
Return in action the mime action string belonging to filename.
TGClient * fClient
Definition: TGObject.h:37
Handle_t GetId() const
Definition: TGObject.h:47
Handle_t fId
Definition: TGObject.h:36
const TGPicture * GetPicture(const char *name)
Get a picture from the picture pool.
Definition: TGPicture.cxx:80
virtual void AddPopup(TGHotString *s, TGPopupMenu *popup, TGMenuEntry *before=0, const TGPicture *p=0)
Add a (cascading) popup menu to a popup menu.
Definition: TGMenu.cxx:1150
virtual Bool_t IsEntryChecked(Int_t id)
Return true if menu item is checked.
Definition: TGMenu.cxx:1843
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=0, const TGPicture *p=0, TGMenuEntry *before=0)
Add a menu entry.
Definition: TGMenu.cxx:988
virtual void AddSeparator(TGMenuEntry *before=0)
Add a menu separator to the menu.
Definition: TGMenu.cxx:1058
virtual void CheckEntry(Int_t id)
Check a menu entry (i.e. add a check mark in front of it).
Definition: TGMenu.cxx:1780
virtual void DisableEntry(Int_t id)
Disable entry (disabled entries appear in a sunken relieve).
Definition: TGMenu.cxx:1722
virtual void UnCheckEntry(Int_t id)
Uncheck menu entry (i.e. remove check mark).
Definition: TGMenu.cxx:1805
virtual void Associate(const TGWindow *w)
Definition: TGMenu.h:219
virtual void RCheckEntry(Int_t id, Int_t IDfirst, Int_t IDlast)
Radio-select entry (note that they cannot be unselected, the selection must be moved to another entry...
Definition: TGMenu.cxx:1858
Int_t fY
Definition: TGDimension.h:48
Int_t fX
Definition: TGDimension.h:47
static TGSearchDialog *& SearchDialog()
Return global search dialog.
virtual void SetText(TGString *text, Int_t partidx=0)
Set text in partition partidx in status bar.
virtual void SetParts(Int_t npart)
Divide the status bar in npart equal sized parts.
virtual void SetString(const char *s)
Definition: TGString.h:41
const char * GetString() const
Definition: TGString.h:40
virtual Bool_t SaveFile(const char *fname, Bool_t saveas=kFALSE)
Save file.
Definition: TGTextEdit.cxx:388
virtual Bool_t Search(const char *string, Bool_t direction=kTRUE, Bool_t caseSensitive=kFALSE)
Search for string in the specified direction.
Definition: TGTextEdit.cxx:634
const char * GetText() const
Definition: TGTextEntry.h:134
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
const TGString * GetText() const
Definition: TGListBox.h:115
virtual Bool_t LoadFile(const char *fname, long startpos=0, long length=-1)
Load a file in the text view widget.
Definition: TGTextView.cxx:453
virtual void SetReadOnly(Bool_t on=kTRUE)
Definition: TGTextView.h:128
virtual TGButton * AddButton(const TGWindow *w, ToolBarData_t *button, Int_t spacing=0)
Add button to toolbar.
Definition: TGToolBar.cxx:91
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGToolBar.cxx:213
virtual TGButton * GetButton(Int_t id) const
Finds and returns a pointer to the button with the specified identifier id.
Definition: TGToolBar.cxx:156
virtual void SetBackgroundColor(Pixel_t)
Set background color of the canvas frame.
Definition: TGView.cxx:579
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
@ kEditDisable
Definition: TGWindow.h:58
virtual void DestroyWindow()
destroy window
Definition: TGWindow.cxx:182
const TGWindow * GetParent() const
Definition: TGWindow.h:84
static TGuiBuilder * Instance()
return an instance of TGuiBuilder object
THashTable implements a hash table to store TObject's.
Definition: THashTable.h:35
TObject * FindObject(const char *name) const
Find object using its name.
Definition: THashTable.cxx:238
An abstract interface to image processing library.
Definition: TImage.h:29
virtual void FromPad(TVirtualPad *, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
Definition: TImage.h:122
@ kXpm
Definition: TImage.h:37
virtual UInt_t GetWidth() const
Definition: TImage.h:228
virtual void DrawBox(Int_t, Int_t, Int_t, Int_t, const char *="#000000", UInt_t=1, Int_t=0)
Definition: TImage.h:188
static TImage * Create()
Create an image.
Definition: TImage.cxx:36
virtual Bool_t SetImageBuffer(char **, EImageFileTypes=TImage::kPng)
Definition: TImage.h:242
virtual Bool_t IsValid() const
Definition: TImage.h:230
virtual void Scale(UInt_t, UInt_t)
Definition: TImage.h:141
virtual void Merge(const TImage *, const char *="alphablend", Int_t=0, Int_t=0)
Definition: TImage.h:172
virtual Pixmap_t GetPixmap()
Definition: TImage.h:235
virtual Pixmap_t GetMask()
Definition: TImage.h:236
virtual UInt_t GetHeight() const
Definition: TImage.h:229
Utility class for browsing TMapFile objects.
Definition: TKeyMapFile.h:20
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Definition: TKey.h:28
virtual const char * GetClassName() const
Definition: TKey.h:76
Short_t GetCycle() const
Return cycle number associated to this key.
Definition: TKey.cxx:577
A doubly linked list.
Definition: TList.h:44
virtual void Add(TObject *obj)
Definition: TList.h:87
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
Definition: TList.cxx:329
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:821
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition: TList.cxx:692
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
Definition: TList.cxx:763
virtual TObject * Before(const TObject *obj) const
Returns the object before object obj.
Definition: TList.cxx:370
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition: TList.cxx:469
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:658
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:401
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Collectable string class.
Definition: TObjString.h:28
const TString & GetString() const
Definition: TObjString.h:46
Mother of all ROOT objects.
Definition: TObject.h:37
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: TObject.cxx:473
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:357
virtual void Browse(TBrowser *b)
Browse object. May be overridden for another default action.
Definition: TObject.cxx:119
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:187
virtual const char * GetIconName() const
Returns mime type name of object.
Definition: TObject.cxx:367
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:128
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Returns string containing info about the object at position (px,py).
Definition: TObject.cxx:386
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:694
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:443
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:891
virtual const char * GetTitle() const
Returns title of object.
Definition: TObject.cxx:401
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
Definition: TObject.cxx:550
virtual ULong_t Hash() const
Return hash value for this object.
Definition: TObject.cxx:433
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:865
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
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:866
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:1024
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
Definition: TROOT.cxx:2887
The TRemoteObject class provides protocol for browsing ROOT objects from a remote ROOT session.
Definition: TRemoteObject.h:34
const char * GetClassName() const
Definition: TRemoteObject.h:54
const char * GetKeyClassName() const
Definition: TRemoteObject.h:56
TGCompositeFrame * fTreeHdr
virtual void Add(TObject *obj, const char *name=0, Int_t check=-1)
Add items to the browser.
TGPopupMenu * fOptionMenu
TGToolBar * fToolBar
friend class TRootIconBox
Bool_t HistoryBackward()
go to the past
void SetViewMode(Int_t new_mode, Bool_t force=kFALSE)
Set iconbox's view mode and update menu and toolbar buttons accordingly.
TGLayoutHints * fMenuBarHelpLayout
void ListTreeHighlight(TGListTreeItem *item)
Open tree item and list in iconbox its contents.
virtual void ExecuteDefaultAction(TObject *obj)
Execute default action for selected object (action is specified in the $HOME/.root....
TGFileContainer * GetIconBox() const
returns pointer to fIconBox object
virtual void Show()
void SetSortMode(Int_t new_mode)
Set iconbox's sort mode and update menu radio buttons accordingly.
void ClearHistory()
clear navigation history
TGListTreeItem * fListLevel
TGLayoutHints * fExpandLayout
TGPopupMenu * fFileMenu
void SetDrawOption(Option_t *option="")
sets drawing option
TGPopupMenu * fSortMenu
void BrowseTextFile(const char *file)
browse text file
virtual void DoubleClicked(TObject *obj)
Emits signal when double clicking on icon.
TGLayoutHints * fComboLayout
void Chdir(TGListTreeItem *item)
Make object associated with item the current directory.
void CloseWindow()
In case window is closed via WM we get here.
void ExecMacro()
executed browsed text macro
TGComboBox * fDrawOption
Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Handle menu and other command generated by the user.
virtual void ShowToolBar(Bool_t show=kTRUE)
Show or hide toolbar.
Option_t * GetDrawOption() const
returns drawing option
void HighlightListLevel()
helper method to track history
Bool_t HistoryForward()
go to the future
TGLayoutHints * fMenuBarLayout
virtual void Refresh(Bool_t force=kFALSE)
Refresh the browser contents.
static TBrowserImp * NewBrowser(TBrowser *b=0, const char *title="ROOT Browser", UInt_t width=800, UInt_t height=500, Option_t *opt="")
Interface method to the old browser.
virtual void AddToTree(TObject *obj, const char *name, Int_t check=-1)
Add items to the current TGListTree of the browser.
TRootIconBox * fIconBox
const TGPicture * fIconPic
void AddToHistory(TGListTreeItem *item)
helper method to track history
virtual void AddCheckBox(TObject *obj, Bool_t check=kFALSE)
Add a checkbox in the TGListTreeItem corresponding to obj and a checkmark on TGLVEntry if check = kTR...
TGLayoutHints * fBarLayout
TGHorizontalFrame * fHf
TGMenuBar * fMenuBar
virtual void Checked(TObject *obj, Bool_t check)
Emits signal when double clicking on icon.
TRootBrowserLite(TBrowser *b=0, const char *title="ROOT Browser", UInt_t width=800, UInt_t height=500)
Create browser with a specified width and height.
void DisplayTotal(Int_t total, Int_t selected)
Display in statusbar total number of objects and number of selected objects in IconBox.
TGVerticalFrame * fV1
void IconBoxAction(TObject *obj)
Default action when double clicking on icon.
TGLayoutHints * fMenuBarItemLayout
void HideTextEdit()
hide text edit
TGStatusBar * GetStatusBar() const
TGVerticalFrame * fV2
void DisplayDirectory()
Display current directory in second label, fLbl2.
virtual void RecursiveRemove(TObject *obj)
Recursively remove object from browser.
void ShowMacroButtons(Bool_t show=kTRUE)
show/hide macro buttons
virtual void AddToBox(TObject *obj, const char *name)
Add items to the iconbox of the browser.
virtual void ShowStatusBar(Bool_t show=kTRUE)
Show or hide statusbar.
void Search()
starts serach dialog
void ReallyDelete()
Really delete the browser and the this GUI.
TGPopupMenu * fHelpMenu
virtual void CheckObjectItem(TObject *obj, Bool_t check=kFALSE)
Check / uncheck the TGListTreeItem corresponding to this object and add a checkmark on TGLVEntry if c...
virtual void BrowseObj(TObject *obj)
Browse object.
TGListView * fListView
TObject * fHistoryCursor
TGFSComboBox * fFSComboBox
virtual void SetStatusText(const char *txt, Int_t col)
Set text in column col in status bar.
virtual Bool_t HandleKey(Event_t *event)
handle keys
void InterruptMacro()
interrupt browsed macro execution
virtual void RemoveCheckBox(TObject *obj)
Remove checkbox from TGListTree and checkmark from TGListView.
virtual ~TRootBrowserLite()
Browser destructor.
virtual void SetDefaults(const char *iconStyle=0, const char *sortBy=0)
Set defaults depending on settings in the user's .rootrc.
TGCompositeFrame * fListHdr
void UpdateDrawOption()
add new draw option to the "history"
TGTextEdit * fTextEdit
TGStatusBar * fStatusBar
void CreateBrowser(const char *name)
Create the actual browser.
void ToSystemDirectory(const char *dirname)
display directory
TGPopupMenu * fViewMenu
void DeleteListTreeItem(TGListTreeItem *item)
delete list tree item, remove it from history
TGHorizontal3DLine * fToolBarSep
void SetText(const char *helpText)
Set help text from helpText buffer in TGTextView.
void Popup()
Show help dialog.
Basic string class.
Definition: TString.h:131
Ssiz_t Length() const
Definition: TString.h:405
void ToLower()
Change string to lower-case.
Definition: TString.cxx:1125
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition: TString.cxx:2177
const char * Data() const
Definition: TString.h:364
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:687
ECaseCompare
Definition: TString.h:263
@ kIgnoreCase
Definition: TString.h:263
@ kExact
Definition: TString.h:263
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition: TString.h:610
TString & Prepend(const char *cs)
Definition: TString.h:656
Bool_t IsNull() const
Definition: TString.h:402
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
Definition: TString.cxx:638
TString & Remove(Ssiz_t pos)
Definition: TString.h:668
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
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:634
Long64_t Atoll() const
Return long long value of string.
Definition: TString.cxx:1947
Describes an Operating System directory for the browser.
A TSystemFile describes an operating system file.
Definition: TSystemFile.h:29
const char * pwd()
Definition: TSystem.h:420
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
Definition: TSystem.cxx:1066
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition: TSystem.cxx:651
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:1291
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition: TSystem.cxx:1058
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
Definition: TSystem.cxx:947
virtual const char * WorkingDirectory()
Return working directory.
Definition: TSystem.cxx:867
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:1027
virtual int Unlink(const char *name)
Unlink, i.e.
Definition: TSystem.cxx:1376
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
Definition: TSystem.cxx:1477
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:51
virtual void Modified(Bool_t flag=1)=0
virtual void Update()=0
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition: fillpatterns.C:1
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)
Definition: TMathBase.h:362
Definition: file.py:1
EGEventType fType
Definition: GuiTypes.h:174
UInt_t fState
Definition: GuiTypes.h:180
const char * fPixmap
Definition: TGToolBar.h:33
auto * lv
Definition: textalign.C:5
REAL splitter
Definition: triangle.c:616