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
70#include "HelpText.h"
71
72#ifdef WIN32
73#include "TWin32SplashThread.h"
74#endif
75
76// Browser menu command ids
88
102
103 kViewArrangeByName, // Arrange submenu
109
112
115
116 kOneLevelUp, // One level up toolbar button
117 kFSComboBox, // File system combobox in toolbar
118
128
129
130//----- Struct for default icons
131
132struct DefaultIcon_t {
133 const char *fPicnamePrefix;
134 const TGPicture *fIcon[2];
135};
136
137#if 0
138static DefaultIcon_t gDefaultIcon[] = {
139 { "folder", { 0, 0 } },
140 { "app", { 0, 0 } },
141 { "doc", { 0, 0 } },
142 { "slink", { 0, 0 } },
143 { "histo", { 0, 0 } },
144 { "object", { 0, 0 } }
145};
146#endif
147
148
149//----- Toolbar stuff...
150
152 { "tb_uplevel.xpm", "Up One Level", kFALSE, kOneLevelUp, 0 },
153 { "", "", kFALSE, -1, 0 },
154 { "tb_bigicons.xpm", "Large Icons", kTRUE, kViewLargeIcons, 0 },
155 { "tb_smicons.xpm", "Small Icons", kTRUE, kViewSmallIcons, 0 },
156 { "tb_list.xpm", "List", kTRUE, kViewList, 0 },
157 { "tb_details.xpm", "Details", kTRUE, kViewDetails, 0 },
158 { "", "", kFALSE, -1, 0 },
159 { "tb_back.xpm", "Back", kFALSE, kHistoryBack, 0 },
160 { "tb_forw.xpm", "Forward", kFALSE, kHistoryForw, 0 },
161 { "tb_refresh.xpm", "Refresh (F5)", kFALSE, kViewRefresh, 0 },
162 { "", "", kFALSE, -1, 0 },
163 { "tb_find.xpm", "Find (Ctrl-F)", kFALSE, kViewFind, 0 },
164 { "", "", kFALSE, -1, 0 },
165 { "macro_t.xpm", "Execute Macro", kFALSE, kViewExec, 0 },
166 { "interrupt.xpm", "Interrupt Macro",kFALSE, kViewInterrupt, 0 },
167 { "filesaveas.xpm", "Save Macro", kFALSE, kViewSave, 0 },
168 { 0, 0, kFALSE, 0, 0 }
169};
170
171
172//----- TGFileDialog file types
173
174static const char *gOpenTypes[] = { "ROOT files", "*.root",
175 "All files", "*",
176 0, 0 };
177
178////////////////////////////////////////////////////////////////////////////////////
179class TRootBrowserHistoryCursor : public TObject {
180public:
181 TGListTreeItem *fItem;
182
183 TRootBrowserHistoryCursor(TGListTreeItem *item) : fItem(item) {}
184 void Print(Option_t *) const { if (fItem) printf("%s\n", fItem->GetText()); }
185};
186
187
188////////////////////////////////////////////////////////////////////////////////////
189class TRootBrowserHistory : public TList {
190public:
191 void RecursiveRemove(TObject *obj) {
192 TRootBrowserHistoryCursor *cur;
193 TIter next(this);
194
195 while ((cur = (TRootBrowserHistoryCursor*)next())) {
196 if (cur->fItem->GetUserData() == obj) {
197 Remove(cur);
198 delete cur;
199 }
200 }
201 }
202
203 void DeleteItem(TGListTreeItem *item) {
204 TRootBrowserHistoryCursor *cur;
205 TIter next(this);
206
207 while ((cur = (TRootBrowserHistoryCursor*)next())) {
208 if (cur->fItem == item) {
209 Remove(cur);
210 delete cur;
211 }
212 }
213 }
214};
215
216
217////////////////////////////////////////////////////////////////////////////////////
218class TRootBrowserCursorSwitcher {
219private:
220 TGWindow *fW1;
221 TGWindow *fW2;
222public:
223 TRootBrowserCursorSwitcher(TGWindow *w1, TGWindow *w2) : fW1(w1), fW2(w2) {
224 if (w1) gVirtualX->SetCursor(w1->GetId(), gVirtualX->CreateCursor(kWatch));
225 if (w2) gVirtualX->SetCursor(w2->GetId(), gVirtualX->CreateCursor(kWatch));
226 }
227 ~TRootBrowserCursorSwitcher() {
228 if (fW1) gVirtualX->SetCursor(fW1->GetId(), gVirtualX->CreateCursor(kPointer));
229 if (fW2) gVirtualX->SetCursor(fW2->GetId(), gVirtualX->CreateCursor(kPointer));
230 }
231};
232
233////////////////////////////////////////////////////////////////////////////////////
234class TIconBoxThumb : public TObject {
235public:
236 TString fName;
237 const TGPicture *fSmall;
238 const TGPicture *fLarge;
239
240 TIconBoxThumb(const char *name, const TGPicture *spic, const TGPicture *pic) {
241 fName = name;
242 fSmall = spic;
243 fLarge = pic;
244 }
245 ULong_t Hash() const { return fName.Hash(); }
246 const char *GetName() const { return fName.Data(); }
247};
248
249
250
251//----- Special ROOT object item (this are items in the icon box, see
252//----- TRootIconBox)
253////////////////////////////////////////////////////////////////////////////////////
254class TRootObjItem : public TGFileItem {
255public:
256 TRootObjItem(const TGWindow *p, const TGPicture *bpic,
257 const TGPicture *spic, TGString *name,
258 TObject *obj, TClass *cl, EListViewMode viewMode = kLVSmallIcons);
259
260 virtual TDNDData *GetDNDData(Atom_t) {
261 TObject *object = 0;
262 if (fObj->IsA() == TKey::Class())
263 object = ((TKey *)fObj)->ReadObj();
264 else
265 object = fObj;
266 if (object) {
267 if (!fBuf) fBuf = new TBufferFile(TBuffer::kWrite);
268 fBuf->WriteObject(object);
269 fDNDData.fData = fBuf->Buffer();
270 fDNDData.fDataLength = fBuf->Length();
271 }
272 fDNDData.fDataType = gVirtualX->InternAtom("application/root", kFALSE);
273 return &fDNDData;
274 }
275
276 virtual Bool_t HandleDNDFinished() {
277 if (GetParent())
278 return ((TGFrame *)GetParent())->HandleDNDFinished();
279 return kFALSE;
280 }
281
282protected:
283 TObject *fObj;
285};
286
287////////////////////////////////////////////////////////////////////////////////
288/// Create an icon box item.
289
290TRootObjItem::TRootObjItem(const TGWindow *p, const TGPicture *bpic,
291 const TGPicture *spic, TGString *name,
292 TObject *obj, TClass *, EListViewMode viewMode) :
293 TGFileItem(p, bpic, 0, spic, 0, name, 0, 0, 0, 0, 0, viewMode)
294{
295 fObj = obj;
296 fDNDData.fData = 0;
297 fDNDData.fDataLength = 0;
298
299 if (fSubnames) {
300 for (Int_t i = 0; fSubnames[i] != 0; ++i) delete fSubnames[i];
301 }
302 delete [] fSubnames;
303 fSubnames = new TGString* [2];
304
305 fSubnames[0] = new TGString(obj->GetTitle());
306
307 fSubnames[1] = 0;
308
309 if (obj->IsA()->HasDefaultConstructor()) {
310 SetDNDSource(kTRUE);
311 }
312 if ((obj->IsA() == TFolder::Class()) ||
313 (obj->IsA() == TClass::Class())) {
314 SetDNDSource(kFALSE);
315 }
316
317 int i;
318 for (i = 0; fSubnames[i] != 0; ++i)
319 ;
320 fCtw = new int[i];
321 for (i = 0; fSubnames[i] != 0; ++i)
322 fCtw[i] = gVirtualX->TextWidth(fFontStruct, fSubnames[i]->GetString(),
323 fSubnames[i]->GetLength());
324}
325
326class TRootIconBox;
327////////////////////////////////////////////////////////////////////////////////////
328class TRootIconList : public TList {
329
330private:
331 TRootIconBox *fIconBox; // iconbox to which list belongs
332 const TGPicture *fPic; // list view icon
333
334public:
335 TRootIconList(TRootIconBox* box = 0);
336 virtual ~TRootIconList();
337 void UpdateName();
338 const char *GetTitle() const { return "ListView Container"; }
339 Bool_t IsFolder() const { return kFALSE; }
340 void Browse(TBrowser *b);
341 const TGPicture *GetPicture() const { return fPic; }
342};
343
344////////////////////////////////////////////////////////////////////////////////
345/// constructor
346
347TRootIconList::TRootIconList(TRootIconBox* box)
348{
349 fPic = gClient->GetPicture("listview.xpm");
350 fIconBox = box;
351 fName = "empty";
352}
353
354////////////////////////////////////////////////////////////////////////////////
355/// destructor
356
357TRootIconList::~TRootIconList()
358{
359 gClient->FreePicture(fPic);
360}
361
362////////////////////////////////////////////////////////////////////////////////
363/// composite name
364
365void TRootIconList::UpdateName()
366{
367 if (!First()) return;
368
369 if (fSize==1) {
370 fName = First()->GetName();
371 return;
372 }
373
374 fName = First()->GetName();
375 fName += "-";
376 fName += Last()->GetName();
377}
378
379//----- Special ROOT object container (this is the icon box on the
380//----- right side of the browser)
381////////////////////////////////////////////////////////////////////////////////////
382class TRootIconBox : public TGFileContainer {
383friend class TRootIconList;
384friend class TRootBrowserLite;
385
386private:
387 Bool_t fCheckHeaders; // if true check headers
388 TRootIconList *fCurrentList; //
389 TRootObjItem *fCurrentItem; //
390 Bool_t fGrouped; //
391 TString fCachedPicName; //
392 TList *fGarbage; // garbage for TRootIconList's
393 Int_t fGroupSize; // the total number of items when icon box switched to "global view" mode
394 TGString *fCurrentName; //
395 const TGPicture *fLargeCachedPic; //
396 const TGPicture *fSmallCachedPic; //
397 Bool_t fWasGrouped;
398 TObject *fActiveObject; //
399 Bool_t fIsEmpty;
400 THashTable *fThumbnails; // hash table with thumbnailed pictures
401 Bool_t fAutoThumbnail; //
403
404 void *FindItem(const TString& name,
405 Bool_t direction = kTRUE,
406 Bool_t caseSensitive = kTRUE,
407 Bool_t beginWith = kFALSE);
408 void RemoveGarbage();
409
410public:
412 UInt_t options = kSunkenFrame,
414
415 virtual ~TRootIconBox();
416
417 void AddObjItem(const char *name, TObject *obj, TClass *cl);
418 void GetObjPictures(const TGPicture **pic, const TGPicture **spic,
419 TObject *obj, const char *name);
420 void SetObjHeaders();
421 void Refresh();
422 void RemoveAll();
423 void SetGroupSize(Int_t siz) { fGroupSize = siz; }
424 Int_t GetGroupSize() const { return fGroupSize; }
425 TGFrameElement *FindFrame(Int_t x, Int_t y, Bool_t exclude=kTRUE) { return TGContainer::FindFrame(x,y,exclude); }
426 Bool_t WasGrouped() const { return fWasGrouped; }
427};
428
429////////////////////////////////////////////////////////////////////////////////
430/// Create iconbox containing ROOT objects in browser.
431
432TRootIconBox::TRootIconBox(TRootBrowserLite *browser, TGListView *lv, UInt_t options,
433 ULong_t back) : TGFileContainer(lv, options, back)
434{
435 fListView = lv;
436 fBrowser = browser;
437
438 fCheckHeaders = kTRUE;
439 fTotal = 0;
440 fGarbage = new TList();
441 fCurrentList = 0;
442 fCurrentItem = 0;
443 fGrouped = kFALSE;
444 fGroupSize = 1000;
445 fCurrentName = 0;
446 fWasGrouped = kFALSE;
447 fActiveObject = 0;
448 fIsEmpty = kTRUE;
449 fLargeCachedPic = 0;
450 fSmallCachedPic = 0;
451
452 // Don't use timer HERE (timer is set in TBrowser).
453 StopRefreshTimer();
454 fRefresh = 0;
455 fThumbnails = new THashTable(50);
456 fAutoThumbnail = kTRUE;
457}
458
459////////////////////////////////////////////////////////////////////////////////
460/// destructor
461
462TRootIconBox::~TRootIconBox()
463{
464 RemoveAll();
465 RemoveGarbage();
466 delete fGarbage;
467 delete fThumbnails;
468}
469
470////////////////////////////////////////////////////////////////////////////////
471/// Retrieve icons associated with class "name". Association is made
472/// via the user's ~/.root.mimes file or via $ROOTSYS/etc/root.mimes.
473
474void TRootIconBox::GetObjPictures(const TGPicture **pic, const TGPicture **spic,
475 TObject *obj, const char *name)
476{
477 static TImage *im = 0;
478 if (!im) {
479 im = TImage::Create();
480 }
481
482 TString xpm_magic(name, 3);
483 Bool_t xpm = xpm_magic == "/* ";
484 const char *iconname = xpm ? obj->GetName() : name;
485
486 if (obj->IsA()->InheritsFrom("TGeoVolume")) {
487 iconname = obj->GetIconName() ? obj->GetIconName() : obj->IsA()->GetName();
488 }
489
490 if (fCachedPicName == iconname) {
491 *pic = fLargeCachedPic;
492 *spic = fSmallCachedPic;
493 return;
494 }
495
496 *pic = fClient->GetMimeTypeList()->GetIcon(iconname, kFALSE);
497
498 if (!(*pic) && xpm) {
499 if (im && im->SetImageBuffer((char**)&name, TImage::kXpm)) {
500 *pic = fClient->GetPicturePool()->GetPicture(iconname, im->GetPixmap(),
501 im->GetMask());
502 im->Scale(im->GetWidth()/2, im->GetHeight()/2);
503 *spic = fClient->GetPicturePool()->GetPicture(iconname, im->GetPixmap(),
504 im->GetMask());
505 }
506
507 fClient->GetMimeTypeList()->AddType("[thumbnail]", iconname, iconname, iconname, "->Browse()");
508 return;
509 }
510
511 if (*pic == 0) {
512 if (obj->IsFolder()) {
513 *pic = fFolder_s;
514 } else {
515 *pic = fDoc_s;
516 }
517 }
518 fLargeCachedPic = *pic;
519
520 *spic = fClient->GetMimeTypeList()->GetIcon(iconname, kTRUE);
521
522 if (*spic == 0) {
523 if (obj->IsFolder())
524 *spic = fFolder_t;
525 else
526 *spic = fDoc_t;
527 }
528 fSmallCachedPic = *spic;
529 fCachedPicName = iconname;
530}
531
532////////////////////////////////////////////////////////////////////////////////
533/// delete all TRootIconLists from garbage
534
535void TRootIconBox::RemoveGarbage()
536{
537 TIter next(fGarbage);
538 TList *li;
539
540 while ((li=(TList *)next())) {
541 li->Clear("nodelete");
542 }
543 fGarbage->Delete();
544}
545
546////////////////////////////////////////////////////////////////////////////////
547/// Add object to iconbox. Class is used to get the associated icons
548/// via the mime file (see GetObjPictures()).
549
550void TRootIconBox::AddObjItem(const char *name, TObject *obj, TClass *cl)
551{
552 if (!cl) return;
553
554 Bool_t isSystemFile = kFALSE;
555 TGFileItem *fi;
556 fWasGrouped = kFALSE;
557 const TGPicture *pic = 0;
558 const TGPicture *spic = 0;
559
560 if (obj->InheritsFrom("TRemoteObject")) {
561 // check if the real remote object is a system file or directory
562 TRemoteObject *robj = (TRemoteObject *)obj;
563 if ((TString(robj->GetClassName()) == "TSystemFile") ||
564 (TString(robj->GetClassName()) == "TSystemDirectory"))
565 isSystemFile = kTRUE;
566 }
567
568 if (isSystemFile || obj->IsA() == TSystemFile::Class() ||
569 obj->IsA() == TSystemDirectory::Class()) {
570 if (fCheckHeaders) {
571 if (strcmp(fListView->GetHeader(1), "Attributes")) {
574 if (buttons) {
575 buttons[0]->Connect("Clicked()", "TRootBrowserLite", fBrowser,
576 TString::Format("SetSortMode(=%d)", kViewArrangeByName));
577 buttons[1]->Connect("Clicked()", "TRootBrowserLite", fBrowser,
578 TString::Format("SetSortMode(=%d)", kViewArrangeByType));
579 buttons[2]->Connect("Clicked()", "TRootBrowserLite", fBrowser,
580 TString::Format("SetSortMode(=%d)", kViewArrangeBySize));
581 buttons[5]->Connect("Clicked()", "TRootBrowserLite", fBrowser,
582 TString::Format("SetSortMode(=%d)", kViewArrangeByDate));
583 }
584 }
585 fCheckHeaders = kFALSE;
586 }
587
588 TIconBoxThumb *thumb = 0;
589 char *thumbname = gSystem->ConcatFileName(gSystem->WorkingDirectory(), name);
590 thumb = (TIconBoxThumb *)fThumbnails->FindObject(gSystem->IsAbsoluteFileName(name) ? name :
591 thumbname);
592 delete []thumbname;
593
594 if (thumb) {
595 spic = thumb->fSmall;
596 pic = thumb->fLarge;
597 }
598
599 if (obj->InheritsFrom("TRemoteObject"))
600 // special case for remote object
601 fi = AddRemoteFile(obj, spic, pic);
602 else
603 fi = AddFile(name, spic, pic);
604 if (fi) {
605 fi->SetUserData(obj);
606 if (obj->IsA() == TSystemFile::Class()) {
607 TString str;
608 TDNDData data;
609 str = TString::Format("file://%s/%s\r\n",
611 obj->GetName());
612 data.fData = (void *)str.Data();
613 data.fDataLength = str.Length()+1;
614 data.fDataType = gVirtualX->InternAtom("text/uri-list", kFALSE);
615 fi->SetDNDData(&data);
616 fi->SetDNDSource(kTRUE);
617 }
618 }
619
620 fIsEmpty = kFALSE;
621 return;
622 }
623
624 if (!fCurrentList) {
625 fCurrentList = new TRootIconList(this);
626 fGarbage->Add(fCurrentList);
627 }
628
629 fCurrentList->Add(obj);
630 fCurrentList->UpdateName();
631 fIsEmpty = kFALSE;
632
633 TGFrameElement *el;
634 TIter next(fList);
635 while ((el = (TGFrameElement *) next())) {
636 TGLVEntry *f = (TGLVEntry *) el->fFrame;
637 if (f->GetUserData() == obj) {
638 return;
639 }
640 }
641
642 if (fGrouped && fCurrentItem && (fCurrentList->GetSize()>1)) {
643 fCurrentName->SetString(fCurrentList->GetName());
644 }
645
647
648 if ((fCurrentList->GetSize() < fGroupSize) && !fGrouped) {
649 GetObjPictures(&pic, &spic, obj, obj->GetIconName() ?
650 obj->GetIconName() : cl->GetName());
651
652 if (fCheckHeaders) {
653 if (strcmp(fListView->GetHeader(1), "Title")) {
654 SetObjHeaders();
655 }
656 fCheckHeaders = kFALSE;
657 }
658
659 fi = new TRootObjItem(this, pic, spic, new TGString(name), obj, cl, view);
660
661 fi->SetUserData(obj);
662 AddItem(fi);
663 return;
664 }
665
666 if (fGrouped && (fCurrentList->GetSize()==1)) {
667 fCurrentName = new TGString(fCurrentList->GetName());
668 fCurrentItem = new TRootObjItem(this, fCurrentList->GetPicture(), fCurrentList->GetPicture(),
669 fCurrentName,fCurrentList, TList::Class(), view);
670 fCurrentItem->SetUserData(fCurrentList);
671 AddItem(fCurrentItem);
672 fTotal = fList->GetSize();
673 return;
674 }
675
676 if ((fCurrentList->GetSize()==fGroupSize) && !fGrouped) {
677 fGrouped = kTRUE;
678
679 // clear fList
680 TGFrameElement *el2;
681 TIter nextl(fList);
682
683 while ((el2 = (TGFrameElement *) nextl())) {
684 el2->fFrame->DestroyWindow();
685 delete el2->fFrame;
686 fList->Remove(el2);
687 delete el2;
688 }
689
690 fCurrentName = new TGString(fCurrentList->GetName());
691 fi = new TRootObjItem(this, fCurrentList->GetPicture(), fCurrentList->GetPicture(),
692 fCurrentName, fCurrentList, TList::Class(), view);
693 fi->SetUserData(fCurrentList);
694 AddItem(fi);
695
696 fCurrentList = new TRootIconList(this);
697 fGarbage->Add(fCurrentList);
698 fTotal = 1;
699 return;
700 }
701
702 if ((fCurrentList->GetSize()==fGroupSize) && fGrouped) {
703 fCurrentList = new TRootIconList(this);
704 fGarbage->Add(fCurrentList);
705 return;
706 }
707}
708
709////////////////////////////////////////////////////////////////////////////////
710/// browse icon list
711
712void TRootIconList::Browse(TBrowser *)
713{
714 if (!fIconBox) return;
715
716 TObject *obj;
717 TGFileItem *fi;
718 const TGPicture *pic = 0;
719 const TGPicture *spic = 0;
720 TClass *cl;
722 TKey *key = 0;
723
724 fIconBox->RemoveAll();
725 TObjLink *lnk = FirstLink();
726
727 while (lnk) {
728 obj = lnk->GetObject();
729 lnk = lnk->Next();
730
731 if (obj->IsA() == TKey::Class()) {
732 cl = TClass::GetClass(((TKey *)obj)->GetClassName());
733 key = (TKey *)obj;
734 } else if (obj->IsA() == TKeyMapFile::Class()) {
735 cl = TClass::GetClass(((TKeyMapFile *)obj)->GetTitle());
736 } else if (obj->InheritsFrom("TRemoteObject")) {
737 // special case for remote object: get real object class
738 TRemoteObject *robj = (TRemoteObject *)obj;
739 cl = TClass::GetClass(robj->GetClassName());
740 } else {
741 cl = obj->IsA();
742 }
743
744 name = obj->GetName();
745
746 if (key && obj->IsA() == TKey::Class()) {
747 name += ";";
748 name += key->GetCycle();
749 }
750
751 fIconBox->GetObjPictures(&pic, &spic, obj, obj->GetIconName() ?
752 obj->GetIconName() : cl->GetName());
753
754 fi = new TRootObjItem((const TGWindow*)fIconBox, pic, spic, new TGString(name.Data()),
755 obj, cl, (EListViewMode)fIconBox->GetViewMode());
756 fi->SetUserData(obj);
757 fIconBox->AddItem(fi);
758 fIconBox->fTotal++;
759
760 if (obj==fIconBox->fActiveObject) {
761 fIconBox->ActivateItem((TGFrameElement*)fIconBox->fList->Last());
762 }
763 }
764
765 fIconBox->fGarbage->Remove(this);
766 fIconBox->RemoveGarbage();
767 fIconBox->fGarbage->Add(this); // delete this later
768
769 fIconBox->Refresh();
770 fIconBox->AdjustPosition();
771
772 fIconBox->fWasGrouped = kTRUE;
773}
774
775////////////////////////////////////////////////////////////////////////////////
776/// Find a frame which assosiated object has a name containing a "name" string.
777
778void *TRootIconBox::FindItem(const TString& name, Bool_t direction,
779 Bool_t caseSensitive,Bool_t beginWith)
780{
781 if (!fGrouped) {
782 return TGContainer::FindItem(name, direction, caseSensitive, beginWith);
783 }
784
785 if (name.IsNull()) return 0;
786 int idx = kNPOS;
787
788 TGFrameElement* el = 0;
789 TString str;
791
792 fLastDir = direction;
793 fLastCase = caseSensitive;
794 fLastName = name;
795
796 if (fLastActiveEl) {
797 el = fLastActiveEl;
798
799 if (direction) {
800 el = (TGFrameElement *)fList->After(el);
801 } else {
802 el = (TGFrameElement *)fList->Before(el);
803 }
804 } else {
805 if (direction) el = (TGFrameElement *)fList->First();
806 else el = (TGFrameElement *)fList->Last();
807 }
808
809 TGLVEntry* lv = 0;
810 TObject* obj = 0;
811 TList* li = 0;
812
813 while (el) {
814 lv = (TGLVEntry*)el->fFrame;
815 li = (TList*)lv->GetUserData();
816
817 TIter next(li);
818
819 while ((obj=next())) {
820 str = obj->GetName();
821 idx = str.Index(name,0,cmp);
822
823 if (idx!=kNPOS) {
824 if (beginWith) {
825 if (idx==0) {
826 fActiveObject = obj;
827 return el;
828 }
829 } else {
830 fActiveObject = obj;
831 return el;
832 }
833 }
834 }
835 if (direction) {
836 el = (TGFrameElement *)fList->After(el);
837 } else {
838 el = (TGFrameElement *)fList->Before(el);
839 }
840 }
841 fActiveObject = 0;
842 return 0;
843}
844
845////////////////////////////////////////////////////////////////////////////////
846/// Set list box headers used to display detailed object iformation.
847/// Currently this is only "Name" and "Title".
848
849void TRootIconBox::SetObjHeaders()
850{
853 fListView->SetHeader("Title", kTextLeft, kTextLeft, 1);
854}
855
856////////////////////////////////////////////////////////////////////////////////
857/// Sort icons, and send message to browser with number of objects
858/// in box.
859
860void TRootIconBox::Refresh()
861{
862 // This automatically calls layout
863 Sort(fSortType);
864
865 // Make TRootBrowserLite display total objects in status bar
866 SendMessage(fMsgWindow, MK_MSG(kC_CONTAINER, kCT_SELCHANGED), fTotal, fSelected);
867
870}
871
872////////////////////////////////////////////////////////////////////////////////
873/// Remove all items from icon box
874
875void TRootIconBox::RemoveAll()
876{
877 if (fIsEmpty) return;
878
879 fCheckHeaders = kTRUE;
881 fGrouped = kFALSE;
882 fCurrentItem = 0;
883 fCurrentList = 0;
884 fIsEmpty = kTRUE;
885}
886
887
888//_____________________________________________________________________________
889//
890// TRootBrowserLite
891//
892// ROOT object browser (looking like Windows Explorer).
893//_____________________________________________________________________________
894
896
897////////////////////////////////////////////////////////////////////////////////
898/// Create browser with a specified width and height.
899
901 : TGMainFrame(gClient->GetDefaultRoot(), width, height), TBrowserImp(b)
902{
904
905 Resize(width, height);
906 if (b) Show();
907}
908
909////////////////////////////////////////////////////////////////////////////////
910/// Create browser with a specified width and height and at position x, y.
911
913 UInt_t width, UInt_t height)
914 : TGMainFrame(gClient->GetDefaultRoot(), width, height), TBrowserImp(b)
915{
917
918 MoveResize(x, y, width, height);
919 SetWMPosition(x, y);
920 if (b) Show();
921}
922
923////////////////////////////////////////////////////////////////////////////////
924/// Browser destructor.
925
927{
928 if (fIconPic) gClient->FreePicture(fIconPic);
929
930 delete fToolBarSep;
931
932 fToolBar->Cleanup();
933 delete fToolBar;
934 delete fStatusBar;
935 delete fV1;
936 delete fV2;
937 delete fLbl1;
938 delete fLbl2;
939 delete fHf;
940 delete fTreeHdr;
941 delete fListHdr;
942 delete fIconBox;
943 delete fListView;
944 delete fLt;
945 delete fTreeView;
946
947 delete fMenuBar;
948 delete fFileMenu;
949 delete fViewMenu;
950 delete fOptionMenu;
951 delete fHelpMenu;
952 delete fSortMenu;
953
954 delete fMenuBarLayout;
955 delete fMenuBarItemLayout;
956 delete fMenuBarHelpLayout;
957 delete fBarLayout;
958
959 delete fTextEdit;
960
961 if (fWidgets) fWidgets->Delete();
962 delete fWidgets;
963
964 fHistory->Delete();
965 delete fHistory;
966}
967
968////////////////////////////////////////////////////////////////////////////////
969/// Create the actual browser.
970
972{
973 fWidgets = new TList;
974 fHistory = new TRootBrowserHistory;
975 fHistoryCursor = 0;
977
978 // Create menus
980 fFileMenu->AddEntry("&New Browser", kFileNewBrowser);
981 fFileMenu->AddEntry("New Browser &Lite", kFileNewBrowserLite);
982 fFileMenu->AddEntry("New Canvas", kFileNewCanvas);
983 fFileMenu->AddEntry("&Gui Builder", kFileNewBuilder);
984 fFileMenu->AddEntry("&Open...", kFileOpen);
986 fFileMenu->AddEntry("&Save", kFileSave);
987 fFileMenu->AddEntry("Save &As...", kFileSaveAs);
989 fFileMenu->AddEntry("&Print...", kFilePrint);
991 fFileMenu->AddEntry("&Close Browser", kFileCloseBrowser);
993 fFileMenu->AddEntry("&Quit ROOT", kFileQuit);
994
995 //fFileMenu->DefaultEntry(kFileNewCanvas);
999
1006 fSortMenu->AddEntry("&Auto Arrange", kViewArrangeAuto);
1007
1009
1011 fViewMenu->AddEntry("&Toolbar", kViewToolBar);
1012 fViewMenu->AddEntry("Status &Bar", kViewStatusBar);
1014 fViewMenu->AddEntry("Lar&ge Icons", kViewLargeIcons);
1015 fViewMenu->AddEntry("S&mall Icons", kViewSmallIcons);
1016 fViewMenu->AddEntry("&List", kViewList);
1017 fViewMenu->AddEntry("&Details", kViewDetails);
1019 fViewMenu->AddEntry("Show &Hidden", kViewHidden);
1020 fViewMenu->AddPopup("Arrange &Icons", fSortMenu);
1021 fViewMenu->AddEntry("Lin&e up Icons", kViewLineUp);
1022 fViewMenu->AddEntry("&Group Icons", kViewGroupLV);
1023
1025 fViewMenu->AddEntry("&Refresh (F5)", kViewRefresh);
1026
1029
1030 if (fBrowser) {
1031 if (gEnv->GetValue("Browser.ShowHidden", 0)) {
1034 } else {
1037 }
1038 }
1039
1041 fOptionMenu->AddEntry("&Show Cycles", kOptionShowCycles);
1042 fOptionMenu->AddEntry("&AutoThumbnail", kOptionAutoThumbnail);
1043
1045 fHelpMenu->AddEntry("&About ROOT...", kHelpAbout);
1047 fHelpMenu->AddEntry("Help On Browser...", kHelpOnBrowser);
1048 fHelpMenu->AddEntry("Help On Canvas...", kHelpOnCanvas);
1049 fHelpMenu->AddEntry("Help On Menus...", kHelpOnMenus);
1050 fHelpMenu->AddEntry("Help On Graphics Editor...", kHelpOnGraphicsEd);
1051 fHelpMenu->AddEntry("Help On Objects...", kHelpOnObjects);
1052 fHelpMenu->AddEntry("Help On PostScript...", kHelpOnPS);
1053 fHelpMenu->AddEntry("Help On Remote Session...", kHelpOnRemote);
1054
1055 // This main frame will process the menu commands
1056 fFileMenu->Associate(this);
1057 fViewMenu->Associate(this);
1058 fSortMenu->Associate(this);
1059 fOptionMenu->Associate(this);
1060 fHelpMenu->Associate(this);
1061
1062 // Create menubar layout hints
1066
1067 // Create menubar
1068 fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
1073
1075
1076 // Create toolbar and separator
1077
1078 fToolBarSep = new TGHorizontal3DLine(this);
1079 fToolBar = new TGToolBar(this, 60, 20, kHorizontalFrame);
1081
1085 fFSComboBox->Associate(this);
1086
1087 int spacing = 8;
1088
1089 for (int i = 0; gToolBarData[i].fPixmap; i++) {
1090 if (strlen(gToolBarData[i].fPixmap) == 0) {
1091 spacing = 8;
1092 continue;
1093 }
1094 fToolBar->AddButton(this, &gToolBarData[i], spacing);
1095 spacing = 0;
1096 }
1097
1098 fDrawOption = new TGComboBox(fToolBar, "");
1099 TGTextEntry *dropt_entry = fDrawOption->GetTextEntry();
1100 dropt_entry->SetToolTipText("Object Draw Option", 300);
1101 fDrawOption->Resize(80, 10);
1103 lb->Resize(lb->GetWidth(), 120);
1104 Int_t dropt = 1;
1105 fDrawOption->AddEntry("", dropt++);
1106 fDrawOption->AddEntry("same", dropt++);
1107 fDrawOption->AddEntry("box", dropt++);
1108 fDrawOption->AddEntry("lego", dropt++);
1109 fDrawOption->AddEntry("colz", dropt++);
1110 fDrawOption->AddEntry("alp", dropt++);
1111 fDrawOption->AddEntry("text", dropt++);
1112
1114 fToolBar->AddFrame(new TGLabel(fToolBar,"Option"),
1115 new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2,2,2,0));
1116
1120
1121 // Create panes
1122
1123 fHf = new TGHorizontalFrame(this, 10, 10);
1124
1125 fV1 = new TGVerticalFrame(fHf, 10, 10, kFixedWidth);
1126 fV2 = new TGVerticalFrame(fHf, 10, 10);
1127 fTreeHdr = new TGCompositeFrame(fV1, 10, 10, kSunkenFrame);
1128 fListHdr = new TGCompositeFrame(fV2, 10, 10, kSunkenFrame);
1129
1130 fLbl1 = new TGLabel(fTreeHdr, "All Folders");
1131 fLbl2 = new TGLabel(fListHdr, "Contents of \".\"");
1132
1133 TGLayoutHints *lo;
1134
1135 lo = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 0, 0, 0);
1136 fWidgets->Add(lo);
1137 fTreeHdr->AddFrame(fLbl1, lo);
1138 fListHdr->AddFrame(fLbl2, lo);
1139
1140 lo = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0, 0, 1, 2);
1141 fWidgets->Add(lo);
1142 fV1->AddFrame(fTreeHdr, lo);
1143 fV2->AddFrame(fListHdr, lo);
1144
1146
1148 fWidgets->Add(lo);
1149 fHf->AddFrame(fV1, lo);
1150
1152 splitter->SetFrame(fV1, kTRUE);
1155 fWidgets->Add(lo);
1156 fHf->AddFrame(splitter, lo);
1157
1159 fWidgets->Add(lo);
1160 fHf->AddFrame(fV2, lo);
1161
1162 // Create tree
1163 fTreeView = new TGCanvas(fV1, 10, 10, kSunkenFrame | kDoubleBorder); // canvas
1165 fLt->Associate(this);
1166 fLt->SetAutoTips();
1167
1171
1172 // Create list view (icon box)
1173 fListView = new TGListView(fV2, 520, 250); // canvas
1174 // container
1176 fIconBox->Associate(this);
1177 fListView->SetIncrements(1, 19); // set vertical scroll one line height at a time
1179
1180 TString str = gEnv->GetValue("Browser.AutoThumbnail", "yes");
1181 str.ToLower();
1182 fIconBox->fAutoThumbnail = (str == "yes") || atoi(str.Data());
1185
1186 str = gEnv->GetValue("Browser.GroupView", "10000");
1187 Int_t igv = atoi(str.Data());
1188
1189 if (igv>10) {
1191 fIconBox->SetGroupSize(igv);
1192 }
1193
1194 // reuse lo from "create tree"
1196
1197 AddFrame(fHf, lo);
1198
1199 // Statusbar
1200
1201 int parts[] = { 26, 74 };
1202 fStatusBar = new TGStatusBar(this, 60, 10);
1203 fStatusBar->SetParts(parts, 2);
1204 lo = new TGLayoutHints(kLHintsBottom | kLHintsExpandX, 0, 0, 3, 0);
1205 AddFrame(fStatusBar, lo);
1206
1207 fTextEdit = 0;
1208
1209 // Misc
1210 TString bname(name);
1211 bname.Prepend("Old ");
1212 SetWindowName(bname.Data());
1213 SetIconName(bname.Data());
1214 fIconPic = SetIconPixmap("rootdb_s.xpm");
1215 SetClassHints("ROOT", "Browser");
1216
1217 SetWMSizeHints(600, 350, 10000, 10000, 2, 2);
1218
1219 fListLevel = 0;
1220 fTreeLock = kFALSE;
1221
1222 gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Escape), 0, kTRUE);
1223 gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_F5), 0, kTRUE);
1224 gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Right), kKeyMod1Mask, kTRUE);
1225 gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Left), kKeyMod1Mask, kTRUE);
1226 ClearHistory();
1228
1229 gVirtualX->SetDNDAware(fId, fDNDTypeList);
1230 MapSubwindows();
1231 SetDefaults();
1232 Resize();
1234
1235 printf("\n You are using the old ROOT browser! A new version is available. To use it:\n");
1236 printf(" Select the \"New Browser\" entry from the \"File\" menu in the browser, or change\n");
1237 printf(" \"Browser.Name:\" from \"TRootBrowserLite\" to \"TRootBrowser\" in system.rootrc\n\n");
1238
1239 Connect(fLt, "Checked(TObject*, Bool_t)", "TRootBrowserLite",
1240 this, "Checked(TObject *,Bool_t)");
1241}
1242
1243////////////////////////////////////////////////////////////////////////////////
1244/// handle keys
1245
1247{
1248 if (event->fType == kGKeyPress) {
1249 UInt_t keysym;
1250 char input[10];
1251 gVirtualX->LookupString(event, input, sizeof(input), keysym);
1252
1253 if (!event->fState && (EKeySym)keysym == kKey_F5) {
1254 Refresh(kTRUE);
1255 return kTRUE;
1256 }
1257 if (!event->fState && (EKeySym)keysym == kKey_Escape) {
1259 }
1260
1261 if (event->fState & kKeyMod1Mask) {
1262 switch ((EKeySym)keysym & ~0x20) {
1263 case kKey_Right:
1265 return kTRUE;
1266 case kKey_Left:
1268 return kTRUE;
1269 default:
1270 break;
1271 }
1272 }
1273 }
1274 return TGMainFrame::HandleKey(event);
1275}
1276
1277////////////////////////////////////////////////////////////////////////////////
1278/// Add items to the browser. This function has to be called
1279/// by the Browse() member function of objects when they are
1280/// called by a browser. If check < 0 (default) no check box is drawn,
1281/// if 0 then unchecked checkbox is added, if 1 checked checkbox is added.
1282
1283void TRootBrowserLite::Add(TObject *obj, const char *name, Int_t check)
1284{
1285 if (!obj)
1286 return;
1287 if (obj->InheritsFrom("TObjectSpy"))
1288 return;
1289 if (!name) name = obj->GetName();
1290
1291 AddToBox(obj, name);
1292 if (check > -1) {
1293 TGFrameElement *el;
1294 TIter next(fIconBox->fList);
1295 if (!obj->IsFolder()) {
1296 while ((el = (TGFrameElement *) next())) {
1297 TGLVEntry *f = (TGLVEntry *) el->fFrame;
1298 if (f->GetUserData() == obj) {
1299 f->SetCheckedEntry(check);
1300 }
1301 }
1302 }
1303 }
1304
1305 // Don't show current dir and up dir links in the tree
1306 if (name[0] == '.' && ((name[1] == '\0') || (name[1] == '.' && name[2] == '\0')))
1307 return;
1308
1309 if (obj->IsFolder())
1310 AddToTree(obj, name, check);
1311}
1312
1313////////////////////////////////////////////////////////////////////////////////
1314/// Add a checkbox in the TGListTreeItem corresponding to obj
1315/// and a checkmark on TGLVEntry if check = kTRUE.
1316
1318{
1319 if (obj) {
1321 while (item) {
1322 fLt->SetCheckBox(item, kTRUE);
1323 fLt->CheckItem(item, check);
1324 item = fLt->FindItemByObj(item->GetNextSibling(), obj);
1325 }
1326 TGFrameElement *el;
1327 TIter next(fIconBox->fList);
1328 while ((el = (TGFrameElement *) next())) {
1329 TGLVEntry *f = (TGLVEntry *) el->fFrame;
1330 if (f->GetUserData() == obj) {
1331 f->SetCheckedEntry(check);
1332 }
1333 }
1334 }
1335}
1336
1337////////////////////////////////////////////////////////////////////////////////
1338/// Check / uncheck the TGListTreeItem corresponding to this
1339/// object and add a checkmark on TGLVEntry if check = kTRUE.
1340
1342{
1343 if (obj) {
1345 while (item) {
1346 fLt->CheckItem(item, check);
1347 item = fLt->FindItemByObj(item->GetNextSibling(), obj);
1348 TGFrameElement *el;
1349 TIter next(fIconBox->fList);
1350 if (!obj->IsFolder()) {
1351 while ((el = (TGFrameElement *) next())) {
1352 TGLVEntry *f = (TGLVEntry *) el->fFrame;
1353 if (f->GetUserData() == obj) {
1354 f->SetCheckedEntry(check);
1355 }
1356 }
1357 }
1358 }
1359 }
1360}
1361
1362////////////////////////////////////////////////////////////////////////////////
1363/// Remove checkbox from TGListTree and checkmark from TGListView.
1364
1366{
1367 if (obj) {
1369 while (item) {
1370 fLt->SetCheckBox(item, kFALSE);
1371 item = fLt->FindItemByObj(item->GetNextSibling(), obj);
1372 TGFrameElement *el;
1373 TIter next(fIconBox->fList);
1374 if (!obj->IsFolder()) {
1375 while ((el = (TGFrameElement *) next())) {
1376 TGLVEntry *f = (TGLVEntry *) el->fFrame;
1377 if (f->GetUserData() == obj) {
1378 f->SetCheckedEntry(kFALSE);
1379 }
1380 }
1381 }
1382 }
1383 }
1384}
1385
1386////////////////////////////////////////////////////////////////////////////////
1387/// Add items to the iconbox of the browser.
1388
1390{
1391 if (obj) {
1392 if (!name) name = obj->GetName() ? obj->GetName() : "NoName";
1393 //const char *titlePtr = obj->GetTitle() ? obj->GetTitle() : " ";
1394
1395 TClass *objClass = 0;
1396
1397 if (obj->IsA() == TKey::Class())
1398 objClass = TClass::GetClass(((TKey *)obj)->GetClassName());
1399 else if (obj->IsA() == TKeyMapFile::Class())
1400 objClass = TClass::GetClass(((TKeyMapFile *)obj)->GetTitle());
1401 else if (obj->InheritsFrom("TRemoteObject")) {
1402 // special case for remote object: get real object class
1403 TRemoteObject *robj = (TRemoteObject *)obj;
1404 if (!strcmp(robj->GetClassName(), "TKey"))
1405 objClass = TClass::GetClass(robj->GetKeyClassName());
1406 else
1407 objClass = TClass::GetClass(robj->GetClassName());
1408 }
1409 else
1410 objClass = obj->IsA();
1411
1412 fIconBox->AddObjItem(name, obj, objClass);
1413 }
1414}
1415
1416////////////////////////////////////////////////////////////////////////////////
1417/// Add items to the current TGListTree of the browser.
1418
1419void TRootBrowserLite::AddToTree(TObject *obj, const char *name, Int_t check)
1420{
1421 if (!obj)
1422 return;
1423 if (obj->InheritsFrom("TApplication"))
1424 fListLevel = 0;
1425 if (!fTreeLock) {
1426 if (!name) name = obj->GetName();
1427 if (name[0] == '.' && name[1] == '.')
1428 Info("AddToTree", "up one level %s", name);
1429 if(check > -1) {
1430 TGListTreeItem *item = fLt->AddItem(fListLevel, name, obj, 0, 0, kTRUE);
1431 if (item) fLt->CheckItem(item, (Bool_t)check);
1432 TString tip(obj->ClassName());
1433 if (obj->GetTitle()) {
1434 tip += " ";
1435 tip += obj->GetTitle();
1436 }
1437 fLt->SetToolTipItem(item, tip.Data());
1438 } else {
1439 // special case for remote object
1440 if (obj->InheritsFrom("TRemoteObject")) {
1441 // Nothing to do
1442 } else if (fListLevel) {
1443 // check also if one of its parents is a remote object
1445 while (top->GetParent()) {
1446 TObject *tobj = (TObject *) top->GetUserData();
1447 if (tobj && (tobj->InheritsFrom("TRemoteObject") ||
1448 tobj->InheritsFrom("TApplicationRemote"))) {
1449 break;
1450 }
1451 top = top->GetParent();
1452 }
1453 }
1454 // add the object only if not already in the list
1455 if ((!fLt->FindChildByName(fListLevel, name)) &&
1456 (!fLt->FindChildByData(fListLevel, obj))) {
1458 Long64_t bsize, fsize, objsize = 0;
1459 TString objinfo = obj->GetObjectInfo(1, 1);
1460 TString infos = obj->GetName();
1461 infos += "\n";
1462 infos += obj->GetTitle();
1463 if (!objinfo.IsNull() && !objinfo.BeginsWith("x=")) {
1464 objsize = objinfo.Atoll();
1465 if (objsize > 0) {
1466 infos += "\n";
1467 bsize = fsize = objsize;
1468 if (fsize > 1024) {
1469 fsize /= 1024;
1470 if (fsize > 1024) {
1471 // 3.7MB is more informative than just 3MB
1472 infos += TString::Format("Size: %lld.%lldM", fsize/1024,
1473 (fsize%1024)/103);
1474 } else {
1475 infos += TString::Format("Size: %lld.%lldK", bsize/1024,
1476 (bsize%1024)/103);
1477 }
1478 } else {
1479 infos += TString::Format("Size: %lld bytes", bsize);
1480 }
1481 }
1482 }
1483 if (it)
1484 it->SetTipText(infos.Data());
1485 }
1486 }
1487 }
1488}
1489
1490////////////////////////////////////////////////////////////////////////////////
1491/// Browse object. This, in turn, will trigger the calling of
1492/// TRootBrowserLite::Add() which will fill the IconBox and the tree.
1493/// Emits signal "BrowseObj(TObject*)".
1494
1496{
1497 TGPosition pos = fIconBox->GetPagePosition();
1498 Emit("BrowseObj(TObject*)", (Long_t)obj);
1499
1500 if (obj != gROOT) {
1501 if (!fLt->FindItemByObj(fLt->GetFirstItem(), obj)) {
1502 fListLevel = 0;
1503 Add(obj);
1506 if (obj->IsFolder())
1508 fLt->ClearViewPort();
1510 }
1511 }
1512
1513 if (obj->IsFolder()) fIconBox->RemoveAll();
1514 obj->Browse(fBrowser);
1515 if ((fListLevel && obj->IsFolder()) || (!fListLevel && (obj == gROOT))) {
1516 fIconBox->Refresh();
1517 }
1518
1519 if (fBrowser) {
1521 }
1523
1524 fIconBox->SetHsbPosition(pos.fX);
1525 fIconBox->SetVsbPosition(pos.fY);
1526}
1527
1528////////////////////////////////////////////////////////////////////////////////
1529/// add new draw option to the "history"
1530
1532{
1533 TString opt = GetDrawOption();
1536
1537 TIter next(lbc->GetList());
1538 TGFrameElement *el;
1539
1540 while ((el = (TGFrameElement *)next())) {
1541 TGTextLBEntry *lbe = (TGTextLBEntry *)el->fFrame;
1542 if (lbe->GetText()->GetString() == opt) {
1543 return;
1544 }
1545 }
1546
1548 fDrawOption->AddEntry(opt.Data(), nn);
1549 fDrawOption->Select(nn);
1550}
1551
1552////////////////////////////////////////////////////////////////////////////////
1553/// returns pointer to fIconBox object
1554
1556{
1557 return (TGFileContainer*)fIconBox;
1558}
1559
1560////////////////////////////////////////////////////////////////////////////////
1561/// Really delete the browser and the this GUI.
1562
1564{
1566 delete this;
1567}
1568
1569////////////////////////////////////////////////////////////////////////////////
1570/// In case window is closed via WM we get here.
1571
1573{
1574 DeleteWindow();
1575}
1576
1577////////////////////////////////////////////////////////////////////////////////
1578/// Display in statusbar total number of objects and number of
1579/// selected objects in IconBox.
1580
1582{
1583 char tmp[64];
1584 const char *fmt;
1585
1586 if (selected)
1587 fmt = "%d Object%s, %d selected.";
1588 else
1589 fmt = "%d Object%s.";
1590
1591 snprintf(tmp, 64, fmt, total, (total == 1) ? "" : "s", selected);
1592 fStatusBar->SetText(tmp, 0);
1593}
1594
1595////////////////////////////////////////////////////////////////////////////////
1596/// Display current directory in second label, fLbl2.
1597
1599{
1600 char *p, path[1024];
1601
1603 p = path;
1604 while (*p && *(p+1) == '/') ++p;
1605 if (!p[0])
1606 fLbl2->SetText(new TGString("Contents of \".\""));
1607 else
1608 fLbl2->SetText(new TGString(Form("Contents of \"%s\"", p)));
1609 fListHdr->Layout();
1610
1611 // Get full pathname for FS combobox (previously truncated to 12 levels deep)
1613 p = path;
1614 while (*p && *(p+1) == '/') ++p;
1615 fFSComboBox->Update(p);
1616
1617 if (fListLevel) {
1618 // disable/enable up level navigation
1620 const char *dirname = gSystem->DirName(p);
1621 Bool_t disableUp;
1622
1624 disableUp = (strlen(dirname) == 1) && (*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 TIconBoxThumb *thumb = 0;
1706 TString path = gSystem->IsAbsoluteFileName(sf->GetName()) ? sf->GetName() :
1708
1709 thumb = (TIconBoxThumb*)fIconBox->fThumbnails->FindObject(path);
1710
1711 if (thumb) {
1712 spic = thumb->fSmall;
1713 pic = thumb->fLarge;
1714 } else {
1715 TImage *img = TImage::Create();
1716 nowp->Modified();
1717 nowp->Update();
1718 img->FromPad(nowp);
1719
1720 if (!img->IsValid()) {
1721 return;
1722 }
1723
1724 static const UInt_t sz = 72;
1725 UInt_t w = sz;
1726 UInt_t h = sz;
1727
1728 if (img->GetWidth() > img->GetHeight()) {
1729 h = (img->GetHeight()*sz)/img->GetWidth();
1730 } else {
1731 w = (img->GetWidth()*sz)/img->GetHeight();
1732 }
1733
1734 w = w < 54 ? 54 : w;
1735 h = h < 54 ? 54 : h;
1736
1737 img->Scale(w, h);
1738 img->Merge(img, "tint"); // contrasting
1739 img->DrawBox(0, 0, w, h, "#ffff00", 1); // yellow frame
1740
1741 pic = fClient->GetPicturePool()->GetPicture(path.Data(), img->GetPixmap(), 0);
1742 img->Scale(w/3, h/3);
1743 spic = fClient->GetPicturePool()->GetPicture(path.Data(), img->GetPixmap(), 0);
1744
1745 thumb = new TIconBoxThumb(path.Data(), spic, pic);
1746 fIconBox->fThumbnails->Add(thumb);
1747 delete img;
1748 }
1749 }
1750 return;
1751 }
1752
1753 // For other objects the default action is still hard coded in
1754 // their Browse() member function.
1755}
1756
1757////////////////////////////////////////////////////////////////////////////////
1758/// Handle menu and other command generated by the user.
1759
1761{
1762 TRootHelpDialog *hd;
1763 TRootBrowserCursorSwitcher *cursorSwitcher = 0;
1764 TDirectory *tdir = 0;
1765 TString cmd;
1766
1767 if (GET_SUBMSG(msg) != kCT_SELCHANGED) {
1768 cursorSwitcher = new TRootBrowserCursorSwitcher(fIconBox, fLt);
1769 }
1770
1771 TObject *obj;
1772 TGListTreeItem *item = 0;
1773
1774 gVirtualX->Update();
1775
1776 switch (GET_MSG(msg)) {
1777
1778 case kC_COMMAND:
1779
1780 switch (GET_SUBMSG(msg)) {
1781
1782 case kCM_BUTTON:
1783 // fallthrough
1784 case kCM_MENU:
1785
1786 switch ((ERootBrowserCommands)parm1) {
1787 // Handle File menu items...
1789 new TBrowser("Browser", "ROOT Object Browser");
1790 break;
1791 case kFileNewBrowser:
1792 gEnv->SetValue("Browser.Name", "TRootBrowser");
1793 new TBrowser();
1794 gEnv->SetValue("Browser.Name", "TRootBrowserLite");
1795 break;
1796 case kFileNewCanvas:
1797 gROOT->MakeDefCanvas();
1798 break;
1799 case kFileNewBuilder:
1801 break;
1802 case kFileOpen:
1803 {
1804 static TString dir(".");
1805 TGFileInfo fi;
1807 fi.fIniDir = StrDup(dir);
1808 new TGFileDialog(fClient->GetDefaultRoot(), this,
1809 kFDOpen,&fi);
1810 dir = fi.fIniDir;
1811 if (fi.fMultipleSelection && fi.fFileNamesList) {
1812 TObjString *el;
1813 TIter next(fi.fFileNamesList);
1814 while ((el = (TObjString *) next())) {
1815 new TFile(el->GetString(), "update");
1816 }
1817 }
1818 else if (fi.fFilename) {
1819 new TFile(fi.fFilename, "update");
1820 }
1821 }
1822 break;
1823 case kFileSave:
1824 case kFileSaveAs:
1825 break;
1826 case kFilePrint:
1827 break;
1828 case kFileCloseBrowser:
1830 break;
1831 case kFileQuit:
1833 break;
1834
1835 // Handle View menu items...
1836 case kViewToolBar:
1839 else
1840 ShowToolBar();
1841 break;
1842 case kViewStatusBar:
1845 else
1846 ShowStatusBar();
1847 break;
1848 case kViewLargeIcons:
1849 case kViewSmallIcons:
1850 case kViewList:
1851 case kViewDetails:
1852 SetViewMode((Int_t)parm1);
1853 break;
1854 case kViewHidden:
1858 } else {
1861 }
1862 Refresh(kTRUE);
1863 break;
1864 case kViewArrangeByName:
1865 case kViewArrangeByType:
1866 case kViewArrangeBySize:
1867 case kViewArrangeByDate:
1868 SetSortMode((Int_t)parm1);
1869 break;
1870 case kViewLineUp:
1871 break;
1872 case kViewRefresh:
1873 Refresh(kTRUE);
1874 break;
1875 case kViewGroupLV:
1878 TString gv = gEnv->GetValue("Browser.GroupView", "10000");
1879 Int_t igv = atoi(gv.Data());
1880
1881 if (igv > 10) {
1882 fIconBox->SetGroupSize(igv);
1883 }
1884 } else {
1886 fIconBox->SetGroupSize(10000000); // very large value
1887 }
1888 break;
1889
1890 // Handle Option menu items...
1891 case kOptionShowCycles:
1892 printf("Currently the browser always shows all cycles\n");
1893 break;
1894
1898 fIconBox->fThumbnails->Delete();
1899 fIconBox->fAutoThumbnail = kFALSE;
1900 Refresh(kTRUE);
1901 } else {
1903 fIconBox->fAutoThumbnail = kTRUE;
1904 }
1905 break;
1906
1907 // Handle toolbar button...
1908 case kOneLevelUp:
1909 {
1910 if (fBrowseTextFile) {
1911 HideTextEdit();
1912 break;
1913 }
1914 if (!fListLevel || !fListLevel->IsActive()) break;
1915
1916 if (fListLevel && fIconBox->WasGrouped()) {
1917 if (fListLevel) {
1918 item = fListLevel->GetParent();
1919 if (item) fListLevel = item;
1920 obj = (TObject *) fListLevel->GetUserData();
1922 if (obj) BrowseObj(obj);
1923 }
1924
1926 break;
1927 }
1928 if (fListLevel) item = fListLevel->GetParent();
1929
1930
1931 if (item) {
1932 fListLevel = item;
1933 obj = (TObject *)fListLevel->GetUserData();
1936 if (obj) BrowseObj(obj);
1938 } else {
1939 obj = (TObject *)fListLevel->GetUserData();
1940 if (obj) ToSystemDirectory(gSystem->DirName(obj->GetTitle()));
1941 }
1942 break;
1943 }
1944
1945 // toolbar buttons
1946 case kHistoryBack:
1948 break;
1949 case kHistoryForw:
1951 break;
1952
1953 case kViewFind:
1954 Search();
1955 break;
1956
1957 // Handle Help menu items...
1958 case kHelpAbout:
1959 {
1960#ifdef R__UNIX
1961 TString rootx = TROOT::GetBinDir() + "/root -a &";
1962 gSystem->Exec(rootx);
1963#else
1964#ifdef WIN32
1966#else
1967 char str[32];
1968 sprintf(str, "About ROOT %s...", gROOT->GetVersion());
1969 hd = new TRootHelpDialog(this, str, 600, 400);
1970 hd->SetText(gHelpAbout);
1971 hd->Popup();
1972#endif
1973#endif
1974 }
1975 break;
1976 case kHelpOnCanvas:
1977 hd = new TRootHelpDialog(this, "Help on Canvas...", 600, 400);
1978 hd->SetText(gHelpCanvas);
1979 hd->Popup();
1980 break;
1981 case kHelpOnMenus:
1982 hd = new TRootHelpDialog(this, "Help on Menus...", 600, 400);
1984 hd->Popup();
1985 break;
1986 case kHelpOnGraphicsEd:
1987 hd = new TRootHelpDialog(this, "Help on Graphics Editor...", 600, 400);
1989 hd->Popup();
1990 break;
1991 case kHelpOnBrowser:
1992 hd = new TRootHelpDialog(this, "Help on Browser...", 600, 400);
1994 hd->Popup();
1995 break;
1996 case kHelpOnObjects:
1997 hd = new TRootHelpDialog(this, "Help on Objects...", 600, 400);
1998 hd->SetText(gHelpObjects);
1999 hd->Popup();
2000 break;
2001 case kHelpOnPS:
2002 hd = new TRootHelpDialog(this, "Help on PostScript...", 600, 400);
2004 hd->Popup();
2005 break;
2006 case kHelpOnRemote:
2007 hd = new TRootHelpDialog(this, "Help on Browser...", 600, 400);
2008 hd->SetText(gHelpRemote);
2009 hd->Popup();
2010 break;
2011 default:
2012 break;
2013 }
2014 break;
2015 case kCM_COMBOBOX:
2016 if (parm1 == kFSComboBox) {
2018 if (e) {
2019 const char *dirname = e->GetPath()->GetString();
2020 item = fLt->FindItemByPathname(dirname);
2021 if (item) {
2022 fListLevel = item;
2026 } else {
2027 ToSystemDirectory(dirname);
2028 }
2029 }
2030 }
2031 break;
2032 default:
2033 break;
2034 }
2035
2036 break;
2037
2038 case kC_LISTTREE:
2039 switch (GET_SUBMSG(msg)) {
2040
2041 case kCT_ITEMCLICK:
2042 // tell coverity that parm1 is a Long_t, and not an enum (even
2043 // if we compare it with an enum value) and the meaning of
2044 // parm1 depends on GET_MSG(msg) and GET_SUBMSG(msg)
2045 // coverity[mixed_enums]
2046 if (((EMouseButton)parm1 == kButton1) ||
2047 ((EMouseButton)parm1 == kButton3)) {
2048 HideTextEdit();
2049 TGListTreeItem *item2;
2050 TObject *obj2 = 0;
2051 if ((item2 = fLt->GetSelected()) != 0 ) {
2052 ListTreeHighlight(item2);
2053 fStatusBar->SetText("", 1); // clear
2054 }
2055 if (item2 && parm1 == kButton3) {
2056 Int_t x = (Int_t)(parm2 & 0xffff);
2057 Int_t y = (Int_t)((parm2 >> 16) & 0xffff);
2058 obj2 = (TObject *) item2->GetUserData();
2059 if (obj2) {
2060 if (obj2->InheritsFrom("TTree")) {
2061 // if a tree not attached to any directory (e.g. in a TFolder)
2062 // then attach it to the current directory (gDirectory)
2063 cmd = TString::Format("((TTree *)0x%lx)->GetDirectory();",
2064 (ULong_t)obj2);
2065 tdir = (TDirectory *)gROOT->ProcessLine(cmd.Data());
2066 if (!tdir) {
2067 cmd = TString::Format("((TTree *)0x%lx)->SetDirectory(gDirectory);",
2068 (ULong_t)obj2);
2069 gROOT->ProcessLine(cmd.Data());
2070 }
2071 }
2072 fBrowser->GetContextMenu()->Popup(x, y, obj2, fBrowser);
2073 }
2074 }
2077 fListView->Layout();
2078 }
2079 break;
2080
2081 case kCT_ITEMDBLCLICK:
2082 if (parm1 == kButton1) {
2083 if (fBrowseTextFile) {
2084 HideTextEdit();
2085 }
2086 if (fListLevel && fIconBox->WasGrouped()) {
2087 TObject *obj2;
2088 TGListTreeItem *item2;
2089
2090 if (fListLevel) {
2091 item2 = fListLevel->GetParent();
2092 if (item2) fListLevel = item2;
2093
2094 obj2 = (TObject *) fListLevel->GetUserData();
2096 if (obj2) {
2097 BrowseObj(obj2);
2098 }
2099 }
2100 break;
2101 }
2102 }
2103
2104 default:
2105 break;
2106 }
2107 break;
2108
2109 case kC_CONTAINER:
2110 switch (GET_SUBMSG(msg)) {
2111
2112 case kCT_ITEMCLICK:
2113 if (fIconBox->NumSelected() == 1) {
2114 // display title of selected object
2115 TGFileItem *item2;
2116 void *p = 0;
2117 if ((item2 = (TGFileItem *)fIconBox->GetNextSelected(&p)) != 0) {
2118 TObject *obj2 = (TObject *)item2->GetUserData();
2119
2120 TGListTreeItem *itm = 0;
2121 if (!fListLevel) itm = fLt->GetFirstItem();
2122 else itm = fListLevel->GetFirstChild();
2123 //Bool_t found = kFALSE;
2124
2125 while (itm) {
2126 if (itm->GetUserData() == obj2) break;
2127 itm = itm->GetNextSibling();
2128 }
2129
2130 if (itm) {
2131 if ((fListLevel && fListLevel->IsOpen()) || !fListLevel) {
2133 fLt->HighlightItem(itm);
2135 }
2136 }
2137
2138 if (obj2) fStatusBar->SetText(obj2->GetName(), 1);
2139 }
2140 }
2141 if (parm1 == kButton3) {
2142 // show context menu for selected object
2143 if (fIconBox->NumSelected() == 1) {
2144 void *p = 0;
2145 TGFileItem *item2;
2146 if ((item2 = (TGFileItem *) fIconBox->GetNextSelected(&p)) != 0) {
2147 Int_t x = (Int_t)(parm2 & 0xffff);
2148 Int_t y = (Int_t)((parm2 >> 16) & 0xffff);
2149 TObject *obj2 = (TObject *)item2->GetUserData();
2150 if (obj2) {
2151 if (obj2->IsA() == TKey::Class()) {
2152 TKey *key = (TKey*)obj2;
2153 TClass *cl = TClass::GetClass(key->GetClassName());
2154 TString name = key->GetName();
2155 name += ";";
2156 name += key->GetCycle();
2157 //void *add = gROOT->FindObject((char *) name.Data());//key->GetName());
2158 void *add = gDirectory->FindObjectAny((char *) name.Data());
2159 if (cl->IsTObject()) {
2160 obj2 = (TObject*)add; // cl->DynamicCast(TObject::Class(),startadd);
2161 item2->SetUserData(obj2);
2162 } else {
2163 Error("ProcessMessage","do not support non TObject (like %s) yet",
2164 cl->GetName());
2165 break;
2166 }
2167 }
2168 if (obj2 && obj2->InheritsFrom("TTree")) {
2169 // if a tree not attached to any directory (e.g. in a TFolder)
2170 // then attach it to the current directory (gDirectory)
2171 cmd = TString::Format("((TTree *)0x%lx)->GetDirectory();",
2172 (ULong_t)obj2);
2173 tdir = (TDirectory *)gROOT->ProcessLine(cmd.Data());
2174 if (!tdir) {
2175 cmd = TString::Format("((TTree *)0x%lx)->SetDirectory(gDirectory);",
2176 (ULong_t)obj2);
2177 gROOT->ProcessLine(cmd.Data());
2178 }
2179 }
2180 fBrowser->GetContextMenu()->Popup(x, y, obj2, fBrowser);
2181 }
2182 }
2183 }
2184 }
2185 break;
2186 case kCT_ITEMDBLCLICK:
2187 if (parm1 == kButton1) {
2188 if (fIconBox->NumSelected() == 1) {
2189 void *p = 0;
2190 TGFileItem *item2;
2191 if ((item2 = (TGFileItem *) fIconBox->GetNextSelected(&p)) != 0) {
2192 TObject *obj2 = (TObject *)item2->GetUserData();
2193 if (obj2) {
2194 DoubleClicked(obj2);
2195 IconBoxAction(obj2);
2196 }
2197 delete cursorSwitcher;
2198 return kTRUE; //
2199 }
2200 }
2201 }
2202 break;
2203 case kCT_SELCHANGED:
2204 DisplayTotal((Int_t)parm1, (Int_t)parm2);
2205 break;
2206 default:
2207 break;
2208 }
2209
2210 break;
2211
2212 default:
2213 break;
2214 }
2215
2216 delete cursorSwitcher;
2217
2219 return kTRUE;
2220}
2221
2222////////////////////////////////////////////////////////////////////////////////
2223/// Make object associated with item the current directory.
2224
2226{
2227 if (item) {
2228 TGListTreeItem *i = item;
2229 TString dir;
2230 while (i) {
2231 TObject *obj = (TObject*) i->GetUserData();
2232 if (obj) {
2233 if (obj->IsA() == TDirectoryFile::Class()) {
2234 dir = "/" + dir;
2235 dir = obj->GetName() + dir;
2236 }
2237 if (obj->IsA() == TFile::Class()) {
2238 dir = ":/" + dir;
2239 dir = obj->GetName() + dir;
2240 }
2241 if (obj->IsA() == TKey::Class()) {
2242 if (strcmp(((TKey*)obj)->GetClassName(), "TDirectoryFile") == 0) {
2243 dir = "/" + dir;
2244 dir = obj->GetName() + dir;
2245 }
2246 }
2247 }
2248 i = i->GetParent();
2249 }
2250
2251 if (gDirectory && dir.Length()) gDirectory->cd(dir.Data());
2252 }
2253}
2254
2255////////////////////////////////////////////////////////////////////////////////
2256/// helper method to track history
2257
2259{
2260 if (!fListLevel) return;
2261
2264}
2265
2266////////////////////////////////////////////////////////////////////////////////
2267/// helper method to track history
2268
2270{
2272
2273 if (!item || (fHistoryCursor &&
2274 (item == ((TRootBrowserHistoryCursor*)fHistoryCursor)->fItem))) return;
2275
2276 TRootBrowserHistoryCursor *cur = (TRootBrowserHistoryCursor*)fHistoryCursor;
2277
2278 while ((cur = (TRootBrowserHistoryCursor*)fHistory->After(fHistoryCursor))) {
2279 fHistory->Remove(cur);
2280 delete cur;
2281 }
2282
2283 cur = new TRootBrowserHistoryCursor(item);
2284 fHistory->Add(cur);
2285 fHistoryCursor = cur;
2286 btn->SetState(kButtonUp);
2287}
2288
2289////////////////////////////////////////////////////////////////////////////////
2290/// clear navigation history
2291
2293{
2294 fHistory->Delete();
2299}
2300
2301////////////////////////////////////////////////////////////////////////////////
2302/// go to the past
2303
2305{
2306 if (fBrowseTextFile) {
2307 HideTextEdit();
2308 return kFALSE;
2309 }
2310 TRootBrowserHistoryCursor *cur = (TRootBrowserHistoryCursor*)fHistory->Before(fHistoryCursor);
2313
2314 if (!cur) {
2316 return kFALSE;
2317 }
2318
2320 fHistoryCursor = cur;
2321 fListLevel = cur->fItem;
2325
2326 btn2->SetState(kButtonUp);
2327 cur = (TRootBrowserHistoryCursor*)fHistory->Before(fHistoryCursor);
2328 if (!cur) {
2330 return kFALSE;
2331 }
2332
2333 return kTRUE;
2334}
2335
2336////////////////////////////////////////////////////////////////////////////////
2337/// go to the future
2338
2340{
2341 if (fBrowseTextFile) {
2342 HideTextEdit();
2343 return kFALSE;
2344 }
2345
2346 TRootBrowserHistoryCursor *cur = (TRootBrowserHistoryCursor*)fHistory->After(fHistoryCursor);
2349
2350 if (!cur) {
2352 return kFALSE;
2353 }
2354
2356 fHistoryCursor = cur;
2357 fListLevel = cur->fItem;
2361
2362 btn2->SetState(kButtonUp);
2363
2364 cur = (TRootBrowserHistoryCursor*)fHistory->After(fHistoryCursor);
2365 if (!cur) {
2367 return kFALSE;
2368 }
2369
2370 return kTRUE;
2371}
2372
2373////////////////////////////////////////////////////////////////////////////////
2374/// delete list tree item, remove it from history
2375
2377{
2378 ((TRootBrowserHistory*)fHistory)->DeleteItem(item);
2379 fLt->DeleteItem(item);
2380}
2381
2382////////////////////////////////////////////////////////////////////////////////
2383/// Open tree item and list in iconbox its contents.
2384
2386{
2387 if (item) {
2388 TObject *obj = (TObject *) item->GetUserData();
2389
2390 if (obj) {
2391 if (obj->IsA() == TKey::Class()) {
2392
2393 TKey *key = (TKey *)obj;
2394 TString name = obj->GetName();
2395 name += ";";
2396 name += key->GetCycle();
2397 Chdir(item->GetParent());
2398 //TObject *k_obj = gROOT->FindObject(name);
2399 TObject *k_obj = gDirectory->FindObjectAny(name);
2400
2401 if (k_obj) {
2402 item->SetUserData(k_obj);
2403 obj = k_obj;
2404 }
2405 } else if (obj->InheritsFrom(TDirectoryFile::Class())) {
2406 Chdir(item->GetParent());
2407 }
2408 else if (obj->InheritsFrom("TApplicationRemote")) {
2409 if (!gApplication->GetAppRemote()) {
2410 gROOT->ProcessLine(Form(".R %s", item->GetText()));
2411 if (gApplication->GetAppRemote()) {
2412 Getlinem(kInit, TString::Format("\n%s:root [0]",
2414 }
2415 }
2416 }
2417 else if (obj->InheritsFrom("TRemoteObject")) {
2418 // special case for remote object
2419 TRemoteObject *robj = (TRemoteObject *)obj;
2420 // the real object is a TKey
2421 if (!strcmp(robj->GetClassName(), "TKey")) {
2422 TGListTreeItem *parent = item;
2423 TRemoteObject *probj = (TRemoteObject *)parent->GetUserData();
2424 // find the TFile remote object containing the TKey
2425 while ( probj && strcmp(probj->GetClassName(), "TFile")) {
2426 parent = parent->GetParent();
2427 probj = (TRemoteObject *)parent->GetUserData();
2428 }
2429 if (probj) {
2430 // remotely browse file (remotely call TFile::cd())
2433 TString::Format("((TApplicationServer *)gApplication)->BrowseFile(\"%s\");",
2434 probj->GetName()));
2435 }
2436 }
2437 }
2438 if (item->GetParent() && item->GetParent()->GetUserData() &&
2439 ((TObject *)item->GetParent()->GetUserData())->InheritsFrom("TApplicationRemote")) {
2440 // switch to remote session
2441 if (!gApplication->GetAppRemote()) {
2442 gROOT->ProcessLine(Form(".R %s", item->GetParent()->GetText()));
2443 if (gApplication->GetAppRemote()) {
2444 Getlinem(kInit, TString::Format("\n%s:root [0]",
2446 }
2447 }
2448 else if (!strcmp(item->GetText(), "ROOT Files")) {
2449 // update list of files opened in the remote session
2451 gApplication->ProcessLine("((TApplicationServer *)gApplication)->BrowseFile(0);");
2452 }
2453 }
2454 else {
2455 // check if the listtree item is from a local session or
2456 // from a remote session, then switch to the session it belongs to
2457 TGListTreeItem *top = item;
2458 while (top->GetParent()) {
2459 top = top->GetParent();
2460 }
2461 TObject *topobj = (TObject *) top->GetUserData();
2462 if (topobj && topobj->InheritsFrom("TApplicationRemote")) {
2463 // it belongs to a remote session
2464 if (!gApplication->GetAppRemote()) {
2465 // switch to remote session if not already in
2466 gROOT->ProcessLine(Form(".R %s", top->GetText()));
2467 if (gApplication->GetAppRemote()) {
2468 Getlinem(kInit, TString::Format("\n%s:root [0]",
2470 }
2471 }
2472 }
2473 else if (gApplication->GetAppRemote()) {
2474 // switch back to local session if not already in
2476 Getlinem(kInit, "\nroot [0]");
2477 }
2478 }
2479
2480 if (!fListLevel || !fListLevel->IsActive()) {
2481 fListLevel = item;
2482 BrowseObj(obj);
2484 }
2485 }
2487 }
2488}
2489
2490////////////////////////////////////////////////////////////////////////////////
2491/// display directory
2492
2494{
2495 TString dir = dirname;
2496
2497 if (fListLevel) {
2499
2500 if (obj && (obj->IsA() == TSystemDirectory::Class())) {
2501 TObject* old = obj;
2502 fListLevel->Rename(dir.Data());
2503 obj = new TSystemDirectory(dir.Data(), dir.Data());
2504 while (fListLevel->GetFirstChild())
2507
2508 fListLevel->SetUserData(obj);
2509 gROOT->GetListOfBrowsables()->Remove(old);
2510 delete old;
2511 gROOT->GetListOfBrowsables()->Add(obj);
2512 fTreeLock = kTRUE;
2513 BrowseObj(obj);
2514 fTreeLock = kFALSE;
2515
2519 //gSystem->ChangeDirectory(dir.Data());
2520 fStatusBar->SetText(dir.Data(), 1);
2521 ClearHistory(); // clear browsing history
2522 }
2523 }
2524 return;
2525}
2526
2527////////////////////////////////////////////////////////////////////////////////
2528/// sets drawing option
2529
2531{
2532 fDrawOption->GetTextEntry()->SetText(option);
2533}
2534
2535////////////////////////////////////////////////////////////////////////////////
2536/// returns drawing option
2537
2539{
2540 return fDrawOption->GetTextEntry()->GetText();
2541}
2542////////////////////////////////////////////////////////////////////////////////
2543/// Emits signal when double clicking on icon.
2544
2546{
2547 Emit("DoubleClicked(TObject*)", (Long_t)obj);
2548}
2549
2550////////////////////////////////////////////////////////////////////////////////
2551/// Emits signal when double clicking on icon.
2552
2554{
2555 Long_t args[2];
2556
2557 args[0] = (Long_t)obj;
2558 args[1] = checked;
2559
2560 Emit("Checked(TObject*,Bool_t)", args);
2561}
2562
2563////////////////////////////////////////////////////////////////////////////////
2564/// Default action when double clicking on icon.
2565
2567{
2568 Bool_t browsable = kFALSE;
2569 const char *dirname = 0;
2570 if (obj) {
2571
2572 TRootBrowserCursorSwitcher cursorSwitcher(fIconBox, fLt);
2573
2574 Bool_t useLock = kTRUE;
2575
2576 if (obj->IsA()->GetMethodWithPrototype("Browse", "TBrowser*"))
2577 browsable = kTRUE;
2578
2579 if (obj->InheritsFrom("TLeaf")) {
2580 TObject *dir = (TObject *)gROOT->ProcessLine(Form("((%s *)0x%lx)->GetBranch()->GetDirectory();",
2581 obj->ClassName(), (ULong_t)obj));
2582 if (!dir) {
2583 browsable = kFALSE;
2584 }
2585 }
2586 if (obj->InheritsFrom("TBranchElement")) {
2587 TObject *dir = (TObject *)gROOT->ProcessLine(Form("((%s *)0x%lx)->GetDirectory();",
2588 obj->ClassName(), (ULong_t)obj));
2589 if (!dir) {
2590 browsable = kFALSE;
2591 }
2592 }
2593
2594 if (obj->InheritsFrom("TKey")) {
2595 TKey *key = dynamic_cast<TKey*>(obj);
2596 if (key && key->GetClassName() && (!strcmp(key->GetClassName(), "TFormula")))
2597 browsable = kFALSE;
2598 }
2599
2600 if (obj->IsA() == TSystemDirectory::Class()) {
2601 useLock = kFALSE;
2602
2603 TString t(obj->GetName());
2604 if (t == ".") goto out;
2605 if (t == "..") {
2606 if (fListLevel && fListLevel->GetParent()) {
2608 obj = (TObject*)fListLevel->GetUserData();
2609 if (fListLevel->GetParent()) {
2611 } else {
2612 obj = (TObject*)fListLevel->GetUserData();
2613 fListLevel = 0;
2614 }
2615 } else {
2616 dirname = gSystem->DirName(gSystem->pwd());
2617 ToSystemDirectory(dirname);
2618 return;
2619 }
2620 }
2621 }
2622
2623 if (obj && obj->IsFolder()) {
2624 fIconBox->RemoveAll();
2625 TGListTreeItem *itm = 0;
2626
2627 if (fListLevel) {
2629 itm = fListLevel->GetFirstChild();
2630 } else {
2631 itm = fLt->GetFirstItem();
2632 }
2633
2634 while (itm && (itm->GetUserData() != obj)) {
2635 itm = itm->GetNextSibling();
2636 }
2637
2638 if (!itm && fListLevel) {
2639 // special case for remote objects
2640 Bool_t isRemote = kFALSE;
2641 if (obj->InheritsFrom("TRemoteObject"))
2642 isRemote = kTRUE;
2643 else if (fListLevel) {
2644 // check also if one of its parents is a remote object
2646 while (top->GetParent()) {
2647 TObject *tobj = (TObject *) top->GetUserData();
2648 if (tobj && (tobj->InheritsFrom("TRemoteObject") ||
2649 tobj->InheritsFrom("TApplicationRemote"))) {
2650 isRemote = kTRUE;
2651 break;
2652 }
2653 top = top->GetParent();
2654 }
2655 }
2656 if (isRemote) {
2657 // add the remote object only if not already in the list
2658 if ((!fLt->FindChildByName(fListLevel, obj->GetName())) &&
2659 (!fLt->FindChildByData(fListLevel, obj))) {
2660 itm = fLt->AddItem(fListLevel, obj->GetName());
2661 if (itm) itm->SetUserData(obj);
2662 }
2663 else {
2664 // set the current item to the one found in the list
2665 itm = fLt->FindChildByData(fListLevel, obj) ?
2668 }
2669 }
2670 else {
2671 itm = fLt->AddItem(fListLevel, obj->GetName());
2672 if (itm) itm->SetUserData(obj);
2673 }
2674 }
2675
2676 if (itm) {
2677 fListLevel = itm;
2679 TObject *kobj = (TObject *)itm->GetUserData();
2680
2681 if (kobj && kobj->IsA() == TKey::Class()) {
2683 //kobj = gROOT->FindObject(kobj->GetName());
2684 kobj = gDirectory->FindObjectAny(kobj->GetName());
2685
2686 if (kobj) {
2687 TGListTreeItem *parent = fListLevel->GetParent();
2689 TGListTreeItem *kitem = fLt->AddItem(parent, kobj->GetName(), kobj);
2690 if (kitem) {
2691 obj = kobj;
2692 useLock = kFALSE;
2693 kitem->SetUserData(kobj);
2694 fListLevel = kitem;
2695 } else
2696 fListLevel = parent;
2697 }
2698 }
2700 }
2701 }
2702
2703 if (browsable) {
2704 if (useLock) fTreeLock = kTRUE;
2705 Emit("BrowseObj(TObject*)", (Long_t)obj);
2706 if (obj) obj->Browse(fBrowser);
2707 if (useLock) fTreeLock = kFALSE;
2708 }
2709
2710out:
2711 if (obj && obj->IsA() != TSystemFile::Class()) {
2712 if (obj->IsFolder()) {
2713 fIconBox->Refresh();
2714 }
2715
2716 if (fBrowser) {
2718 }
2719
2722 }
2723 }
2724}
2725
2726////////////////////////////////////////////////////////////////////////////////
2727/// Recursively remove object from browser.
2728
2730{
2731 // don't delete fIconBox items here (it's status will be updated
2732 // via TBrowser::Refresh() which should be called once all objects have
2733 // been removed.
2734
2736 if (item == 0)
2737 return;
2738 if (fListLevel && (item == fListLevel)) {
2739 TGListTreeItem *parent = item->GetParent();
2740 if (parent) {
2741 fListLevel = parent;
2745 }
2746 else
2747 fListLevel = 0;
2748 }
2749 DeleteListTreeItem(item);
2750}
2751
2752////////////////////////////////////////////////////////////////////////////////
2753/// Refresh the browser contents.
2754
2756{
2757 Bool_t refresh = fBrowser && fBrowser->GetRefreshFlag();
2758
2759 if (fTextEdit && !gROOT->IsExecutingMacro() && force) {
2762 return;
2763 }
2764
2765 if ( (refresh || force) && !fIconBox->WasGrouped()
2766 && fIconBox->NumItems()<fIconBox->GetGroupSize() ) {
2767
2768 TRootBrowserCursorSwitcher cursorSwitcher(fIconBox, fLt);
2769 static UInt_t prev = 0;
2770 UInt_t curr = gROOT->GetListOfBrowsables()->GetSize();
2771 if (!prev) prev = curr;
2772
2773 if (prev != curr) { // refresh gROOT
2775 fListLevel = 0;
2777 fListLevel = sav;
2778 prev = curr;
2779 }
2780
2781 // Refresh the IconBox
2782 if (fListLevel) {
2784 if (obj) {
2785 fTreeLock = kTRUE;
2786 BrowseObj(obj);
2787 fTreeLock = kFALSE;
2788 }
2789 }
2790 }
2792}
2793
2794////////////////////////////////////////////////////////////////////////////////
2795/// Show or hide toolbar.
2796
2798{
2799 if (show) {
2803 } else {
2807 }
2808}
2809
2810////////////////////////////////////////////////////////////////////////////////
2811/// Show or hide statusbar.
2812
2814{
2815 if (show) {
2818 } else {
2821 }
2822}
2823
2824////////////////////////////////////////////////////////////////////////////////
2825/// Set defaults depending on settings in the user's .rootrc.
2826
2827void TRootBrowserLite::SetDefaults(const char *iconStyle, const char *sortBy)
2828{
2829 const char *opt;
2830
2831 // IconStyle: big, small, list, details
2832 if (iconStyle)
2833 opt = iconStyle;
2834 else
2835 opt = gEnv->GetValue("Browser.IconStyle", "small");
2836 if (!strcasecmp(opt, "big"))
2838 else if (!strcasecmp(opt, "small"))
2840 else if (!strcasecmp(opt, "list"))
2842 else if (!strcasecmp(opt, "details"))
2844 else
2846
2847 // SortBy: name, type, size, date
2848 if (sortBy)
2849 opt = sortBy;
2850 else
2851 opt = gEnv->GetValue("Browser.SortBy", "name");
2852 if (!strcasecmp(opt, "name"))
2854 else if (!strcasecmp(opt, "type"))
2856 else if (!strcasecmp(opt, "size"))
2858 else if (!strcasecmp(opt, "date"))
2860 else
2862
2863 fIconBox->Refresh();
2864}
2865
2866////////////////////////////////////////////////////////////////////////////////
2867/// Set iconbox's view mode and update menu and toolbar buttons accordingly.
2868
2870{
2871 int i, bnum;
2873
2874 if (force || (fViewMode != new_mode)) {
2875
2876 switch (new_mode) {
2877 default:
2878 if (!force)
2879 return;
2880 else
2881 new_mode = kViewLargeIcons;
2882 // intentionally no break
2883 case kViewLargeIcons:
2884 bnum = 2;
2885 lv = kLVLargeIcons;
2886 break;
2887 case kViewSmallIcons:
2888 bnum = 3;
2889 lv = kLVSmallIcons;
2890 break;
2891 case kViewList:
2892 bnum = 4;
2893 lv = kLVList;
2894 break;
2895 case kViewDetails:
2896 bnum = 5;
2897 lv = kLVDetails;
2898 break;
2899 }
2900
2901 fViewMode = new_mode;
2903
2904 for (i = 2; i <= 5; ++i)
2905 gToolBarData[i].fButton->SetState((i == bnum) ? kButtonEngaged : kButtonUp);
2906
2909 if ((lv == kLVDetails) && (buttons)) {
2910 if (!strcmp(fListView->GetHeader(1), "Attributes")) {
2911 buttons[0]->Connect("Clicked()", "TRootBrowserLite", this,
2912 TString::Format("SetSortMode(=%d)", kViewArrangeByName));
2913 buttons[1]->Connect("Clicked()", "TRootBrowserLite", this,
2914 TString::Format("SetSortMode(=%d)", kViewArrangeByType));
2915 buttons[2]->Connect("Clicked()", "TRootBrowserLite", this,
2916 TString::Format("SetSortMode(=%d)", kViewArrangeBySize));
2917 buttons[5]->Connect("Clicked()", "TRootBrowserLite", this,
2918 TString::Format("SetSortMode(=%d)", kViewArrangeByDate));
2919 }
2920 }
2921 fIconBox->AdjustPosition();
2922 }
2923}
2924
2925////////////////////////////////////////////////////////////////////////////////
2926/// Set iconbox's sort mode and update menu radio buttons accordingly.
2927
2929{
2930 EFSSortMode smode;
2931
2932 switch (new_mode) {
2933 default:
2934 new_mode = kViewArrangeByName;
2935 // intentionally no break
2936 case kViewArrangeByName:
2937 smode = kSortByName;
2938 break;
2939 case kViewArrangeByType:
2940 smode = kSortByType;
2941 break;
2942 case kViewArrangeBySize:
2943 smode = kSortBySize;
2944 break;
2945 case kViewArrangeByDate:
2946 smode = kSortByDate;
2947 break;
2948 }
2949
2950 fSortMode = new_mode;
2952
2953 fIconBox->Sort(smode);
2954}
2955
2956////////////////////////////////////////////////////////////////////////////////
2957/// starts serach dialog
2958
2960{
2961 if (!fTextEdit) {
2962 fIconBox->Search(kFALSE);
2963 } else {
2965 }
2966}
2967
2968////////////////////////////////////////////////////////////////////////////////
2969/// test
2970
2971static Bool_t isBinary(const char *str, int len)
2972{
2973 for (int i = 0; i < len; i++) {
2974 char c = str[i];
2975 if (((c < 32) || (c > 126)) && (c != '\t') && (c != '\r') && (c != '\n')) {
2976 return kTRUE;
2977 }
2978 }
2979 return kFALSE;
2980}
2981
2982////////////////////////////////////////////////////////////////////////////////
2983/// hide text edit
2984
2986{
2987 if (!fTextEdit) return;
2988
2994 savbtn->Disconnect();
2996 delete fTextEdit;
2997 fTextEdit = 0;
2999 fV2->MapSubwindows();
3000 fV2->Layout();
3002 fTextFileName = "";
3003}
3004
3005////////////////////////////////////////////////////////////////////////////////
3006/// browse text file
3007
3009{
3010 Bool_t loaded = (fTextEdit != 0);
3012 if (loaded) {
3014 }
3015 return;
3016 }
3017 const int bufferSize = 1024;
3018 char buffer[bufferSize];
3019
3020 FILE *fd = fopen(file, "rb");
3021 if (fd == 0) {
3022 if (loaded) {
3024 }
3025 return;
3026 }
3027 int sz = fread(buffer, 1, bufferSize, fd);
3028 fclose(fd);
3029
3030 if ((sz > 0) && isBinary(buffer, sz)) {
3031 if (loaded) {
3033 }
3034 return;
3035 }
3036
3037 if (!fTextEdit) {
3040 TColor *col = gROOT->GetColor(19);
3041 if (col)
3044 TGSearchDialog::SearchDialog()->Connect("TextEntered(char *)", "TGTextEdit",
3045 fTextEdit, "Search(char *,Bool_t,Bool_t)");
3046 }
3049 savbtn->Connect("Released()", "TGTextEdit", fTextEdit, "SaveFile(=0,kTRUE)");
3050 }
3053 if (loaded) return;
3054
3055 if (fTextFileName.EndsWith(".C")) {
3057 } else {
3059 }
3063 fV2->MapSubwindows();
3064 fV2->Layout();
3066
3067 if (fListLevel) {
3069 }
3071
3072 if (btn) {
3074 }
3075
3077
3078 if (btn2) {
3079 btn2->SetState(kButtonUp);
3080 }
3081}
3082
3083////////////////////////////////////////////////////////////////////////////////
3084/// executed browsed text macro
3085
3087{
3088 char *tmpfile = gSystem->ConcatFileName(gSystem->TempDirectory(),
3090
3091 gROOT->SetExecutingMacro(kTRUE);
3092 fTextEdit->SaveFile(tmpfile, kFALSE);
3093 gROOT->Macro(tmpfile);
3094 gSystem->Unlink(tmpfile);
3095 delete [] tmpfile;
3096 gROOT->SetExecutingMacro(kFALSE);
3097}
3098
3099////////////////////////////////////////////////////////////////////////////////
3100/// interrupt browsed macro execution
3101
3103{
3104 gROOT->SetInterrupt(kTRUE);
3105}
3106
3107////////////////////////////////////////////////////////////////////////////////
3108/// show/hide macro buttons
3109
3111{
3115
3116 static Bool_t connected = kFALSE;
3117
3118 if (!show) {
3119 bt1->UnmapWindow();
3120 bt2->UnmapWindow();
3121 bt3->UnmapWindow();
3122 } else {
3123 bt1->MapWindow();
3124 bt2->MapWindow();
3125 bt3->MapWindow();
3126
3127 if (!connected && fTextEdit) {
3128 bt1->Connect("Pressed()", "TRootBrowserLite", this, "ExecMacro()");
3129 bt2->Connect("Pressed()", "TRootBrowserLite", this, "InterruptMacro()");
3130 connected = kTRUE;
3131 }
3132 }
3133}
3134
3135////////////////////////////////////////////////////////////////////////////////
3136/// Set text in column col in status bar.
3137
3138void TRootBrowserLite::SetStatusText(const char *txt, Int_t col)
3139{
3141 TGStatusBar* status = GetStatusBar();
3142 if (status!=0) {
3143 status->SetText(txt, col);
3144 }
3145}
3146
3147////////////////////////////////////////////////////////////////////////////////
3148/// Interface method to the old browser.
3149
3151 UInt_t width, UInt_t height,
3152 Option_t * /*opt*/)
3153{
3154 TRootBrowserLite *browser = new TRootBrowserLite(b, title, width, height);
3155 return (TBrowserImp *)browser;
3156}
3157
3158////////////////////////////////////////////////////////////////////////////////
3159/// Interface method to the old browser.
3160
3162 Int_t y, UInt_t width, UInt_t height,
3163 Option_t * /*opt*/)
3164{
3165 TRootBrowserLite *browser = new TRootBrowserLite(b, title, x, y, width, height);
3166 return (TBrowserImp *)browser;
3167}
void Class()
Definition: Class.C:29
@ kGKeyPress
Definition: GuiTypes.h:59
const Mask_t kKeyMod1Mask
Definition: GuiTypes.h:197
Handle_t Atom_t
Definition: GuiTypes.h:36
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:111
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
unsigned long ULong_t
Definition: RtypesCore.h:51
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
long long Long64_t
Definition: RtypesCore.h:69
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassImp(name)
Definition: Rtypes.h:365
R__EXTERN TApplication * gApplication
Definition: TApplication.h:166
#define gDirectory
Definition: TDirectory.h:223
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:338
@ 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:29
@ kSortByDate
Definition: TGFSContainer.h:33
@ kSortByName
Definition: TGFSContainer.h:30
@ kSortByType
Definition: TGFSContainer.h:31
@ kSortBySize
Definition: TGFSContainer.h:32
@ kFDOpen
Definition: TGFileDialog.h:38
@ kSunkenFrame
Definition: TGFrame.h:61
@ kDoubleBorder
Definition: TGFrame.h:63
@ kFixedWidth
Definition: TGFrame.h:65
@ kHorizontalFrame
Definition: TGFrame.h:60
@ 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:555
#define gROOT
Definition: TROOT.h:415
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,...)
char * StrDup(const char *str)
Duplicate the string str.
Definition: TString.cxx:2490
@ kReadPermission
Definition: TSystem.h:48
R__EXTERN TSystem * gSystem
Definition: TSystem.h:560
#define gPad
Definition: TVirtualPad.h:286
#define gVirtualX
Definition: TVirtualX.h:345
@ kWatch
Definition: TVirtualX.h:47
@ kPointer
Definition: TVirtualX.h:47
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:75
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Definition: TClass.cxx:5688
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:2906
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:1434
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:34
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:48
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:185
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:450
virtual Int_t GetNumberOfEntries() const
Definition: TGComboBox.h:127
virtual TList * GetList() const
Definition: TGFrame.h:369
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:1099
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:371
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1239
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1146
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1186
TList * fList
Definition: TGFrame.h:351
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:373
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
Definition: TGFrame.cxx:1004
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1131
virtual void RemoveAll()
Remove all frames from composite frame.
Definition: TGFrame.cxx:1113
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1172
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
TBufferFile * fBuf
Definition: TGFSContainer.h:61
TDNDData fDNDData
Definition: TGFSContainer.h:62
void SetDNDData(TDNDData *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:627
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:258
void SetDNDSource(Bool_t onoff)
Definition: TGFrame.h:315
virtual TDNDData * GetDNDData(Atom_t)
Definition: TGFrame.h:322
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
UInt_t GetHeight() const
Definition: TGFrame.h:272
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:611
virtual void MapWindow()
Definition: TGFrame.h:251
static Pixel_t fgWhitePixel
Definition: TGFrame.h:150
UInt_t GetWidth() const
Definition: TGFrame.h:271
virtual void UnmapWindow()
Definition: TGFrame.h:253
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:177
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1419
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:482
virtual void SendCloseMessage()
Send close message to self.
Definition: TGFrame.cxx:1702
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
Definition: TGFrame.cxx:1814
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition: TGFrame.cxx:1759
virtual Bool_t HandleKey(Event_t *event)
Handle keyboard events.
Definition: TGFrame.cxx:1564
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition: TGFrame.cxx:1837
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:1862
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1746
const TGPicture * SetIconPixmap(const char *iconName)
Set window icon pixmap by name.
Definition: TGFrame.cxx:1774
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
Add popup menu to menu bar.
Definition: TGMenu.cxx:415
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:1149
virtual Bool_t IsEntryChecked(Int_t id)
Return true if menu item is checked.
Definition: TGMenu.cxx:1842
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:987
virtual void AddSeparator(TGMenuEntry *before=0)
Add a menu separator to the menu.
Definition: TGMenu.cxx:1057
virtual void CheckEntry(Int_t id)
Check a menu entry (i.e. add a check mark in front of it).
Definition: TGMenu.cxx:1779
virtual void DisableEntry(Int_t id)
Disable entry (disabled entries appear in a sunken relieve).
Definition: TGMenu.cxx:1721
virtual void UnCheckEntry(Int_t id)
Uncheck menu entry (i.e. remove check mark).
Definition: TGMenu.cxx:1804
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:1857
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:387
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:633
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:452
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:580
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
@ kEditDisable
Definition: TGWindow.h:59
virtual void DestroyWindow()
Definition: TGWindow.h:92
const TGWindow * GetParent() const
Definition: TGWindow.h:85
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:24
virtual const char * GetClassName() const
Definition: TKey.h:72
Short_t GetCycle() const
Return cycle number associated to this key.
Definition: TKey.cxx:568
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:327
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:819
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition: TList.cxx:690
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
Definition: TList.cxx:761
virtual TObject * Before(const TObject *obj) const
Returns the object before object obj.
Definition: TList.cxx:368
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition: TList.cxx:467
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:656
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:399
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:172
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:880
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:854
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:867
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:1025
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
Definition: TROOT.cxx:2935
The TRemoteObject class provides protocol for browsing ROOT objects from a remote ROOT session.
Definition: TRemoteObject.h:36
const char * GetClassName() const
Definition: TRemoteObject.h:56
const char * GetKeyClassName() const
Definition: TRemoteObject.h:58
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:425
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:1014
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
Definition: TSystem.cxx:1062
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition: TSystem.cxx:663
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:1287
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
Definition: TSystem.cxx:1054
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
Definition: TSystem.cxx:959
virtual const char * WorkingDirectory()
Return working directory.
Definition: TSystem.cxx:879
virtual int Unlink(const char *name)
Unlink, i.e.
Definition: TSystem.cxx:1372
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
Definition: TSystem.cxx:1473
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:50
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