Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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-2021, 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/** \class TRootBrowserLite
14 \ingroup guiwidgets
15
16This class creates a ROOT object browser (looking like Windows
17Explorer). The widgets used are the new native ROOT GUI widgets.
18
19*/
20
21
22#include "RConfigure.h"
23
24#include "TRootBrowserLite.h"
25#include "TRootApplication.h"
26#include "TGCanvas.h"
27#include "TGMenu.h"
28#include "TGFileDialog.h"
29#include "TGStatusBar.h"
30#include "TGFSComboBox.h"
31#include "TGLabel.h"
32#include "TGButton.h"
33#include "TGListView.h"
34#include "TGListTree.h"
35#include "TGToolBar.h"
36#include "TGSplitter.h"
37#include "TG3DLine.h"
38#include "TGFSContainer.h"
39#include "TGMimeTypes.h"
40#include "TRootHelpDialog.h"
41#include "TGTextEntry.h"
42#include "TGTextEdit.h"
43#include "TGTextEditDialogs.h"
44
45#include "TROOT.h"
46#include "TEnv.h"
47#include "TBrowser.h"
48#include "TApplication.h"
49#include "TFile.h"
50#include "TKey.h"
51#include "TKeyMapFile.h"
52#include "TClass.h"
53#include "TContextMenu.h"
54#include "TSystem.h"
55#include "TSystemDirectory.h"
56#include "TSystemFile.h"
57#include "TRemoteObject.h"
58#include "TInterpreter.h"
59#include "TGuiBuilder.h"
60#include "TImage.h"
61#include "TVirtualPad.h"
62#include "KeySymbols.h"
63#include "THashTable.h"
64#include "TColor.h"
65#include "TObjString.h"
66#include "TGDNDManager.h"
67#include "TBufferFile.h"
68#include "TFolder.h"
69#include "Getline.h"
70#include "snprintf.h"
71#include "TVirtualX.h"
72
73#include "HelpText.h"
74
75#ifdef WIN32
76#include "TWin32SplashThread.h"
77#endif
78
79// Browser menu command ids
131
132
133//----- Struct for default icons
134
136 const char *fPicnamePrefix;
137 const TGPicture *fIcon[2];
138};
139
140#if 0
141static DefaultIcon_t gDefaultIcon[] = {
142 { "folder", { 0, 0 } },
143 { "app", { 0, 0 } },
144 { "doc", { 0, 0 } },
145 { "slink", { 0, 0 } },
146 { "histo", { 0, 0 } },
147 { "object", { 0, 0 } }
148};
149#endif
150
151
152//----- Toolbar stuff...
153
155 { "tb_uplevel.xpm", "Up One Level", kFALSE, kOneLevelUp, 0 },
156 { "", "", kFALSE, -1, 0 },
157 { "tb_bigicons.xpm", "Large Icons", kTRUE, kViewLargeIcons, 0 },
158 { "tb_smicons.xpm", "Small Icons", kTRUE, kViewSmallIcons, 0 },
159 { "tb_list.xpm", "List", kTRUE, kViewList, 0 },
160 { "tb_details.xpm", "Details", kTRUE, kViewDetails, 0 },
161 { "", "", kFALSE, -1, 0 },
162 { "tb_back.xpm", "Back", kFALSE, kHistoryBack, 0 },
163 { "tb_forw.xpm", "Forward", kFALSE, kHistoryForw, 0 },
164 { "tb_refresh.xpm", "Refresh (F5)", kFALSE, kViewRefresh, 0 },
165 { "", "", kFALSE, -1, 0 },
166 { "tb_find.xpm", "Find (Ctrl-F)", kFALSE, kViewFind, 0 },
167 { "", "", kFALSE, -1, 0 },
168 { "macro_t.xpm", "Execute Macro", kFALSE, kViewExec, 0 },
169 { "interrupt.xpm", "Interrupt Macro",kFALSE, kViewInterrupt, 0 },
170 { "filesaveas.xpm", "Save Macro", kFALSE, kViewSave, 0 },
171 { 0, 0, kFALSE, 0, 0 }
172};
173
174
175//----- TGFileDialog file types
176
177static const char *gOpenTypes[] = { "ROOT files", "*.root",
178 "All files", "*",
179 0, 0 };
180
181////////////////////////////////////////////////////////////////////////////////////
183public:
185
187 void Print(Option_t *) const override { if (fItem) printf("%s\n", fItem->GetText()); }
188};
189
190
191////////////////////////////////////////////////////////////////////////////////////
193public:
194 void RecursiveRemove(TObject *obj) override
195 {
197 TIter next(this);
198
199 while ((cur = (TRootBrowserHistoryCursor*)next())) {
200 if (cur->fItem->GetUserData() == obj) {
201 Remove(cur);
202 delete cur;
203 }
204 }
205 }
206
209 TIter next(this);
210
211 while ((cur = (TRootBrowserHistoryCursor*)next())) {
212 if (cur->fItem == item) {
213 Remove(cur);
214 delete cur;
215 }
216 }
217 }
218};
219
220
221////////////////////////////////////////////////////////////////////////////////////
223private:
226public:
228 if (w1) gVirtualX->SetCursor(w1->GetId(), gVirtualX->CreateCursor(kWatch));
229 if (w2) gVirtualX->SetCursor(w2->GetId(), gVirtualX->CreateCursor(kWatch));
230 }
232 if (fW1) gVirtualX->SetCursor(fW1->GetId(), gVirtualX->CreateCursor(kPointer));
233 if (fW2) gVirtualX->SetCursor(fW2->GetId(), gVirtualX->CreateCursor(kPointer));
234 }
235};
236
237////////////////////////////////////////////////////////////////////////////////////
238class TIconBoxThumb : public TObject {
239public:
243
244 TIconBoxThumb(const char *name, const TGPicture *spic, const TGPicture *pic) {
245 fName = name;
246 fSmall = spic;
247 fLarge = pic;
248 }
249 ULong_t Hash() const override { return fName.Hash(); }
250 const char *GetName() const override { return fName.Data(); }
251};
252
253
254
255//----- Special ROOT object item (this are items in the icon box, see
256//----- TRootIconBox)
257////////////////////////////////////////////////////////////////////////////////////
258class TRootObjItem : public TGFileItem {
259public:
260 TRootObjItem(const TGWindow *p, const TGPicture *bpic,
261 const TGPicture *spic, TGString *name,
263
265 {
266 TObject *object = nullptr;
267 if (fObj->IsA() == TKey::Class())
268 object = ((TKey *)fObj)->ReadObj();
269 else
270 object = fObj;
271 if (object) {
273 fBuf->WriteObject(object);
276 }
277 fDNDData.fDataType = gVirtualX->InternAtom("application/root", kFALSE);
278 return &fDNDData;
279 }
280
282 {
283 if (GetParent())
284 return ((TGFrame *)GetParent())->HandleDNDFinished();
285 return kFALSE;
286 }
287
288protected:
291};
292
293////////////////////////////////////////////////////////////////////////////////
294/// Create an icon box item.
295
297 const TGPicture *spic, TGString *name,
299 TGFileItem(p, bpic, 0, spic, 0, name, 0, 0, 0, 0, 0, viewMode)
300{
301 fObj = obj;
302 fDNDData.fData = 0;
304
305 if (fSubnames) {
306 for (Int_t i = 0; fSubnames[i] != 0; ++i) delete fSubnames[i];
307 }
308 delete [] fSubnames;
309 fSubnames = new TGString* [2];
310
311 fSubnames[0] = new TGString(obj->GetTitle());
312
313 fSubnames[1] = 0;
314
315 if (obj->IsA()->HasDefaultConstructor()) {
317 }
318 if ((obj->IsA() == TFolder::Class()) ||
319 (obj->IsA() == TClass::Class())) {
321 }
322
323 int i;
324 for (i = 0; fSubnames[i] != 0; ++i)
325 ;
326 fCtw = new int[i];
327 for (i = 0; fSubnames[i] != 0; ++i)
328 fCtw[i] = gVirtualX->TextWidth(fFontStruct, fSubnames[i]->GetString(),
329 fSubnames[i]->GetLength());
330}
331
332class TRootIconBox;
333////////////////////////////////////////////////////////////////////////////////////
334class TRootIconList : public TList {
335
336private:
337 TRootIconBox *fIconBox; // iconbox to which list belongs
338 const TGPicture *fPic; // list view icon
339
340public:
341 TRootIconList(TRootIconBox* box = nullptr);
342 ~TRootIconList() override;
343 void UpdateName();
344 const char *GetTitle() const override{ return "ListView Container"; }
345 Bool_t IsFolder() const override { return kFALSE; }
346 void Browse(TBrowser *b) override;
347 const TGPicture *GetPicture() const { return fPic; }
348};
349
350////////////////////////////////////////////////////////////////////////////////
351/// constructor
352
354{
355 fPic = gClient->GetPicture("listview.xpm");
356 fIconBox = box;
357 fName = "empty";
358}
359
360////////////////////////////////////////////////////////////////////////////////
361/// destructor
362
364{
365 gClient->FreePicture(fPic);
366}
367
368////////////////////////////////////////////////////////////////////////////////
369/// composite name
370
372{
373 if (!First()) return;
374
375 if (fSize==1) {
376 fName = First()->GetName();
377 return;
378 }
379
380 fName = First()->GetName();
381 fName += "-";
382 fName += Last()->GetName();
383}
384
385//----- Special ROOT object container (this is the icon box on the
386//----- right side of the browser)
387////////////////////////////////////////////////////////////////////////////////////
389friend class TRootIconList;
390friend class TRootBrowserLite;
391
392private:
393 Bool_t fCheckHeaders; // if true check headers
398 TList *fGarbage; // garbage for TRootIconList's
399 Int_t fGroupSize; // the total number of items when icon box switched to "global view" mode
406 THashTable *fThumbnails; // hash table with thumbnailed pictures
409
410 void *FindItem(const TString& name,
413 Bool_t beginWith = kFALSE) override;
414 void RemoveGarbage();
415
416public:
418 UInt_t options = kSunkenFrame,
420
421 ~TRootIconBox() override;
422
423 void AddObjItem(const char *name, TObject *obj, TClass *cl);
424 void GetObjPictures(const TGPicture **pic, const TGPicture **spic,
425 TObject *obj, const char *name);
426 void SetObjHeaders();
427 void Refresh();
428 void RemoveAll() override;
430 Int_t GetGroupSize() const { return fGroupSize; }
432 Bool_t WasGrouped() const { return fWasGrouped; }
433};
434
435////////////////////////////////////////////////////////////////////////////////
436/// Create iconbox containing ROOT objects in browser.
437
439 ULong_t back) : TGFileContainer(lv, options, back)
440{
441 fListView = lv;
443
445 fTotal = 0;
446 fGarbage = new TList();
447 fCurrentList = 0;
448 fCurrentItem = 0;
450 fGroupSize = 1000;
451 fCurrentName = 0;
453 fActiveObject = 0;
454 fIsEmpty = kTRUE;
455 fLargeCachedPic = 0;
456 fSmallCachedPic = 0;
457
458 // Don't use timer HERE (timer is set in TBrowser).
460 fRefresh = 0;
461 fThumbnails = new THashTable(50);
463}
464
465////////////////////////////////////////////////////////////////////////////////
466/// destructor
467
469{
470 RemoveAll();
472 delete fGarbage;
473 delete fThumbnails;
474}
475
476////////////////////////////////////////////////////////////////////////////////
477/// Retrieve icons associated with class "name". Association is made
478/// via the user's ~/.root.mimes file or via $ROOTSYS/etc/root.mimes.
479
481 TObject *obj, const char *name)
482{
483 static TImage *im = 0;
484 if (!im) {
485 im = TImage::Create();
486 }
487
489 Bool_t xpm = xpm_magic == "/* ";
490 const char *iconname = xpm ? obj->GetName() : name;
491
492 if (obj->IsA()->InheritsFrom("TGeoVolume")) {
493 iconname = obj->GetIconName() ? obj->GetIconName() : obj->IsA()->GetName();
494 }
495
496 if (fCachedPicName == iconname) {
499 return;
500 }
501
502 *pic = fClient->GetMimeTypeList()->GetIcon(iconname, kFALSE);
503
504 if (!(*pic) && xpm) {
505 if (im && im->SetImageBuffer((char**)&name, TImage::kXpm)) {
506 *pic = fClient->GetPicturePool()->GetPicture(iconname, im->GetPixmap(),
507 im->GetMask());
508 im->Scale(im->GetWidth()/2, im->GetHeight()/2);
509 *spic = fClient->GetPicturePool()->GetPicture(iconname, im->GetPixmap(),
510 im->GetMask());
511 }
512
513 fClient->GetMimeTypeList()->AddType("[thumbnail]", iconname, iconname, iconname, "->Browse()");
514 return;
515 }
516
517 if (*pic == 0) {
518 if (obj->IsFolder()) {
519 *pic = fFolder_s;
520 } else {
521 *pic = fDoc_s;
522 }
523 }
525
526 *spic = fClient->GetMimeTypeList()->GetIcon(iconname, kTRUE);
527
528 if (*spic == 0) {
529 if (obj->IsFolder())
530 *spic = fFolder_t;
531 else
532 *spic = fDoc_t;
533 }
535 fCachedPicName = iconname;
536}
537
538////////////////////////////////////////////////////////////////////////////////
539/// delete all TRootIconLists from garbage
540
542{
543 TIter next(fGarbage);
544 TList *li;
545
546 while ((li=(TList *)next())) {
547 li->Clear("nodelete");
548 }
549 fGarbage->Delete();
550}
551
552////////////////////////////////////////////////////////////////////////////////
553/// Add object to iconbox. Class is used to get the associated icons
554/// via the mime file (see GetObjPictures()).
555
556void TRootIconBox::AddObjItem(const char *name, TObject *obj, TClass *cl)
557{
558 if (!cl) return;
559
561 TGFileItem *fi;
563 const TGPicture *pic = 0;
564 const TGPicture *spic = 0;
565
566 if (obj->InheritsFrom("TRemoteObject")) {
567 // check if the real remote object is a system file or directory
569 if ((TString(robj->GetClassName()) == "TSystemFile") ||
570 (TString(robj->GetClassName()) == "TSystemDirectory"))
572 }
573
574 if (isSystemFile || obj->IsA() == TSystemFile::Class() ||
575 obj->IsA() == TSystemDirectory::Class()) {
576 if (fCheckHeaders) {
577 if (strcmp(fListView->GetHeader(1), "Attributes")) {
580 if (buttons) {
581 buttons[0]->Connect("Clicked()", "TRootBrowserLite", fBrowser,
582 TString::Format("SetSortMode(=%d)", kViewArrangeByName));
583 buttons[1]->Connect("Clicked()", "TRootBrowserLite", fBrowser,
584 TString::Format("SetSortMode(=%d)", kViewArrangeByType));
585 buttons[2]->Connect("Clicked()", "TRootBrowserLite", fBrowser,
586 TString::Format("SetSortMode(=%d)", kViewArrangeBySize));
587 buttons[5]->Connect("Clicked()", "TRootBrowserLite", fBrowser,
588 TString::Format("SetSortMode(=%d)", kViewArrangeByDate));
589 }
590 }
592 }
593
594 TIconBoxThumb *thumb = 0;
597 thumbname);
598 delete []thumbname;
599
600 if (thumb) {
601 spic = thumb->fSmall;
602 pic = thumb->fLarge;
603 }
604
605 if (obj->InheritsFrom("TRemoteObject"))
606 // special case for remote object
607 fi = AddRemoteFile(obj, spic, pic);
608 else
609 fi = AddFile(name, spic, pic);
610 if (fi) {
611 fi->SetUserData(obj);
612 if (obj->IsA() == TSystemFile::Class()) {
613 TString str;
615 str = TString::Format("file://%s/%s\r\n",
617 obj->GetName());
618 data.fData = (void *)str.Data();
619 data.fDataLength = str.Length()+1;
620 data.fDataType = gVirtualX->InternAtom("text/uri-list", kFALSE);
621 fi->SetDNDData(&data);
622 fi->SetDNDSource(kTRUE);
623 }
624 }
625
627 return;
628 }
629
630 if (!fCurrentList) {
631 fCurrentList = new TRootIconList(this);
633 }
634
635 fCurrentList->Add(obj);
638
640 TIter next(fList);
641 while ((el = (TGFrameElement *) next())) {
642 TGLVEntry *f = (TGLVEntry *) el->fFrame;
643 if (f->GetUserData() == obj) {
644 return;
645 }
646 }
647
648 if (fGrouped && fCurrentItem && (fCurrentList->GetSize()>1)) {
650 }
651
653
654 if ((fCurrentList->GetSize() < fGroupSize) && !fGrouped) {
655 GetObjPictures(&pic, &spic, obj, obj->GetIconName() ?
656 obj->GetIconName() : cl->GetName());
657
658 if (fCheckHeaders) {
659 if (strcmp(fListView->GetHeader(1), "Title")) {
661 }
663 }
664
665 fi = new TRootObjItem(this, pic, spic, new TGString(name), obj, cl, view);
666
667 fi->SetUserData(obj);
668 AddItem(fi);
669 return;
670 }
671
672 if (fGrouped && (fCurrentList->GetSize()==1)) {
678 fTotal = fList->GetSize();
679 return;
680 }
681
682 if ((fCurrentList->GetSize()==fGroupSize) && !fGrouped) {
683 fGrouped = kTRUE;
684
685 // clear fList
688
689 while ((el2 = (TGFrameElement *) nextl())) {
690 el2->fFrame->DestroyWindow();
691 delete el2->fFrame;
692 fList->Remove(el2);
693 delete el2;
694 }
695
699 fi->SetUserData(fCurrentList);
700 AddItem(fi);
701
702 fCurrentList = new TRootIconList(this);
704 fTotal = 1;
705 return;
706 }
707
709 fCurrentList = new TRootIconList(this);
711 return;
712 }
713}
714
715////////////////////////////////////////////////////////////////////////////////
716/// browse icon list
717
719{
720 if (!fIconBox) return;
721
722 TObject *obj;
723 TGFileItem *fi;
724 const TGPicture *pic = 0;
725 const TGPicture *spic = 0;
726 TClass *cl;
728 TKey *key = 0;
729
732
733 while (lnk) {
734 obj = lnk->GetObject();
735 lnk = lnk->Next();
736
737 if (obj->IsA() == TKey::Class()) {
738 cl = TClass::GetClass(((TKey *)obj)->GetClassName());
739 key = (TKey *)obj;
740 } else if (obj->IsA() == TKeyMapFile::Class()) {
741 cl = TClass::GetClass(((TKeyMapFile *)obj)->GetTitle());
742 } else if (obj->InheritsFrom("TRemoteObject")) {
743 // special case for remote object: get real object class
745 cl = TClass::GetClass(robj->GetClassName());
746 } else {
747 cl = obj->IsA();
748 }
749
750 name = obj->GetName();
751
752 if (key && obj->IsA() == TKey::Class()) {
753 name += ";";
754 name += key->GetCycle();
755 }
756
757 fIconBox->GetObjPictures(&pic, &spic, obj, obj->GetIconName() ?
758 obj->GetIconName() : cl->GetName());
759
760 fi = new TRootObjItem((const TGWindow*)fIconBox, pic, spic, new TGString(name.Data()),
761 obj, cl, (EListViewMode)fIconBox->GetViewMode());
762 fi->SetUserData(obj);
764 fIconBox->fTotal++;
765
766 if (obj==fIconBox->fActiveObject) {
768 }
769 }
770
771 fIconBox->fGarbage->Remove(this);
773 fIconBox->fGarbage->Add(this); // delete this later
774
775 fIconBox->Refresh();
777
779}
780
781////////////////////////////////////////////////////////////////////////////////
782/// Find a frame which assosiated object has a name containing a "name" string.
783
786{
787 if (!fGrouped) {
789 }
790
791 if (name.IsNull()) return 0;
792 int idx = kNPOS;
793
794 TGFrameElement* el = 0;
795 TString str;
797
800 fLastName = name;
801
802 if (fLastActiveEl) {
804
805 if (direction) {
807 } else {
809 }
810 } else {
812 else el = (TGFrameElement *)fList->Last();
813 }
814
815 TGLVEntry* lv = 0;
816 TObject* obj = 0;
817 TList* li = 0;
818
819 while (el) {
820 lv = (TGLVEntry*)el->fFrame;
821 li = (TList*)lv->GetUserData();
822
823 TIter next(li);
824
825 while ((obj=next())) {
826 str = obj->GetName();
827 idx = str.Index(name,0,cmp);
828
829 if (idx!=kNPOS) {
830 if (beginWith) {
831 if (idx==0) {
832 fActiveObject = obj;
833 return el;
834 }
835 } else {
836 fActiveObject = obj;
837 return el;
838 }
839 }
840 }
841 if (direction) {
843 } else {
845 }
846 }
847 fActiveObject = 0;
848 return 0;
849}
850
851////////////////////////////////////////////////////////////////////////////////
852/// Set list box headers used to display detailed object iformation.
853/// Currently this is only "Name" and "Title".
854
861
862////////////////////////////////////////////////////////////////////////////////
863/// Sort icons, and send message to browser with number of objects
864/// in box.
865
867{
868 // This automatically calls layout
870
871 // Make TRootBrowserLite display total objects in status bar
873
876}
877
878////////////////////////////////////////////////////////////////////////////////
879/// Remove all items from icon box
880
882{
883 if (fIsEmpty) return;
884
888 fCurrentItem = 0;
889 fCurrentList = 0;
890 fIsEmpty = kTRUE;
891}
892
893
894//_____________________________________________________________________________
895//
896// TRootBrowserLite
897//
898// ROOT object browser (looking like Windows Explorer).
899//_____________________________________________________________________________
900
901
902////////////////////////////////////////////////////////////////////////////////
903/// Create browser with a specified width and height.
904
906 : TGMainFrame(gClient->GetDefaultRoot(), width, height), TBrowserImp(b)
907{
909
911 if (b) Show();
912}
913
914////////////////////////////////////////////////////////////////////////////////
915/// Create browser with a specified width and height and at position x, y.
916
919 : TGMainFrame(gClient->GetDefaultRoot(), width, height), TBrowserImp(b)
920{
922
924 SetWMPosition(x, y);
925 if (b) Show();
926}
927
928////////////////////////////////////////////////////////////////////////////////
929/// Browser destructor.
930
932{
933 if (fIconPic) gClient->FreePicture(fIconPic);
934
935 delete fToolBarSep;
936
937 fToolBar->Cleanup();
938 delete fToolBar;
939 delete fStatusBar;
940 delete fV1;
941 delete fV2;
942 delete fLbl1;
943 delete fLbl2;
944 delete fHf;
945 delete fTreeHdr;
946 delete fListHdr;
947 delete fIconBox;
948 delete fListView;
949 delete fLt;
950 delete fTreeView;
951
952 delete fMenuBar;
953 delete fFileMenu;
954 delete fViewMenu;
955 delete fOptionMenu;
956 delete fHelpMenu;
957 delete fSortMenu;
958
959 delete fMenuBarLayout;
960 delete fMenuBarItemLayout;
961 delete fMenuBarHelpLayout;
962 delete fBarLayout;
963
964 delete fTextEdit;
965
966 if (fWidgets) fWidgets->Delete();
967 delete fWidgets;
968
969 fHistory->Delete();
970 delete fHistory;
971}
972
973////////////////////////////////////////////////////////////////////////////////
974/// Create the actual browser.
975
977{
978 fWidgets = new TList;
980 fHistoryCursor = 0;
982
983 // Create menus
985 fFileMenu->AddEntry("&New Browser", kFileNewBrowser);
986 fFileMenu->AddEntry("New Browser &Lite", kFileNewBrowserLite);
987 fFileMenu->AddEntry("New Canvas", kFileNewCanvas);
988 fFileMenu->AddEntry("&Gui Builder", kFileNewBuilder);
989 fFileMenu->AddEntry("&Open...", kFileOpen);
991 fFileMenu->AddEntry("&Save", kFileSave);
992 fFileMenu->AddEntry("Save &As...", kFileSaveAs);
994 fFileMenu->AddEntry("&Print...", kFilePrint);
996 fFileMenu->AddEntry("&Close Browser", kFileCloseBrowser);
998 fFileMenu->AddEntry("&Quit ROOT", kFileQuit);
999
1000 //fFileMenu->DefaultEntry(kFileNewCanvas);
1004
1011 fSortMenu->AddEntry("&Auto Arrange", kViewArrangeAuto);
1012
1014
1016 fViewMenu->AddEntry("&Toolbar", kViewToolBar);
1017 fViewMenu->AddEntry("Status &Bar", kViewStatusBar);
1019 fViewMenu->AddEntry("Lar&ge Icons", kViewLargeIcons);
1020 fViewMenu->AddEntry("S&mall Icons", kViewSmallIcons);
1021 fViewMenu->AddEntry("&List", kViewList);
1022 fViewMenu->AddEntry("&Details", kViewDetails);
1024 fViewMenu->AddEntry("Show &Hidden", kViewHidden);
1025 fViewMenu->AddPopup("Arrange &Icons", fSortMenu);
1026 fViewMenu->AddEntry("Lin&e up Icons", kViewLineUp);
1027 fViewMenu->AddEntry("&Group Icons", kViewGroupLV);
1028
1030 fViewMenu->AddEntry("&Refresh (F5)", kViewRefresh);
1031
1034
1035 if (fBrowser) {
1036 if (gEnv->GetValue("Browser.ShowHidden", 0)) {
1039 } else {
1042 }
1043 }
1044
1046 fOptionMenu->AddEntry("&Show Cycles", kOptionShowCycles);
1047 fOptionMenu->AddEntry("&AutoThumbnail", kOptionAutoThumbnail);
1048
1050 fHelpMenu->AddEntry("&About ROOT...", kHelpAbout);
1052 fHelpMenu->AddEntry("Help On Browser...", kHelpOnBrowser);
1053 fHelpMenu->AddEntry("Help On Canvas...", kHelpOnCanvas);
1054 fHelpMenu->AddEntry("Help On Menus...", kHelpOnMenus);
1055 fHelpMenu->AddEntry("Help On Graphics Editor...", kHelpOnGraphicsEd);
1056 fHelpMenu->AddEntry("Help On Objects...", kHelpOnObjects);
1057 fHelpMenu->AddEntry("Help On PostScript...", kHelpOnPS);
1058 fHelpMenu->AddEntry("Help On Remote Session...", kHelpOnRemote);
1059
1060 // This main frame will process the menu commands
1061 fFileMenu->Associate(this);
1062 fViewMenu->Associate(this);
1063 fSortMenu->Associate(this);
1064 fOptionMenu->Associate(this);
1065 fHelpMenu->Associate(this);
1066
1067 // Create menubar layout hints
1071
1072 // Create menubar
1073 fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
1078
1080
1081 // Create toolbar and separator
1082
1083 fToolBarSep = new TGHorizontal3DLine(this);
1084 fToolBar = new TGToolBar(this, 60, 20, kHorizontalFrame);
1086
1090 fFSComboBox->Associate(this);
1091
1092 int spacing = 8;
1093
1094 for (int i = 0; gToolBarData[i].fPixmap; i++) {
1095 if (strlen(gToolBarData[i].fPixmap) == 0) {
1096 spacing = 8;
1097 continue;
1098 }
1100 spacing = 0;
1101 }
1102
1103 fDrawOption = new TGComboBox(fToolBar, "");
1105 dropt_entry->SetToolTipText("Object Draw Option", 300);
1106 fDrawOption->Resize(80, 10);
1108 lb->Resize(lb->GetWidth(), 120);
1109 Int_t dropt = 1;
1110 fDrawOption->AddEntry("", dropt++);
1111 fDrawOption->AddEntry("same", dropt++);
1112 fDrawOption->AddEntry("box", dropt++);
1113 fDrawOption->AddEntry("lego", dropt++);
1114 fDrawOption->AddEntry("colz", dropt++);
1115 fDrawOption->AddEntry("alp", dropt++);
1116 fDrawOption->AddEntry("text", dropt++);
1117
1119 fToolBar->AddFrame(new TGLabel(fToolBar,"Option"),
1120 new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2,2,2,0));
1121
1125
1126 // Create panes
1127
1128 fHf = new TGHorizontalFrame(this, 10, 10);
1129
1130 fV1 = new TGVerticalFrame(fHf, 10, 10, kFixedWidth);
1131 fV2 = new TGVerticalFrame(fHf, 10, 10);
1132 fTreeHdr = new TGCompositeFrame(fV1, 10, 10, kSunkenFrame);
1133 fListHdr = new TGCompositeFrame(fV2, 10, 10, kSunkenFrame);
1134
1135 fLbl1 = new TGLabel(fTreeHdr, "All Folders");
1136 fLbl2 = new TGLabel(fListHdr, "Contents of \".\"");
1137
1138 TGLayoutHints *lo;
1139
1140 lo = new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 0, 0, 0);
1141 fWidgets->Add(lo);
1142 fTreeHdr->AddFrame(fLbl1, lo);
1143 fListHdr->AddFrame(fLbl2, lo);
1144
1145 lo = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0, 0, 1, 2);
1146 fWidgets->Add(lo);
1147 fV1->AddFrame(fTreeHdr, lo);
1148 fV2->AddFrame(fListHdr, lo);
1149
1151
1153 fWidgets->Add(lo);
1154 fHf->AddFrame(fV1, lo);
1155
1157 splitter->SetFrame(fV1, kTRUE);
1160 fWidgets->Add(lo);
1161 fHf->AddFrame(splitter, lo);
1162
1164 fWidgets->Add(lo);
1165 fHf->AddFrame(fV2, lo);
1166
1167 // Create tree
1168 fTreeView = new TGCanvas(fV1, 10, 10, kSunkenFrame | kDoubleBorder); // canvas
1170 fLt->Associate(this);
1171 fLt->SetAutoTips();
1172
1176
1177 // Create list view (icon box)
1178 fListView = new TGListView(fV2, 520, 250); // canvas
1179 // container
1181 fIconBox->Associate(this);
1182 fListView->SetIncrements(1, 19); // set vertical scroll one line height at a time
1184
1185 TString str = gEnv->GetValue("Browser.AutoThumbnail", "yes");
1186 str.ToLower();
1187 fIconBox->fAutoThumbnail = (str == "yes") || atoi(str.Data());
1190
1191 str = gEnv->GetValue("Browser.GroupView", "10000");
1192 Int_t igv = atoi(str.Data());
1193
1194 if (igv>10) {
1197 }
1198
1199 // reuse lo from "create tree"
1201
1202 AddFrame(fHf, lo);
1203
1204 // Statusbar
1205
1206 int parts[] = { 26, 74 };
1207 fStatusBar = new TGStatusBar(this, 60, 10);
1209 lo = new TGLayoutHints(kLHintsBottom | kLHintsExpandX, 0, 0, 3, 0);
1210 AddFrame(fStatusBar, lo);
1211
1212 fTextEdit = 0;
1213
1214 // Misc
1215 TString bname(name);
1216 bname.Prepend("Old ");
1217 SetWindowName(bname.Data());
1218 SetIconName(bname.Data());
1219 fIconPic = SetIconPixmap("rootdb_s.xpm");
1220 SetClassHints("ROOT", "Browser");
1221
1222 SetWMSizeHints(600, 350, 10000, 10000, 2, 2);
1223
1224 fListLevel = 0;
1225 fTreeLock = kFALSE;
1226
1227 gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Escape), 0, kTRUE);
1228 gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_F5), 0, kTRUE);
1229 gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Right), kKeyMod1Mask, kTRUE);
1230 gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_Left), kKeyMod1Mask, kTRUE);
1231 ClearHistory();
1233
1234 gVirtualX->SetDNDAware(fId, fDNDTypeList);
1235 MapSubwindows();
1236 SetDefaults();
1237 Resize();
1239
1240 printf("\n You are using the old ROOT browser! A new version is available. To use it:\n");
1241 printf(" Select the \"New Browser\" entry from the \"File\" menu in the browser, or change\n");
1242 printf(" \"Browser.Name:\" from \"TRootBrowserLite\" to \"TRootBrowser\" in system.rootrc\n\n");
1243
1244 Connect(fLt, "Checked(TObject*, Bool_t)", "TRootBrowserLite",
1245 this, "Checked(TObject *,Bool_t)");
1246}
1247
1248////////////////////////////////////////////////////////////////////////////////
1249/// handle keys
1250
1252{
1253 if (event->fType == kGKeyPress) {
1254 UInt_t keysym;
1255 char input[10];
1256 gVirtualX->LookupString(event, input, sizeof(input), keysym);
1257
1258 if (!event->fState && (EKeySym)keysym == kKey_F5) {
1259 Refresh(kTRUE);
1260 return kTRUE;
1261 }
1262 if (!event->fState && (EKeySym)keysym == kKey_Escape) {
1264 }
1265
1266 if (event->fState & kKeyMod1Mask) {
1267 switch ((EKeySym)keysym & ~0x20) {
1268 case kKey_Right:
1270 return kTRUE;
1271 case kKey_Left:
1273 return kTRUE;
1274 default:
1275 break;
1276 }
1277 }
1278 }
1279 return TGMainFrame::HandleKey(event);
1280}
1281
1282////////////////////////////////////////////////////////////////////////////////
1283/// Add items to the browser. This function has to be called
1284/// by the Browse() member function of objects when they are
1285/// called by a browser. If check < 0 (default) no check box is drawn,
1286/// if 0 then unchecked checkbox is added, if 1 checked checkbox is added.
1287
1289{
1290 if (!obj)
1291 return;
1292 if (obj->InheritsFrom("TObjectSpy"))
1293 return;
1294 if (!name) name = obj->GetName();
1295
1296 AddToBox(obj, name);
1297 if (check > -1) {
1299 TIter next(fIconBox->fList);
1300 if (!obj->IsFolder()) {
1301 while ((el = (TGFrameElement *) next())) {
1302 TGLVEntry *f = (TGLVEntry *) el->fFrame;
1303 if (f->GetUserData() == obj) {
1304 f->SetCheckedEntry(check);
1305 }
1306 }
1307 }
1308 }
1309
1310 // Don't show current dir and up dir links in the tree
1311 if (name[0] == '.' && ((name[1] == '\0') || (name[1] == '.' && name[2] == '\0')))
1312 return;
1313
1314 if (obj->IsFolder())
1315 AddToTree(obj, name, check);
1316}
1317
1318////////////////////////////////////////////////////////////////////////////////
1319/// Add a checkbox in the TGListTreeItem corresponding to obj
1320/// and a checkmark on TGLVEntry if check = kTRUE.
1321
1323{
1324 if (obj) {
1326 while (item) {
1329 item = fLt->FindItemByObj(item->GetNextSibling(), obj);
1330 }
1332 TIter next(fIconBox->fList);
1333 while ((el = (TGFrameElement *) next())) {
1334 TGLVEntry *f = (TGLVEntry *) el->fFrame;
1335 if (f->GetUserData() == obj) {
1336 f->SetCheckedEntry(check);
1337 }
1338 }
1339 }
1340}
1341
1342////////////////////////////////////////////////////////////////////////////////
1343/// Check / uncheck the TGListTreeItem corresponding to this
1344/// object and add a checkmark on TGLVEntry if check = kTRUE.
1345
1347{
1348 if (obj) {
1350 while (item) {
1352 item = fLt->FindItemByObj(item->GetNextSibling(), obj);
1354 TIter next(fIconBox->fList);
1355 if (!obj->IsFolder()) {
1356 while ((el = (TGFrameElement *) next())) {
1357 TGLVEntry *f = (TGLVEntry *) el->fFrame;
1358 if (f->GetUserData() == obj) {
1359 f->SetCheckedEntry(check);
1360 }
1361 }
1362 }
1363 }
1364 }
1365}
1366
1367////////////////////////////////////////////////////////////////////////////////
1368/// Remove checkbox from TGListTree and checkmark from TGListView.
1369
1371{
1372 if (obj) {
1374 while (item) {
1376 item = fLt->FindItemByObj(item->GetNextSibling(), obj);
1378 TIter next(fIconBox->fList);
1379 if (!obj->IsFolder()) {
1380 while ((el = (TGFrameElement *) next())) {
1381 TGLVEntry *f = (TGLVEntry *) el->fFrame;
1382 if (f->GetUserData() == obj) {
1383 f->SetCheckedEntry(kFALSE);
1384 }
1385 }
1386 }
1387 }
1388 }
1389}
1390
1391////////////////////////////////////////////////////////////////////////////////
1392/// Add items to the iconbox of the browser.
1393
1395{
1396 if (obj) {
1397 if (!name) name = obj->GetName() ? obj->GetName() : "NoName";
1398 //const char *titlePtr = obj->GetTitle() ? obj->GetTitle() : " ";
1399
1400 TClass *objClass = 0;
1401
1402 if (obj->IsA() == TKey::Class())
1403 objClass = TClass::GetClass(((TKey *)obj)->GetClassName());
1404 else if (obj->IsA() == TKeyMapFile::Class())
1406 else if (obj->InheritsFrom("TRemoteObject")) {
1407 // special case for remote object: get real object class
1409 if (!strcmp(robj->GetClassName(), "TKey"))
1410 objClass = TClass::GetClass(robj->GetKeyClassName());
1411 else
1412 objClass = TClass::GetClass(robj->GetClassName());
1413 }
1414 else
1415 objClass = obj->IsA();
1416
1418 }
1419}
1420
1421////////////////////////////////////////////////////////////////////////////////
1422/// Add items to the current TGListTree of the browser.
1423
1425{
1426 if (!obj)
1427 return;
1428 if (obj->InheritsFrom("TApplication"))
1429 fListLevel = 0;
1430 if (!fTreeLock) {
1431 if (!name) name = obj->GetName();
1432 if (name[0] == '.' && name[1] == '.')
1433 Info("AddToTree", "up one level %s", name);
1434 if(check > -1) {
1436 if (item) fLt->CheckItem(item, (Bool_t)check);
1437 TString tip(obj->ClassName());
1438 if (obj->GetTitle()) {
1439 tip += " ";
1440 tip += obj->GetTitle();
1441 }
1442 fLt->SetToolTipItem(item, tip.Data());
1443 } else {
1444 // special case for remote object
1445 if (obj->InheritsFrom("TRemoteObject")) {
1446 // Nothing to do
1447 } else if (fListLevel) {
1448 // check also if one of its parents is a remote object
1450 while (top->GetParent()) {
1451 TObject *tobj = (TObject *) top->GetUserData();
1452 if (tobj && (tobj->InheritsFrom("TRemoteObject") ||
1453 tobj->InheritsFrom("TApplicationRemote"))) {
1454 break;
1455 }
1456 top = top->GetParent();
1457 }
1458 }
1459 // add the object only if not already in the list
1460 if ((!fLt->FindChildByName(fListLevel, name)) &&
1461 (!fLt->FindChildByData(fListLevel, obj))) {
1463 Long64_t bsize, fsize, objsize = 0;
1464 TString objinfo = obj->GetObjectInfo(1, 1);
1465 TString infos = obj->GetName();
1466 infos += "\n";
1467 infos += obj->GetTitle();
1468 if (!objinfo.IsNull() && !objinfo.BeginsWith("x=")) {
1469 objsize = objinfo.Atoll();
1470 if (objsize > 0) {
1471 infos += "\n";
1472 bsize = fsize = objsize;
1473 if (fsize > 1024) {
1474 fsize /= 1024;
1475 if (fsize > 1024) {
1476 // 3.7MB is more informative than just 3MB
1477 infos += TString::Format("Size: %lld.%lldM", fsize/1024,
1478 (fsize%1024)/103);
1479 } else {
1480 infos += TString::Format("Size: %lld.%lldK", bsize/1024,
1481 (bsize%1024)/103);
1482 }
1483 } else {
1484 infos += TString::Format("Size: %lld bytes", bsize);
1485 }
1486 }
1487 }
1488 if (it)
1489 it->SetTipText(infos.Data());
1490 }
1491 }
1492 }
1493}
1494
1495////////////////////////////////////////////////////////////////////////////////
1496/// Browse object. This, in turn, will trigger the calling of
1497/// TRootBrowserLite::Add() which will fill the IconBox and the tree.
1498/// Emits signal "BrowseObj(TObject*)".
1499
1501{
1503 Emit("BrowseObj(TObject*)", (Longptr_t)obj);
1504
1505 if (obj != gROOT) {
1506 if (!fLt->FindItemByObj(fLt->GetFirstItem(), obj)) {
1507 fListLevel = 0;
1508 Add(obj);
1511 if (obj->IsFolder())
1513 fLt->ClearViewPort();
1515 }
1516 }
1517
1518 if (obj->IsFolder()) fIconBox->RemoveAll();
1519 obj->Browse(fBrowser);
1520 if ((fListLevel && obj->IsFolder()) || (!fListLevel && (obj == gROOT))) {
1521 fIconBox->Refresh();
1522 }
1523
1524 if (fBrowser) {
1526 }
1528
1531}
1532
1533////////////////////////////////////////////////////////////////////////////////
1534/// add new draw option to the "history"
1535
1537{
1538 TString opt = GetDrawOption();
1540 TGLBContainer *lbc = (TGLBContainer *)lb->GetContainer();
1541
1542 TIter next(lbc->GetList());
1544
1545 while ((el = (TGFrameElement *)next())) {
1546 TGTextLBEntry *lbe = (TGTextLBEntry *)el->fFrame;
1547 if (lbe->GetText()->GetString() == opt) {
1548 return;
1549 }
1550 }
1551
1553 fDrawOption->AddEntry(opt.Data(), nn);
1555}
1556
1557////////////////////////////////////////////////////////////////////////////////
1558/// returns pointer to fIconBox object
1559
1564
1565////////////////////////////////////////////////////////////////////////////////
1566/// Really delete the browser and the this GUI.
1567
1569{
1571 delete this;
1572}
1573
1574////////////////////////////////////////////////////////////////////////////////
1575/// In case window is closed via WM we get here.
1576
1581
1582////////////////////////////////////////////////////////////////////////////////
1583/// Display in statusbar total number of objects and number of
1584/// selected objects in IconBox.
1585
1587{
1588 char tmp[64];
1589 const char *fmt;
1590
1591 if (selected)
1592 fmt = "%d Object%s, %d selected.";
1593 else
1594 fmt = "%d Object%s.";
1595
1596 snprintf(tmp, 64, fmt, total, (total == 1) ? "" : "s", selected);
1597 fStatusBar->SetText(tmp, 0);
1598}
1599
1600////////////////////////////////////////////////////////////////////////////////
1601/// Display current directory in second label, fLbl2.
1602
1604{
1605 char *p, path[1024];
1606
1608 p = path;
1609 while (*p && *(p+1) == '/') ++p;
1610 if (!p[0])
1611 fLbl2->SetText(new TGString("Contents of \".\""));
1612 else
1613 fLbl2->SetText(new TGString(Form("Contents of \"%s\"", p)));
1614 fListHdr->Layout();
1615
1616 // Get full pathname for FS combobox (previously truncated to 12 levels deep)
1618 p = path;
1619 while (*p && *(p+1) == '/') ++p;
1621
1622 if (fListLevel) {
1623 // disable/enable up level navigation
1626
1628 Bool_t disableUp = dirname == "/";
1629
1630 // normal file directory
1631 if (disableUp && (obj) && (obj->IsA() == TSystemDirectory::Class())) {
1632 disableUp = strlen(p) == 1;
1633 }
1634 btn->SetState(disableUp ? kButtonDisabled : kButtonUp);
1636 }
1637}
1638
1639////////////////////////////////////////////////////////////////////////////////
1640/// Execute default action for selected object (action is specified
1641/// in the $HOME/.root.mimes or $ROOTSYS/etc/root.mimes file.
1642/// Emits signal "ExecuteDefaultAction(TObject*)".
1643
1645{
1647 char action[512];
1649 TVirtualPad *wasp = gPad ? (TVirtualPad*)gPad->GetCanvas() : nullptr;
1650 TFile *wasf = gFile;
1651
1652 // Special case for file system objects...
1653 if (obj->IsA() == TSystemFile::Class() ||
1654 obj->InheritsFrom("TRemoteObject")) {
1655 TString act;
1656 TString ext = obj->GetName();
1657
1658 if (fClient->GetMimeTypeList()->GetAction(obj->GetName(), action)) {
1659 act = action;
1660 act.ReplaceAll("%s", obj->GetName());
1661 gInterpreter->SaveGlobalsContext();
1662
1663 if (act[0] == '!') {
1664 act.Remove(0, 1);
1665 gSystem->Exec(act.Data());
1666 } else {
1667 // special case for remote object: remote process
1668 if (obj->InheritsFrom("TRemoteObject"))
1670 gApplication->ProcessLine(act.Data());
1671 }
1672 Emit("ExecuteDefaultAction(TObject*)", (Longptr_t)obj);
1673 }
1674
1675 // special case for remote object: browse real object
1676 if (obj->InheritsFrom("TRemoteObject") && ext.EndsWith(".root")) {
1679 gApplication->ProcessLine("((TApplicationServer *)gApplication)->BrowseFile(0);");
1680 Refresh();
1681 }
1682 ////////// new TFile was opened. Add it to the browser /////
1683 if (gFile && (wasf != gFile) && ext.EndsWith(".root")) {
1684 TGListTreeItem *itm = fLt->FindChildByData(0, gROOT->GetListOfFiles());
1685
1686 if (itm) {
1688 fListLevel = itm;
1691 itm = fLt->AddItem(fListLevel, gFile->GetName());
1692 itm->SetUserData(gFile);
1694 return;
1695 }
1696 }
1697
1698 // only valid for local text files
1699 if (!obj->InheritsFrom("TRemoteObject"))
1700 BrowseTextFile(obj->GetName());
1701
1702 /////////////// cache and change file's icon ///////////////////////
1703 TVirtualPad *nowp = gPad ? (TVirtualPad*)gPad->GetCanvas() : nullptr;
1704
1705 if (fIconBox->fAutoThumbnail && nowp && (nowp != wasp)) {
1706 TSystemFile *sf = (TSystemFile*)obj;
1707 const TGPicture *pic, *spic;
1708
1709 TString path;
1710 if (gSystem->IsAbsoluteFileName(sf->GetName())) {
1711 path = sf->GetName();
1712 } else {
1713 char *buf = gSystem->ConcatFileName(gSystem->WorkingDirectory(), sf->GetName());
1714 path = buf;
1715 delete [] buf;
1716 }
1717
1719
1720 if (!thumb) {
1722 nowp->Modified();
1723 nowp->Update();
1724 img->FromPad(nowp);
1725
1726 if (!img->IsValid()) {
1727 return;
1728 }
1729
1730 static const UInt_t sz = 72;
1731 UInt_t w = sz;
1732 UInt_t h = sz;
1733
1734 auto imgw = img->GetWidth();
1735 auto imgh = img->GetHeight();
1736
1737 if (imgw > imgh) {
1738 h = (imgh*sz) / (imgw > 0 ? imgw : 1);
1739 } else {
1740 w = (imgw*sz) / (imgh > 0 ? imgh : 1);
1741 }
1742
1743 w = (w < 54) ? 54 : w;
1744 h = (h < 54) ? 54 : h;
1745
1746 img->Scale(w, h);
1747 img->Merge(img, "tint"); // contrasting
1748 img->DrawBox(0, 0, w, h, "#ffff00", 1); // yellow frame
1749
1750 pic = fClient->GetPicturePool()->GetPicture(path.Data(), img->GetPixmap(), 0);
1751 img->Scale(w/3, h/3);
1752 spic = fClient->GetPicturePool()->GetPicture(path.Data(), img->GetPixmap(), 0);
1753
1754 thumb = new TIconBoxThumb(path.Data(), spic, pic);
1756 delete img;
1757 }
1758 }
1759 return;
1760 }
1761
1762 // For other objects the default action is still hard coded in
1763 // their Browse() member function.
1764}
1765
1766////////////////////////////////////////////////////////////////////////////////
1767/// Handle menu and other command generated by the user.
1768
1770{
1773 TDirectory *tdir = 0;
1774 TString cmd;
1775
1776 if (GET_SUBMSG(msg) != kCT_SELCHANGED) {
1778 }
1779
1780 TObject *obj;
1781 TGListTreeItem *item = 0;
1782
1783 gVirtualX->Update();
1784
1785 switch (GET_MSG(msg)) {
1786
1787 case kC_COMMAND:
1788
1789 switch (GET_SUBMSG(msg)) {
1790
1791 case kCM_BUTTON:
1792 // fallthrough
1793 case kCM_MENU:
1794
1795 switch ((ERootBrowserCommands)parm1) {
1796 // Handle File menu items...
1798 new TBrowser("Browser", "ROOT Object Browser");
1799 break;
1800 case kFileNewBrowser:
1801 gEnv->SetValue("Browser.Name", "TRootBrowser");
1802 new TBrowser();
1803 gEnv->SetValue("Browser.Name", "TRootBrowserLite");
1804 break;
1805 case kFileNewCanvas:
1806 gROOT->MakeDefCanvas();
1807 break;
1808 case kFileNewBuilder:
1810 break;
1811 case kFileOpen:
1812 {
1813 static TString dir(".");
1814 TGFileInfo fi;
1815 fi.fFileTypes = gOpenTypes;
1816 fi.SetIniDir(dir);
1817 new TGFileDialog(fClient->GetDefaultRoot(), this,
1818 kFDOpen,&fi);
1819 dir = fi.fIniDir;
1820 if (fi.fMultipleSelection && fi.fFileNamesList) {
1821 TObjString *el;
1822 TIter next(fi.fFileNamesList);
1823 while ((el = (TObjString *) next())) {
1824 new TFile(el->GetString(), "update");
1825 }
1826 }
1827 else if (fi.fFilename) {
1828 new TFile(fi.fFilename, "update");
1829 }
1830 }
1831 break;
1832 case kFileSave:
1833 case kFileSaveAs:
1834 break;
1835 case kFilePrint:
1836 break;
1837 case kFileCloseBrowser:
1839 break;
1840 case kFileQuit:
1842 break;
1843
1844 // Handle View menu items...
1845 case kViewToolBar:
1848 else
1849 ShowToolBar();
1850 break;
1851 case kViewStatusBar:
1854 else
1855 ShowStatusBar();
1856 break;
1857 case kViewLargeIcons:
1858 case kViewSmallIcons:
1859 case kViewList:
1860 case kViewDetails:
1862 break;
1863 case kViewHidden:
1867 } else {
1870 }
1871 Refresh(kTRUE);
1872 break;
1873 case kViewArrangeByName:
1874 case kViewArrangeByType:
1875 case kViewArrangeBySize:
1876 case kViewArrangeByDate:
1878 break;
1879 case kViewLineUp:
1880 break;
1881 case kViewRefresh:
1882 Refresh(kTRUE);
1883 break;
1884 case kViewGroupLV:
1887 TString gv = gEnv->GetValue("Browser.GroupView", "10000");
1888 Int_t igv = atoi(gv.Data());
1889
1890 if (igv > 10) {
1892 }
1893 } else {
1895 fIconBox->SetGroupSize(10000000); // very large value
1896 }
1897 break;
1898
1899 // Handle Option menu items...
1900 case kOptionShowCycles:
1901 printf("Currently the browser always shows all cycles\n");
1902 break;
1903
1909 Refresh(kTRUE);
1910 } else {
1913 }
1914 break;
1915
1916 // Handle toolbar button...
1917 case kOneLevelUp:
1918 {
1919 if (fBrowseTextFile) {
1920 HideTextEdit();
1921 break;
1922 }
1923 if (!fListLevel || !fListLevel->IsActive()) break;
1924
1925 if (fListLevel && fIconBox->WasGrouped()) {
1926 if (fListLevel) {
1928 if (item) fListLevel = item;
1929 obj = (TObject *) fListLevel->GetUserData();
1931 if (obj) BrowseObj(obj);
1932 }
1933
1935 break;
1936 }
1938
1939
1940 if (item) {
1941 fListLevel = item;
1942 obj = (TObject *)fListLevel->GetUserData();
1945 if (obj) BrowseObj(obj);
1947 } else {
1948 obj = (TObject *)fListLevel->GetUserData();
1949 if (obj) ToSystemDirectory(gSystem->GetDirName(obj->GetTitle()));
1950 }
1951 break;
1952 }
1953
1954 // toolbar buttons
1955 case kHistoryBack:
1957 break;
1958 case kHistoryForw:
1960 break;
1961
1962 case kViewFind:
1963 Search();
1964 break;
1965
1966 // Handle Help menu items...
1967 case kHelpAbout:
1968 {
1969#ifdef WIN32
1971#else
1972 char str[32];
1973 snprintf(str, 32, "About ROOT %s...", gROOT->GetVersion());
1974 hd = new TRootHelpDialog(this, str, 600, 400);
1975 hd->SetText(gHelpAbout);
1976 hd->Popup();
1977#endif
1978 }
1979 break;
1980 case kHelpOnCanvas:
1981 hd = new TRootHelpDialog(this, "Help on Canvas...", 600, 400);
1982 hd->SetText(gHelpCanvas);
1983 hd->Popup();
1984 break;
1985 case kHelpOnMenus:
1986 hd = new TRootHelpDialog(this, "Help on Menus...", 600, 400);
1987 hd->SetText(gHelpPullDownMenus);
1988 hd->Popup();
1989 break;
1990 case kHelpOnGraphicsEd:
1991 hd = new TRootHelpDialog(this, "Help on Graphics Editor...", 600, 400);
1992 hd->SetText(gHelpGraphicsEditor);
1993 hd->Popup();
1994 break;
1995 case kHelpOnBrowser:
1996 hd = new TRootHelpDialog(this, "Help on Browser...", 600, 400);
1997 hd->SetText(gHelpBrowserLite);
1998 hd->Popup();
1999 break;
2000 case kHelpOnObjects:
2001 hd = new TRootHelpDialog(this, "Help on Objects...", 600, 400);
2002 hd->SetText(gHelpObjects);
2003 hd->Popup();
2004 break;
2005 case kHelpOnPS:
2006 hd = new TRootHelpDialog(this, "Help on PostScript...", 600, 400);
2007 hd->SetText(gHelpPostscript);
2008 hd->Popup();
2009 break;
2010 case kHelpOnRemote:
2011 hd = new TRootHelpDialog(this, "Help on Browser...", 600, 400);
2012 hd->SetText(gHelpRemote);
2013 hd->Popup();
2014 break;
2015 default:
2016 break;
2017 }
2018 break;
2019 case kCM_COMBOBOX:
2020 if (parm1 == kFSComboBox) {
2022 if (e) {
2023 const char *dirname = e->GetPath()->GetString();
2025 if (item) {
2026 fListLevel = item;
2030 } else {
2032 }
2033 }
2034 }
2035 break;
2036 default:
2037 break;
2038 }
2039
2040 break;
2041
2042 case kC_LISTTREE:
2043 switch (GET_SUBMSG(msg)) {
2044
2045 case kCT_ITEMCLICK:
2046 // tell coverity that parm1 is a Long_t, and not an enum (even
2047 // if we compare it with an enum value) and the meaning of
2048 // parm1 depends on GET_MSG(msg) and GET_SUBMSG(msg)
2049 // coverity[mixed_enums]
2050 if (((EMouseButton)parm1 == kButton1) ||
2051 ((EMouseButton)parm1 == kButton3)) {
2052 HideTextEdit();
2054 TObject *obj2 = 0;
2055 if ((item2 = fLt->GetSelected()) != 0 ) {
2057 fStatusBar->SetText("", 1); // clear
2058 }
2059 if (item2 && parm1 == kButton3) {
2060 Int_t x = (Int_t)(parm2 & 0xffff);
2061 Int_t y = (Int_t)((parm2 >> 16) & 0xffff);
2062 obj2 = (TObject *) item2->GetUserData();
2063 if (obj2) {
2064 if (obj2->InheritsFrom("TTree")) {
2065 // if a tree not attached to any directory (e.g. in a TFolder)
2066 // then attach it to the current directory (gDirectory)
2067 cmd = TString::Format("((TTree *)0x%zx)->GetDirectory();",
2068 (size_t)obj2);
2069 tdir = (TDirectory *)gROOT->ProcessLine(cmd.Data());
2070 if (!tdir) {
2071 cmd = TString::Format("((TTree *)0x%zx)->SetDirectory(gDirectory);",
2072 (size_t)obj2);
2073 gROOT->ProcessLine(cmd.Data());
2074 }
2075 }
2077 }
2078 }
2081 fListView->Layout();
2082 }
2083 break;
2084
2085 case kCT_ITEMDBLCLICK:
2086 if (parm1 == kButton1) {
2087 if (fBrowseTextFile) {
2088 HideTextEdit();
2089 }
2090 if (fListLevel && fIconBox->WasGrouped()) {
2091 TObject *obj2;
2093
2094 if (fListLevel) {
2096 if (item2) fListLevel = item2;
2097
2100 if (obj2) {
2101 BrowseObj(obj2);
2102 }
2103 }
2104 break;
2105 }
2106 }
2107
2108 default:
2109 break;
2110 }
2111 break;
2112
2113 case kC_CONTAINER:
2114 switch (GET_SUBMSG(msg)) {
2115
2116 case kCT_ITEMCLICK:
2117 if (fIconBox->NumSelected() == 1) {
2118 // display title of selected object
2120 void *p = 0;
2121 if ((item2 = (TGFileItem *)fIconBox->GetNextSelected(&p)) != 0) {
2122 TObject *obj2 = (TObject *)item2->GetUserData();
2123
2124 TGListTreeItem *itm = 0;
2125 if (!fListLevel) itm = fLt->GetFirstItem();
2126 else itm = fListLevel->GetFirstChild();
2127 //Bool_t found = kFALSE;
2128
2129 while (itm) {
2130 if (itm->GetUserData() == obj2) break;
2131 itm = itm->GetNextSibling();
2132 }
2133
2134 if (itm) {
2135 if ((fListLevel && fListLevel->IsOpen()) || !fListLevel) {
2139 }
2140 }
2141
2142 if (obj2) fStatusBar->SetText(obj2->GetName(), 1);
2143 }
2144 }
2145 if (parm1 == kButton3) {
2146 // show context menu for selected object
2147 if (fIconBox->NumSelected() == 1) {
2148 void *p = 0;
2150 if ((item2 = (TGFileItem *) fIconBox->GetNextSelected(&p)) != 0) {
2151 Int_t x = (Int_t)(parm2 & 0xffff);
2152 Int_t y = (Int_t)((parm2 >> 16) & 0xffff);
2153 TObject *obj2 = (TObject *)item2->GetUserData();
2154 if (obj2) {
2155 if (obj2->IsA() == TKey::Class()) {
2156 TKey *key = (TKey*)obj2;
2157 TClass *cl = TClass::GetClass(key->GetClassName());
2158 TString name = key->GetName();
2159 name += ";";
2160 name += key->GetCycle();
2161 //void *add = gROOT->FindObject((char *) name.Data());//key->GetName());
2162 void *add = gDirectory->FindObjectAny((char *) name.Data());
2163 if (cl->IsTObject()) {
2164 obj2 = (TObject*)add; // cl->DynamicCast(TObject::Class(),startadd);
2165 item2->SetUserData(obj2);
2166 } else {
2167 Error("ProcessMessage","do not support non TObject (like %s) yet",
2168 cl->GetName());
2169 break;
2170 }
2171 }
2172 if (obj2 && obj2->InheritsFrom("TTree")) {
2173 // if a tree not attached to any directory (e.g. in a TFolder)
2174 // then attach it to the current directory (gDirectory)
2175 cmd = TString::Format("((TTree *)0x%zx)->GetDirectory();",
2176 (size_t)obj2);
2177 tdir = (TDirectory *)gROOT->ProcessLine(cmd.Data());
2178 if (!tdir) {
2179 cmd = TString::Format("((TTree *)0x%zx)->SetDirectory(gDirectory);",
2180 (size_t)obj2);
2181 gROOT->ProcessLine(cmd.Data());
2182 }
2183 }
2185 }
2186 }
2187 }
2188 }
2189 break;
2190 case kCT_ITEMDBLCLICK:
2191 if (parm1 == kButton1) {
2192 if (fIconBox->NumSelected() == 1) {
2193 void *p = 0;
2195 if ((item2 = (TGFileItem *) fIconBox->GetNextSelected(&p)) != 0) {
2196 TObject *obj2 = (TObject *)item2->GetUserData();
2197 if (obj2) {
2200 }
2201 delete cursorSwitcher;
2202 return kTRUE; //
2203 }
2204 }
2205 }
2206 break;
2207 case kCT_SELCHANGED:
2209 break;
2210 default:
2211 break;
2212 }
2213
2214 break;
2215
2216 default:
2217 break;
2218 }
2219
2220 delete cursorSwitcher;
2221
2223 return kTRUE;
2224}
2225
2226////////////////////////////////////////////////////////////////////////////////
2227/// Make object associated with item the current directory.
2228
2230{
2231 if (item) {
2232 TGListTreeItem *i = item;
2233 TString dir;
2234 while (i) {
2235 TObject *obj = (TObject*) i->GetUserData();
2236 if (obj) {
2237 if (obj->IsA() == TDirectoryFile::Class()) {
2238 dir = "/" + dir;
2239 dir = obj->GetName() + dir;
2240 }
2241 if (obj->IsA() == TFile::Class()) {
2242 dir = ":/" + dir;
2243 dir = obj->GetName() + dir;
2244 }
2245 if (obj->IsA() == TKey::Class()) {
2246 if (strcmp(((TKey*)obj)->GetClassName(), "TDirectoryFile") == 0) {
2247 dir = "/" + dir;
2248 dir = obj->GetName() + dir;
2249 }
2250 }
2251 }
2252 i = i->GetParent();
2253 }
2254
2255 if (gDirectory && dir.Length()) gDirectory->cd(dir.Data());
2256 }
2257}
2258
2259////////////////////////////////////////////////////////////////////////////////
2260/// helper method to track history
2261
2263{
2264 if (!fListLevel) return;
2265
2268}
2269
2270////////////////////////////////////////////////////////////////////////////////
2271/// helper method to track history
2272
2274{
2277
2278 if (!item || (fHistoryCursor &&
2279 (item == ((TRootBrowserHistoryCursor*)fHistoryCursor)->fItem))) return;
2280
2283 delete cur;
2284 }
2285
2287 fHistory->Add(cur);
2289 btn->SetState(kButtonUp);
2290}
2291
2292////////////////////////////////////////////////////////////////////////////////
2293/// clear navigation history
2294
2303
2304////////////////////////////////////////////////////////////////////////////////
2305/// go to the past
2306
2308{
2309 if (fBrowseTextFile) {
2310 HideTextEdit();
2311 return kFALSE;
2312 }
2316
2317 if (!cur) {
2318 btn->SetState(kButtonDisabled);
2319 return kFALSE;
2320 }
2321
2324 fListLevel = cur->fItem;
2328
2329 btn2->SetState(kButtonUp);
2331 if (!cur) {
2332 btn->SetState(kButtonDisabled);
2333 return kFALSE;
2334 }
2335
2336 return kTRUE;
2337}
2338
2339////////////////////////////////////////////////////////////////////////////////
2340/// go to the future
2341
2343{
2344 if (fBrowseTextFile) {
2345 HideTextEdit();
2346 return kFALSE;
2347 }
2348
2352
2353 if (!cur) {
2354 btn->SetState(kButtonDisabled);
2355 return kFALSE;
2356 }
2357
2360 fListLevel = cur->fItem;
2364
2365 btn2->SetState(kButtonUp);
2366
2368 if (!cur) {
2369 btn->SetState(kButtonDisabled);
2370 return kFALSE;
2371 }
2372
2373 return kTRUE;
2374}
2375
2376////////////////////////////////////////////////////////////////////////////////
2377/// delete list tree item, remove it from history
2378
2384
2385////////////////////////////////////////////////////////////////////////////////
2386/// Open tree item and list in iconbox its contents.
2387
2389{
2390 if (item) {
2391 TObject *obj = (TObject *) item->GetUserData();
2392
2393 if (obj) {
2394 if (obj->IsA() == TKey::Class()) {
2395
2396 TKey *key = (TKey *)obj;
2397 TString name = obj->GetName();
2398 name += ";";
2399 name += key->GetCycle();
2400 Chdir(item->GetParent());
2401 //TObject *k_obj = gROOT->FindObject(name);
2402 TObject *k_obj = gDirectory->FindObjectAny(name);
2403
2404 if (k_obj) {
2405 item->SetUserData(k_obj);
2406 obj = k_obj;
2407 }
2408 } else if (obj->InheritsFrom(TDirectoryFile::Class())) {
2409 Chdir(item->GetParent());
2410 }
2411 else if (obj->InheritsFrom("TApplicationRemote")) {
2412 if (!gApplication->GetAppRemote()) {
2413 gROOT->ProcessLine(Form(".R %s", item->GetText()));
2414 if (gApplication->GetAppRemote()) {
2415 Getlinem(kInit, TString::Format("\n%s:root [0]",
2417 }
2418 }
2419 }
2420 else if (obj->InheritsFrom("TRemoteObject")) {
2421 // special case for remote object
2423 // the real object is a TKey
2424 if (!strcmp(robj->GetClassName(), "TKey")) {
2425 TGListTreeItem *parent = item;
2427 // find the TFile remote object containing the TKey
2428 while ( probj && strcmp(probj->GetClassName(), "TFile")) {
2429 parent = parent->GetParent();
2430 probj = (TRemoteObject *)parent->GetUserData();
2431 }
2432 if (probj) {
2433 // remotely browse file (remotely call TFile::cd())
2436 TString::Format("((TApplicationServer *)gApplication)->BrowseFile(\"%s\");",
2437 probj->GetName()));
2438 }
2439 }
2440 }
2441 if (item->GetParent() && item->GetParent()->GetUserData() &&
2442 ((TObject *)item->GetParent()->GetUserData())->InheritsFrom("TApplicationRemote")) {
2443 // switch to remote session
2444 if (!gApplication->GetAppRemote()) {
2445 gROOT->ProcessLine(Form(".R %s", item->GetParent()->GetText()));
2446 if (gApplication->GetAppRemote()) {
2447 Getlinem(kInit, TString::Format("\n%s:root [0]",
2449 }
2450 }
2451 else if (!strcmp(item->GetText(), "ROOT Files")) {
2452 // update list of files opened in the remote session
2454 gApplication->ProcessLine("((TApplicationServer *)gApplication)->BrowseFile(0);");
2455 }
2456 }
2457 else {
2458 // check if the listtree item is from a local session or
2459 // from a remote session, then switch to the session it belongs to
2460 TGListTreeItem *top = item;
2461 while (top->GetParent()) {
2462 top = top->GetParent();
2463 }
2464 TObject *topobj = (TObject *) top->GetUserData();
2465 if (topobj && topobj->InheritsFrom("TApplicationRemote")) {
2466 // it belongs to a remote session
2467 if (!gApplication->GetAppRemote()) {
2468 // switch to remote session if not already in
2469 gROOT->ProcessLine(Form(".R %s", top->GetText()));
2470 if (gApplication->GetAppRemote()) {
2471 Getlinem(kInit, TString::Format("\n%s:root [0]",
2473 }
2474 }
2475 }
2476 else if (gApplication->GetAppRemote()) {
2477 // switch back to local session if not already in
2479 Getlinem(kInit, "\nroot [0]");
2480 }
2481 }
2482
2483 if (!fListLevel || !fListLevel->IsActive()) {
2484 fListLevel = item;
2485 BrowseObj(obj);
2487 }
2488 }
2490 }
2491}
2492
2493////////////////////////////////////////////////////////////////////////////////
2494/// display directory
2495
2497{
2498 TString dir = dirname;
2499
2500 if (fListLevel) {
2502
2503 if (obj && (obj->IsA() == TSystemDirectory::Class())) {
2504 TObject* old = obj;
2505 fListLevel->Rename(dir.Data());
2506 obj = new TSystemDirectory(dir.Data(), dir.Data());
2507 while (fListLevel->GetFirstChild())
2510
2511 fListLevel->SetUserData(obj);
2512 gROOT->GetListOfBrowsables()->Remove(old);
2513 delete old;
2514 gROOT->GetListOfBrowsables()->Add(obj);
2515 fTreeLock = kTRUE;
2516 BrowseObj(obj);
2517 fTreeLock = kFALSE;
2518
2522 //gSystem->ChangeDirectory(dir.Data());
2523 fStatusBar->SetText(dir.Data(), 1);
2524 ClearHistory(); // clear browsing history
2525 }
2526 }
2527 return;
2528}
2529
2530////////////////////////////////////////////////////////////////////////////////
2531/// sets drawing option
2532
2537
2538////////////////////////////////////////////////////////////////////////////////
2539/// returns drawing option
2540
2542{
2543 return fDrawOption->GetTextEntry()->GetText();
2544}
2545////////////////////////////////////////////////////////////////////////////////
2546/// Emits signal when double clicking on icon.
2547
2549{
2550 Emit("DoubleClicked(TObject*)", (Longptr_t)obj);
2551}
2552
2553////////////////////////////////////////////////////////////////////////////////
2554/// Emits signal when double clicking on icon.
2555
2557{
2558 Longptr_t args[2];
2559
2560 args[0] = (Longptr_t)obj;
2561 args[1] = checked;
2562
2563 Emit("Checked(TObject*,Bool_t)", args);
2564}
2565
2566////////////////////////////////////////////////////////////////////////////////
2567/// Default action when double clicking on icon.
2568
2570{
2572 if (obj) {
2573
2575
2577
2578 if (obj->IsA()->GetMethodWithPrototype("Browse", "TBrowser*"))
2579 browsable = kTRUE;
2580
2581 if (obj->InheritsFrom("TLeaf")) {
2582 TObject *dir = (TObject *)gROOT->ProcessLine(Form("((%s *)0x%zx)->GetBranch()->GetDirectory();",
2583 obj->ClassName(), (size_t)obj));
2584 if (!dir) {
2585 browsable = kFALSE;
2586 }
2587 }
2588 if (obj->InheritsFrom("TBranchElement")) {
2589 TObject *dir = (TObject *)gROOT->ProcessLine(Form("((%s *)0x%zx)->GetDirectory();",
2590 obj->ClassName(), (size_t)obj));
2591 if (!dir) {
2592 browsable = kFALSE;
2593 }
2594 }
2595
2596 if (obj->InheritsFrom("TKey")) {
2597 TKey *key = dynamic_cast<TKey*>(obj);
2598 if (key && key->GetClassName() && (!strcmp(key->GetClassName(), "TFormula")))
2599 browsable = kFALSE;
2600 }
2601
2602 if (obj->IsA() == TSystemDirectory::Class()) {
2603 useLock = kFALSE;
2604
2605 TString t(obj->GetName());
2606 if (t == ".") goto out;
2607 if (t == "..") {
2608 if (fListLevel && fListLevel->GetParent()) {
2610 obj = (TObject*)fListLevel->GetUserData();
2611 if (fListLevel->GetParent()) {
2613 } else {
2614 obj = (TObject*)fListLevel->GetUserData();
2615 fListLevel = 0;
2616 }
2617 } else {
2620 return;
2621 }
2622 }
2623 }
2624
2625 if (obj && obj->IsFolder()) {
2627 TGListTreeItem *itm = nullptr;
2628
2629 if (fListLevel) {
2632 } else {
2633 itm = fLt->GetFirstItem();
2634 }
2635
2636 while (itm && (itm->GetUserData() != obj)) {
2637 itm = itm->GetNextSibling();
2638 }
2639
2640 if (!itm && fListLevel) {
2641 // special case for remote objects
2643 if (obj->InheritsFrom("TRemoteObject"))
2644 isRemote = kTRUE;
2645 else if (fListLevel) {
2646 // check also if one of its parents is a remote object
2648 while (top->GetParent()) {
2649 TObject *tobj = (TObject *) top->GetUserData();
2650 if (tobj && (tobj->InheritsFrom("TRemoteObject") ||
2651 tobj->InheritsFrom("TApplicationRemote"))) {
2652 isRemote = kTRUE;
2653 break;
2654 }
2655 top = top->GetParent();
2656 }
2657 }
2658 if (isRemote) {
2659 // add the remote object only if not already in the list
2660 if ((!fLt->FindChildByName(fListLevel, obj->GetName())) &&
2661 (!fLt->FindChildByData(fListLevel, obj))) {
2662 itm = fLt->AddItem(fListLevel, obj->GetName());
2663 if (itm) itm->SetUserData(obj);
2664 }
2665 else {
2666 // set the current item to the one found in the list
2670 }
2671 }
2672 else {
2673 itm = fLt->AddItem(fListLevel, obj->GetName());
2674 if (itm) itm->SetUserData(obj);
2675 }
2676 }
2677
2678 if (itm) {
2679 fListLevel = itm;
2681 TObject *kobj = (TObject *)itm->GetUserData();
2682
2683 if (kobj && kobj->IsA() == TKey::Class()) {
2685 //kobj = gROOT->FindObject(kobj->GetName());
2686 kobj = gDirectory->FindObjectAny(kobj->GetName());
2687
2688 if (kobj) {
2689 TGListTreeItem *parent = fListLevel->GetParent();
2691 TGListTreeItem *kitem = fLt->AddItem(parent, kobj->GetName(), kobj);
2692 if (kitem) {
2693 obj = kobj;
2694 useLock = kFALSE;
2695 kitem->SetUserData(kobj);
2696 fListLevel = kitem;
2697 } else
2698 fListLevel = parent;
2699 }
2700 }
2702 }
2703 }
2704
2705 if (browsable) {
2706 if (useLock) fTreeLock = kTRUE;
2707 Emit("BrowseObj(TObject*)", (Longptr_t)obj);
2708 if (obj) obj->Browse(fBrowser);
2709 if (useLock) fTreeLock = kFALSE;
2710 }
2711
2712out:
2713 if (obj && obj->IsA() != TSystemFile::Class()) {
2714 if (obj->IsFolder()) {
2715 fIconBox->Refresh();
2716 }
2717
2718 if (fBrowser) {
2720 }
2721
2724 }
2725 }
2726}
2727
2728////////////////////////////////////////////////////////////////////////////////
2729/// Recursively remove object from browser.
2730
2732{
2733 // don't delete fIconBox items here (it's status will be updated
2734 // via TBrowser::Refresh() which should be called once all objects have
2735 // been removed.
2736
2738 if (item == 0)
2739 return;
2740 if (fListLevel && (item == fListLevel)) {
2741 TGListTreeItem *parent = item->GetParent();
2742 if (parent) {
2743 fListLevel = parent;
2747 }
2748 else
2749 fListLevel = 0;
2750 }
2752}
2753
2754////////////////////////////////////////////////////////////////////////////////
2755/// Refresh the browser contents.
2756
2758{
2760
2761 if (fTextEdit && !gROOT->IsExecutingMacro() && force) {
2764 return;
2765 }
2766
2767 if ( (refresh || force) && !fIconBox->WasGrouped()
2769
2771 static UInt_t prev = 0;
2772 UInt_t curr = gROOT->GetListOfBrowsables()->GetSize();
2773 if (!prev) prev = curr;
2774
2775 if (prev != curr) { // refresh gROOT
2777 fListLevel = 0;
2779 fListLevel = sav;
2780 prev = curr;
2781 }
2782
2783 // Refresh the IconBox
2784 if (fListLevel) {
2786 if (obj) {
2787 fTreeLock = kTRUE;
2788 BrowseObj(obj);
2789 fTreeLock = kFALSE;
2790 }
2791 }
2792 }
2794}
2795
2796////////////////////////////////////////////////////////////////////////////////
2797/// Show or hide toolbar.
2798
2811
2812////////////////////////////////////////////////////////////////////////////////
2813/// Show or hide statusbar.
2814
2825
2826////////////////////////////////////////////////////////////////////////////////
2827/// Set defaults depending on settings in the user's .rootrc.
2828
2829void TRootBrowserLite::SetDefaults(const char *iconStyle, const char *sortBy)
2830{
2831 const char *opt;
2832
2833 // IconStyle: big, small, list, details
2834 if (iconStyle)
2835 opt = iconStyle;
2836 else
2837 opt = gEnv->GetValue("Browser.IconStyle", "small");
2838 if (!strcasecmp(opt, "big"))
2840 else if (!strcasecmp(opt, "small"))
2842 else if (!strcasecmp(opt, "list"))
2844 else if (!strcasecmp(opt, "details"))
2846 else
2848
2849 // SortBy: name, type, size, date
2850 if (sortBy)
2851 opt = sortBy;
2852 else
2853 opt = gEnv->GetValue("Browser.SortBy", "name");
2854 if (!strcasecmp(opt, "name"))
2856 else if (!strcasecmp(opt, "type"))
2858 else if (!strcasecmp(opt, "size"))
2860 else if (!strcasecmp(opt, "date"))
2862 else
2864
2865 fIconBox->Refresh();
2866}
2867
2868////////////////////////////////////////////////////////////////////////////////
2869/// Set iconbox's view mode and update menu and toolbar buttons accordingly.
2870
2872{
2873 int i, bnum;
2875
2876 if (force || (fViewMode != new_mode)) {
2877
2878 switch (new_mode) {
2879 default:
2880 if (!force)
2881 return;
2882 else
2884 // intentionally no break
2885 case kViewLargeIcons:
2886 bnum = 2;
2887 lv = kLVLargeIcons;
2888 break;
2889 case kViewSmallIcons:
2890 bnum = 3;
2891 lv = kLVSmallIcons;
2892 break;
2893 case kViewList:
2894 bnum = 4;
2895 lv = kLVList;
2896 break;
2897 case kViewDetails:
2898 bnum = 5;
2899 lv = kLVDetails;
2900 break;
2901 }
2902
2905
2906 for (i = 2; i <= 5; ++i)
2907 gToolBarData[i].fButton->SetState((i == bnum) ? kButtonEngaged : kButtonUp);
2908
2911 if ((lv == kLVDetails) && (buttons)) {
2912 if (!strcmp(fListView->GetHeader(1), "Attributes")) {
2913 buttons[0]->Connect("Clicked()", "TRootBrowserLite", this,
2914 TString::Format("SetSortMode(=%d)", kViewArrangeByName));
2915 buttons[1]->Connect("Clicked()", "TRootBrowserLite", this,
2916 TString::Format("SetSortMode(=%d)", kViewArrangeByType));
2917 buttons[2]->Connect("Clicked()", "TRootBrowserLite", this,
2918 TString::Format("SetSortMode(=%d)", kViewArrangeBySize));
2919 buttons[5]->Connect("Clicked()", "TRootBrowserLite", this,
2920 TString::Format("SetSortMode(=%d)", kViewArrangeByDate));
2921 }
2922 }
2924 }
2925}
2926
2927////////////////////////////////////////////////////////////////////////////////
2928/// Set iconbox's sort mode and update menu radio buttons accordingly.
2929
2931{
2933
2934 switch (new_mode) {
2935 default:
2937 // intentionally no break
2938 case kViewArrangeByName:
2940 break;
2941 case kViewArrangeByType:
2943 break;
2944 case kViewArrangeBySize:
2946 break;
2947 case kViewArrangeByDate:
2949 break;
2950 }
2951
2954
2956}
2957
2958////////////////////////////////////////////////////////////////////////////////
2959/// starts serach dialog
2960
2962{
2963 if (!fTextEdit) {
2965 } else {
2967 }
2968}
2969
2970////////////////////////////////////////////////////////////////////////////////
2971/// test
2972
2973static Bool_t isBinary(const char *str, int len)
2974{
2975 for (int i = 0; i < len; i++) {
2976 char c = str[i];
2977 if (((c < 32) || (c > 126)) && (c != '\t') && (c != '\r') && (c != '\n')) {
2978 return kTRUE;
2979 }
2980 }
2981 return kFALSE;
2982}
2983
2984////////////////////////////////////////////////////////////////////////////////
2985/// hide text edit
2986
2988{
2989 if (!fTextEdit) return;
2990
2996 savbtn->Disconnect();
2998 delete fTextEdit;
2999 fTextEdit = 0;
3001 fV2->MapSubwindows();
3002 fV2->Layout();
3004 fTextFileName = "";
3005}
3006
3007////////////////////////////////////////////////////////////////////////////////
3008/// browse text file
3009
3011{
3012 Bool_t loaded = (fTextEdit != 0);
3014 if (loaded) {
3016 }
3017 return;
3018 }
3019 const int bufferSize = 1024;
3020 char buffer[bufferSize];
3021
3022 FILE *fd = fopen(file, "rb");
3023 if (fd == 0) {
3024 if (loaded) {
3026 }
3027 return;
3028 }
3029 int sz = fread(buffer, 1, bufferSize, fd);
3030 fclose(fd);
3031
3032 if ((sz > 0) && isBinary(buffer, sz)) {
3033 if (loaded) {
3035 }
3036 return;
3037 }
3038
3039 if (!fTextEdit) {
3042 TColor *col = gROOT->GetColor(19);
3043 if (col)
3046 TGSearchDialog::SearchDialog()->Connect("TextEntered(char *)", "TGTextEdit",
3047 fTextEdit, "Search(char *,Bool_t,Bool_t)");
3048 }
3051 savbtn->Connect("Released()", "TGTextEdit", fTextEdit, "SaveFile(=0,kTRUE)");
3052 }
3053 fTextFileName = file;
3054 fTextEdit->LoadFile(file);
3055 if (loaded) return;
3056
3057 if (fTextFileName.EndsWith(".C")) {
3059 } else {
3061 }
3065 fV2->MapSubwindows();
3066 fV2->Layout();
3068
3069 if (fListLevel) {
3071 }
3073
3074 if (btn) {
3075 btn->SetState(kButtonDisabled);
3076 }
3077
3079
3080 if (btn2) {
3081 btn2->SetState(kButtonUp);
3082 }
3083}
3084
3085////////////////////////////////////////////////////////////////////////////////
3086/// executed browsed text macro
3087
3089{
3092
3093 gROOT->SetExecutingMacro(kTRUE);
3095 gROOT->Macro(tmpfile);
3097 delete [] tmpfile;
3098 gROOT->SetExecutingMacro(kFALSE);
3099}
3100
3101////////////////////////////////////////////////////////////////////////////////
3102/// interrupt browsed macro execution
3103
3105{
3106 gROOT->SetInterrupt(kTRUE);
3107}
3108
3109////////////////////////////////////////////////////////////////////////////////
3110/// show/hide macro buttons
3111
3113{
3117
3118 static Bool_t connected = kFALSE;
3119
3120 if (!show) {
3121 bt1->UnmapWindow();
3122 bt2->UnmapWindow();
3123 bt3->UnmapWindow();
3124 } else {
3125 bt1->MapWindow();
3126 bt2->MapWindow();
3127 bt3->MapWindow();
3128
3129 if (!connected && fTextEdit) {
3130 bt1->Connect("Pressed()", "TRootBrowserLite", this, "ExecMacro()");
3131 bt2->Connect("Pressed()", "TRootBrowserLite", this, "InterruptMacro()");
3132 connected = kTRUE;
3133 }
3134 }
3135}
3136
3137////////////////////////////////////////////////////////////////////////////////
3138/// Set text in column col in status bar.
3139
3141{
3143 TGStatusBar* status = GetStatusBar();
3144 if (status!=0) {
3145 status->SetText(txt, col);
3146 }
3147}
3148
3149////////////////////////////////////////////////////////////////////////////////
3150/// Interface method to the old browser.
3151
3154 Option_t * /*opt*/)
3155{
3157 return (TBrowserImp *)browser;
3158}
3159
3160////////////////////////////////////////////////////////////////////////////////
3161/// Interface method to the old browser.
3162
3165 Option_t * /*opt*/)
3166{
3168 return (TBrowserImp *)browser;
3169}
Handle_t Atom_t
WM token.
Definition GuiTypes.h:37
@ kGKeyPress
Definition GuiTypes.h:60
@ kWatch
Definition GuiTypes.h:375
@ kPointer
Definition GuiTypes.h:375
const Mask_t kKeyMod1Mask
typically the Alt key
Definition GuiTypes.h:198
@ kSunkenFrame
Definition GuiTypes.h:383
@ kDoubleBorder
Definition GuiTypes.h:385
@ kFixedWidth
Definition GuiTypes.h:387
@ kHorizontalFrame
Definition GuiTypes.h:382
EMouseButton
Button names.
Definition GuiTypes.h:214
@ kButton3
Definition GuiTypes.h:214
@ kButton1
Definition GuiTypes.h:214
R__EXTERN const char gHelpObjects[]
Definition HelpText.h:26
R__EXTERN const char gHelpPullDownMenus[]
Definition HelpText.h:24
R__EXTERN const char gHelpRemote[]
Definition HelpText.h:28
R__EXTERN const char gHelpAbout[]
Definition HelpText.h:17
R__EXTERN const char gHelpGraphicsEditor[]
Definition HelpText.h:23
R__EXTERN const char gHelpCanvas[]
Definition HelpText.h:25
R__EXTERN const char gHelpBrowserLite[]
Definition HelpText.h:19
R__EXTERN const char gHelpPostscript[]
Definition HelpText.h:21
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
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:77
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
Definition RtypesCore.h:89
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
Definition RtypesCore.h:69
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
Definition RtypesCore.h:131
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
R__EXTERN TApplication * gApplication
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define gDirectory
Definition TDirectory.h:385
R__EXTERN TEnv * gEnv
Definition TEnv.h:170
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
Definition TError.cxx:241
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:208
#define gFile
Definition TFile.h:430
@ kButtonDisabled
Definition TGButton.h:56
@ kButtonUp
Definition TGButton.h:53
@ kButtonEngaged
Definition TGButton.h:55
#define gClient
Definition TGClient.h:157
R__EXTERN TGDNDManager * gDNDManager
EFSSortMode
@ kSortByDate
@ kSortByName
@ kSortByType
@ kSortBySize
@ kFDOpen
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsCenterY
Definition TGLayout.h:28
@ kLHintsBottom
Definition TGLayout.h:29
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
EListViewMode
Definition TGListView.h:21
@ kLVDetails
Definition TGListView.h:25
@ kLVSmallIcons
Definition TGListView.h:23
@ kLVList
Definition TGListView.h:24
@ kLVLargeIcons
Definition TGListView.h:22
@ kTextLeft
Definition TGWidget.h:23
static unsigned int total
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void SetIconPixmap
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void SetWMPosition
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize MapSubwindows
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t SetWMSizeHints
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
char name[80]
Definition TGX11.cxx:110
void Sort()
#define gInterpreter
#define gROOT
Definition TROOT.h:411
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,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2495
@ kReadPermission
Definition TSystem.h:55
R__EXTERN TSystem * gSystem
Definition TSystem.h:572
#define gPad
#define gVirtualX
Definition TVirtualX.h:337
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:1579
virtual Longptr_t ProcessLine(const char *line, Bool_t sync=kFALSE, Int_t *error=nullptr)
Process a single command line, either a C++ statement or an interpreter command starting with a "....
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
virtual const char * ApplicationName() const
ABC describing GUI independent browser implementation protocol.
Definition TBrowserImp.h:29
TBrowser * fBrowser
TBrowser associated with this implementation.
Definition TBrowserImp.h:32
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
void SetDrawOption(Option_t *option="") override
Set drawing option for object.
Definition TBrowser.h:106
void SetRefreshFlag(Bool_t flag)
Definition TBrowser.h:100
TContextMenu * GetContextMenu() const
Definition TBrowser.h:97
@ kNoHidden
Definition TBrowser.h:55
Bool_t GetRefreshFlag() const
Definition TBrowser.h:98
void SetBrowserImp(TBrowserImp *i)
Definition TBrowser.h:96
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
Definition TBufferFile.h:47
void WriteObject(const TObject *obj, Bool_t cacheReuse=kTRUE) override
Write object to I/O buffer.
@ kWrite
Definition TBuffer.h:73
Int_t Length() const
Definition TBuffer.h:100
char * Buffer() const
Definition TBuffer.h:96
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
static TClass * Class()
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Definition TClass.cxx:5980
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:2973
const char * GetName() const override
Return name of this collection.
TString fName
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
The color creation and management class.
Definition TColor.h:22
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition TColor.cxx:1926
ULong_t GetPixel() const
Return pixel value corresponding to this color.
Definition TColor.cxx:1564
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.
Drag and drop data container.
Atom_t fDataType
Data type description.
Int_t fDataLength
Length of data.
void * fData
Actual data.
static TClass * Class()
Describe directory structure in memory.
Definition TDirectory.h:45
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition TEnv.cxx:490
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
Set the value of a resource or create a new resource.
Definition TEnv.cxx:735
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:131
static TClass * Class()
static TClass * Class()
A button abstract base class.
Definition TGButton.h:68
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition TGCanvas.h:192
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition TGClient.cxx:233
TGMimeTypes * GetMimeTypeList() const
Definition TGClient.h:147
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:380
TGPicturePool * GetPicturePool() const
Definition TGClient.h:126
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
Definition TGComboBox.h:47
virtual TGLBEntry * GetSelectedEntry() const
Definition TGComboBox.h:115
virtual TGTextEntry * GetTextEntry() const
Definition TGComboBox.h:111
virtual void AddEntry(TGString *s, Int_t id)
Definition TGComboBox.h:86
virtual TGListBox * GetListBox() const
Definition TGComboBox.h:110
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...
virtual Int_t GetNumberOfEntries() const
Definition TGComboBox.h:107
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
UInt_t GetDefaultWidth() const override
Definition TGFrame.h:314
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1156
UInt_t GetDefaultHeight() const override
Definition TGFrame.h:316
TGCompositeFrame(const TGCompositeFrame &)=delete
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1249
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition TGFrame.cxx:1196
TList * fList
container of frame elements
Definition TGFrame.h:294
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition TGFrame.cxx:1141
void SetEditDisabled(UInt_t on=1) override
Set edit disable flag for this frame and subframes.
Definition TGFrame.cxx:1014
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1182
virtual void Associate(const TGWindow *w)
Definition TGCanvas.h:89
virtual void ClearViewPort()
Clear view port and redraw full content.
Definition TGCanvas.cxx:888
const TGWindow * fMsgWindow
window handling container messages
Definition TGCanvas.h:42
virtual TGFrameElement * FindFrame(Int_t x, Int_t y, Bool_t exclude=kTRUE)
Find frame located int container at position x,y.
virtual void AdjustPosition()
Move content to position of highlighted/activated frame.
virtual const TGFrame * GetNextSelected(void **current)
Return the next selected item.
Definition TGCanvas.cxx:678
virtual void Search(Bool_t close=kTRUE)
Invokes search dialog. Looks for item with the entered name.
Bool_t fLastDir
direction of last search
Definition TGCanvas.h:52
virtual Int_t NumSelected() const
Definition TGCanvas.h:104
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
Int_t fSelected
number of selected items
Definition TGCanvas.h:49
virtual void SetHsbPosition(Int_t newPos)
set new hor. position
TString fLastName
the name of object of last search
Definition TGCanvas.h:55
virtual Int_t NumItems() const
Definition TGCanvas.h:105
virtual void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t subString=kFALSE)
Bool_t fLastCase
case sensitivity of last search
Definition TGCanvas.h:53
Int_t fTotal
total items
Definition TGCanvas.h:48
void RemoveAll() override
Remove all items from the container.
Definition TGCanvas.cxx:638
virtual TGPosition GetPagePosition() const
Returns page position.
Definition TGCanvas.cxx:734
TGFrameElement * fLastActiveEl
last active item
Definition TGCanvas.h:43
Bool_t IsDragging() const
Bool_t EndDrag()
End dragging.
This is a combo box that is used in the File Selection dialog box.
virtual void Update(const char *path)
Update file system combo box.
const TGPicture * fFolder_s
big folder icon
TViewUpdateTimer * fRefresh
refresh timer
void StopRefreshTimer()
stop refresh timer
const TGPicture * fDoc_t
small document icon
virtual void Sort(EFSSortMode sortType)
Sort file system list view container according to sortType.
const TGPicture * fDoc_s
big document icon
virtual TGFileItem * AddFile(const char *name, const TGPicture *pic=nullptr, const TGPicture *lpic=nullptr)
Add file in container.
virtual TGFileItem * AddRemoteFile(TObject *obj, const TGPicture *ipic=nullptr, const TGPicture *ilpic=nullptr)
Add remote file in container.
const TGPicture * fFolder_t
small folder icon
EFSSortMode fSortType
sorting mode of contents
This class creates a file selection dialog.
TBufferFile * fBuf
buffer used for Drag and Drop
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move and/or resize the frame.
Definition TGFrame.cxx:621
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:597
void MapWindow() override
map window
Definition TGFrame.h:206
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:675
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:268
void SetDNDSource(Bool_t onoff)
Definition TGFrame.h:270
void UnmapWindow() override
unmap window
Definition TGFrame.h:208
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
Definition TGFrame.cxx:637
UInt_t GetHeight() const
Definition TGFrame.h:227
static Pixel_t fgWhitePixel
Definition TGFrame.h:103
UInt_t GetWidth() const
Definition TGFrame.h:226
A horizontal 3D line is a line that typically separates a toolbar from the menubar.
Definition TG3DLine.h:18
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:387
A Composite frame that contains a list of TGLBEnties.
Definition TGListBox.h:163
TGListView * fListView
listview which contains this container
Definition TGListView.h:190
virtual void AddItem(TGLVEntry *item)
Definition TGListView.h:207
void ActivateItem(TGFrameElement *el) override
Select/activate item.
EListViewMode GetViewMode() const
Definition TGListView.h:214
TGString ** fSubnames
sub names of item (details)
Definition TGListView.h:44
FontStruct_t fFontStruct
text font
Definition TGListView.h:59
Int_t * fCtw
width of sub names
Definition TGListView.h:47
void SetUserData(void *userData)
Definition TGListView.h:94
This class handles GUI labels.
Definition TGLabel.h:24
virtual void SetText(TGString *newText)
Set new text in label.
Definition TGLabel.cxx:179
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
A listbox is a box, possibly with scrollbar, containing entries.
Definition TGListBox.h:221
TGListTreeItem * GetFirstChild() const
Definition TGListTree.h:61
void Rename(const char *new_name)
Definition TGListTree.h:73
virtual Bool_t IsActive() const =0
virtual const char * GetText() const =0
TGListTreeItem * GetParent() const
Definition TGListTree.h:60
virtual void SetTipText(const char *)
Definition TGListTree.h:79
virtual Bool_t IsOpen() const
Definition TGListTree.h:66
virtual void * GetUserData() const =0
virtual void SetUserData(void *, Bool_t=kFALSE)
Definition TGListTree.h:81
A list tree is a widget that can contain a number of items arranged in a tree structure.
Definition TGListTree.h:197
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:353
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:384
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:383
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.
A list view is a widget that can contain a number of items arranged in a grid or list.
Definition TGListView.h:115
virtual void AdjustHeaders()
Definition TGListView.h:154
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...
void Layout() override
Layout list view components (container and contents of container).
virtual void SetIncrements(Int_t hInc, Int_t vInc)
Set horizontal and vertical scrollbar increments.
EListViewMode GetViewMode() const
Definition TGListView.h:161
TGTextButton ** GetHeaderButtons()
Definition TGListView.h:159
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.
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:399
Atom_t * fDNDTypeList
handles DND types
Definition TGFrame.h:415
virtual void SendCloseMessage()
Send close message to self.
Definition TGFrame.cxx:1736
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
Definition TGFrame.cxx:1850
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition TGFrame.cxx:1793
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1780
Bool_t HandleKey(Event_t *event) override
Handle keyboard events.
Definition TGFrame.cxx:1598
The TGMenu.h header contains all different menu classes.
Definition TGMenu.h:282
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=nullptr)
Add popup menu to menu bar.
Definition TGMenu.cxx:414
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
Connection to display server.
Definition TGObject.h:25
Handle_t GetId() const
Definition TGObject.h:41
Handle_t fId
X11/Win32 Window identifier.
Definition TGObject.h:24
const TGPicture * GetPicture(const char *name)
Get a picture from the picture pool.
Definition TGPicture.cxx:80
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
This class creates a popup menu object.
Definition TGMenu.h:110
virtual Bool_t IsEntryChecked(Int_t id)
Return true if menu item is checked.
Definition TGMenu.cxx:1841
virtual void AddPopup(TGHotString *s, TGPopupMenu *popup, TGMenuEntry *before=nullptr, const TGPicture *p=nullptr)
Add a (cascading) popup menu to a popup menu.
Definition TGMenu.cxx:1148
virtual void CheckEntry(Int_t id)
Check a menu entry (i.e. add a check mark in front of it).
Definition TGMenu.cxx:1778
virtual void DisableEntry(Int_t id)
Disable entry (disabled entries appear in a sunken relieve).
Definition TGMenu.cxx:1720
virtual void UnCheckEntry(Int_t id)
Uncheck menu entry (i.e. remove check mark).
Definition TGMenu.cxx:1803
virtual void Associate(const TGWindow *w)
Definition TGMenu.h:206
virtual void AddSeparator(TGMenuEntry *before=nullptr)
Add a menu separator to the menu.
Definition TGMenu.cxx:1056
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:1856
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=nullptr, const TGPicture *p=nullptr, TGMenuEntry *before=nullptr)
Add a menu entry.
Definition TGMenu.cxx:986
Int_t fY
y position
Definition TGDimension.h:39
Int_t fX
x position
Definition TGDimension.h:38
static TGSearchDialog *& SearchDialog()
Return global search dialog.
Provides a StatusBar widget.
Definition TGStatusBar.h:21
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.
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition TGString.h:20
Int_t GetLength() const
Definition TGString.h:29
virtual void SetString(const char *s)
Definition TGString.h:31
const char * GetString() const
Definition TGString.h:30
Yield an action as soon as it is clicked.
Definition TGButton.h:142
A TGTextEdit is a specialization of TGTextView.
Definition TGTextEdit.h:22
virtual Bool_t SaveFile(const char *fname, Bool_t saveas=kFALSE)
Save file.
Bool_t Search(const char *string, Bool_t direction=kTRUE, Bool_t caseSensitive=kFALSE) override
Search for string in the specified direction.
A TGTextEntry is a one line text input widget.
Definition TGTextEntry.h:24
Text string listbox entries.
Definition TGListBox.h:48
virtual Bool_t LoadFile(const char *fname, long startpos=0, long length=-1)
Load a file in the text view widget.
virtual void SetReadOnly(Bool_t on=kTRUE)
Definition TGTextView.h:117
A toolbar is a composite frame that contains TGPictureButtons.
Definition TGToolBar.h:33
virtual TGButton * AddButton(const TGWindow *w, ToolBarData_t *button, Int_t spacing=0)
Add button to toolbar.
Definition TGToolBar.cxx:91
virtual TGButton * GetButton(Int_t id) const
Finds and returns a pointer to the button with the specified identifier id.
void Cleanup() override
Cleanup and delete all objects contained in this composite frame.
A composite frame that layout their children in vertical way.
Definition TGFrame.h:376
void SetBackgroundColor(Pixel_t) override
Set background color of the canvas frame.
Definition TGView.cxx:588
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:72
ROOT GUI Window base class.
Definition TGWindow.h:23
@ kEditDisable
disable edit of this window
Definition TGWindow.h:57
virtual void DestroyWindow()
destroy window
Definition TGWindow.cxx:190
const TGWindow * GetParent() const
Definition TGWindow.h:83
static TGuiBuilder * Instance()
return an instance of TGuiBuilder object
THashTable implements a hash table to store TObject's.
Definition THashTable.h:35
void Add(TObject *obj) override
Add object to the hash table.
TObject * FindObject(const char *name) const override
Find object using its name.
void Delete(Option_t *option="") override
Remove all objects from the table AND delete all heap based objects.
const TGPicture * fSmall
TIconBoxThumb(const char *name, const TGPicture *spic, const TGPicture *pic)
const TGPicture * fLarge
const char * GetName() const override
Returns name of object.
ULong_t Hash() const override
Return hash value for this object.
An abstract interface to image processing library.
Definition TImage.h:29
@ kXpm
Definition TImage.h:37
static TImage * Create()
Create an image.
Definition TImage.cxx:34
Utility class for browsing TMapFile objects.
Definition TKeyMapFile.h:20
static TClass * Class()
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Definition TKey.h:28
virtual const char * GetClassName() const
Definition TKey.h:75
TClass * IsA() const override
Definition TKey.h:116
static TClass * Class()
Short_t GetCycle() const
Return cycle number associated to this key.
Definition TKey.cxx:579
A doubly linked list.
Definition TList.h:38
TObject * After(const TObject *obj) const override
Returns the object after object obj.
Definition TList.cxx:327
static TClass * Class()
TObject * Before(const TObject *obj) const override
Returns the object before object obj.
Definition TList.cxx:368
void Add(TObject *obj) override
Definition TList.h:81
TObject * Remove(TObject *obj) override
Remove object from the list.
Definition TList.cxx:819
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
Definition TList.cxx:690
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:656
virtual TObjLink * FirstLink() const
Definition TList.h:102
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
Definition TList.cxx:467
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
Collectable string class.
Definition TObjString.h:28
Mother of all ROOT objects.
Definition TObject.h:41
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition TObject.cxx:573
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:457
virtual void Browse(TBrowser *b)
Browse object. May be overridden for another default action.
Definition TObject.cxx:217
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:202
virtual const char * GetIconName() const
Returns mime type name of object.
Definition TObject.cxx:467
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:226
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Returns string containing info about the object at position (px,py).
Definition TObject.cxx:486
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:864
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:543
virtual const char * GetTitle() const
Returns title of object.
Definition TObject.cxx:501
virtual TClass * IsA() const
Definition TObject.h:246
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:865
The TRemoteObject class provides protocol for browsing ROOT objects from a remote ROOT session.
TRootBrowserCursorSwitcher(TGWindow *w1, TGWindow *w2)
void Print(Option_t *) const override
This method must be overridden when a class wants to print itself.
TRootBrowserHistoryCursor(TGListTreeItem *item)
void DeleteItem(TGListTreeItem *item)
void RecursiveRemove(TObject *obj) override
Remove object from this collection and recursively remove the object from all other objects (and coll...
This class creates a ROOT object browser (looking like Windows Explorer).
TGCompositeFrame * fTreeHdr
TGPopupMenu * fOptionMenu
friend class TRootIconBox
Bool_t HistoryBackward()
go to the past
void SetStatusText(const char *txt, Int_t col) override
Set text in column col in status bar.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Handle menu and other command generated by the user.
void SetViewMode(Int_t new_mode, Bool_t force=kFALSE)
Set iconbox's view mode and update menu and toolbar buttons accordingly.
void Refresh(Bool_t force=kFALSE) override
Refresh the browser contents.
TGLayoutHints * fMenuBarHelpLayout
void ListTreeHighlight(TGListTreeItem *item)
Open tree item and list in iconbox its contents.
TGFileContainer * GetIconBox() const
returns pointer to fIconBox object
void SetSortMode(Int_t new_mode)
Set iconbox's sort mode and update menu radio buttons accordingly.
void ClearHistory()
clear navigation history
~TRootBrowserLite() override
Browser destructor.
TGListTreeItem * fListLevel
current TGListTree level
TGLayoutHints * fExpandLayout
void RecursiveRemove(TObject *obj) override
Recursively remove object from browser.
TGPopupMenu * fFileMenu
TGPopupMenu * fSortMenu
void BrowseTextFile(const char *file)
browse text file
Option_t * GetDrawOption() const override
returns drawing option
void ReallyDelete() override
Really delete the browser and the this GUI.
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 ExecMacro()
executed browsed text macro
TGComboBox * fDrawOption
drawing option entry
virtual void ShowToolBar(Bool_t show=kTRUE)
Show or hide toolbar.
void HighlightListLevel()
helper method to track history
Bool_t HistoryForward()
go to the future
static TBrowserImp * NewBrowser(TBrowser *b=nullptr, const char *title="ROOT Browser", UInt_t width=800, UInt_t height=500, Option_t *opt="")
Interface method to the old browser.
TGLayoutHints * fMenuBarLayout
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
icon picture
void AddToHistory(TGListTreeItem *item)
helper method to track history
TGLayoutHints * fBarLayout
TGHorizontalFrame * fHf
void BrowseObj(TObject *obj) override
Browse object.
Bool_t fTreeLock
true when we want to lock TGListTree
void Show() override
virtual void Checked(TObject *obj, Bool_t check)
Emits signal when double clicking on icon.
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 CloseWindow() override
In case window is closed via WM we get here.
Int_t fSortMode
current IconBox sort mode
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.
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.
TRootBrowserLite(const TRootBrowserLite &)=delete
void Search()
starts serach dialog
TGPopupMenu * fHelpMenu
TList * fHistory
history of browsing
TGListView * fListView
void CheckObjectItem(TObject *obj, Bool_t check=kFALSE) override
Check / uncheck the TGListTreeItem corresponding to this object and add a checkmark on TGLVEntry if c...
Bool_t HandleKey(Event_t *event) override
handle keys
TObject * fHistoryCursor
current history position
Int_t fViewMode
current IconBox view mode
virtual void SetDefaults(const char *iconStyle=nullptr, const char *sortBy=nullptr)
Set defaults depending on settings in the user's .rootrc.
TGFSComboBox * fFSComboBox
void InterruptMacro()
interrupt browsed macro execution
void SetDrawOption(Option_t *option="") override
sets drawing option
TGCompositeFrame * fListHdr
void UpdateDrawOption()
add new draw option to the "history"
TGTextEdit * fTextEdit
contents of browsed text file
TGStatusBar * fStatusBar
void CreateBrowser(const char *name)
Create the actual browser.
void ToSystemDirectory(const char *dirname)
display directory
TGPopupMenu * fViewMenu
void ExecuteDefaultAction(TObject *obj) override
Execute default action for selected object (action is specified in the $HOME/.root....
void AddCheckBox(TObject *obj, Bool_t check=kFALSE) override
Add a checkbox in the TGListTreeItem corresponding to obj and a checkmark on TGLVEntry if check = kTR...
void Add(TObject *obj, const char *name=nullptr, Int_t check=-1) override
Add items to the browser.
void DeleteListTreeItem(TGListTreeItem *item)
delete list tree item, remove it from history
TGHorizontal3DLine * fToolBarSep
void RemoveCheckBox(TObject *obj) override
Remove checkbox from TGListTree and checkmark from TGListView.
A TRootHelpDialog is used to display help text (or any text in a dialog window).
THashTable * fThumbnails
friend class TRootIconList
~TRootIconBox() override
destructor
TGFrameElement * FindFrame(Int_t x, Int_t y, Bool_t exclude=kTRUE) override
Find frame located int container at position x,y.
const TGPicture * fSmallCachedPic
TObject * fActiveObject
TGString * fCurrentName
void RemoveGarbage()
delete all TRootIconLists from garbage
void SetGroupSize(Int_t siz)
Bool_t WasGrouped() const
const TGPicture * fLargeCachedPic
void AddObjItem(const char *name, TObject *obj, TClass *cl)
Add object to iconbox.
TRootIconBox(TRootBrowserLite *browser, TGListView *lv, UInt_t options=kSunkenFrame, ULong_t back=GetDefaultFrameBackground())
Create iconbox containing ROOT objects in browser.
Int_t GetGroupSize() const
TRootObjItem * fCurrentItem
void Refresh()
Sort icons, and send message to browser with number of objects in box.
void GetObjPictures(const TGPicture **pic, const TGPicture **spic, TObject *obj, const char *name)
Retrieve icons associated with class "name".
void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t beginWith=kFALSE) override
Find a frame which assosiated object has a name containing a "name" string.
TRootIconList * fCurrentList
TRootBrowserLite * fBrowser
void SetObjHeaders()
Set list box headers used to display detailed object iformation.
void RemoveAll() override
Remove all items from icon box.
TRootIconBox * fIconBox
void UpdateName()
composite name
void Browse(TBrowser *b) override
browse icon list
const TGPicture * fPic
TRootIconList(TRootIconBox *box=nullptr)
constructor
const char * GetTitle() const override
Returns title of object.
Bool_t IsFolder() const override
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
const TGPicture * GetPicture() const
~TRootIconList() override
destructor
TRootObjItem(const TGWindow *p, const TGPicture *bpic, const TGPicture *spic, TGString *name, TObject *obj, TClass *cl, EListViewMode viewMode=kLVSmallIcons)
Create an icon box item.
TDNDData * GetDNDData(Atom_t) override
Bool_t HandleDNDFinished() override
Basic string class.
Definition TString.h:138
Ssiz_t Length() const
Definition TString.h:425
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition TString.cxx:2250
const char * Data() const
Definition TString.h:384
ECaseCompare
Definition TString.h:285
@ kIgnoreCase
Definition TString.h:285
@ kExact
Definition TString.h:285
TString & Prepend(const char *cs)
Definition TString.h:681
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
Definition TString.cxx:684
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:2384
Describes an Operating System directory for the browser.
static TClass * Class()
A TSystemFile describes an operating system file.
Definition TSystemFile.h:29
static TClass * Class()
const char * pwd()
Definition TSystem.h:434
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name.
Definition TSystem.cxx:1082
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition TSystem.cxx:651
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition TSystem.cxx:1307
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition TSystem.cxx:1073
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
Definition TSystem.cxx:961
virtual const char * WorkingDirectory()
Return working directory.
Definition TSystem.cxx:881
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
Definition TSystem.cxx:1042
virtual int Unlink(const char *name)
Unlink, i.e.
Definition TSystem.cxx:1392
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
Definition TSystem.cxx:1493
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
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
const char * fPicnamePrefix
const TGPicture * fIcon[2]
Event structure.
Definition GuiTypes.h:174
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:175
UInt_t fState
key or button mask
Definition GuiTypes.h:181
TLine lv
Definition textalign.C:5