Logo ROOT  
Reference Guide
No Matches
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 27/02/98
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 *************************************************************************/
13#ifndef ROOT_TRootBrowserLite
14#define ROOT_TRootBrowserLite
17// //
18// TRootBrowserLite //
19// //
20// This class creates a ROOT object browser (looking like Windows //
21// Explorer). The widgets used are the new native ROOT GUI widgets. //
22// //
25#include "TBrowserImp.h"
26#include "TGFrame.h"
28class TGMenuBar;
29class TGPopupMenu;
30class TGLayoutHints;
31class TGStatusBar;
33class TGToolBar;
34class TGButton;
35class TGFSComboBox;
36class TGLabel;
37class TGListView;
38class TRootIconBox;
39class TGCanvas;
40class TGListTree;
41class TGListTreeItem;
42class TGFileItem;
43class TList;
44class TGFileContainer;
45class TGComboBox;
46class TGTextEdit;
50friend class TRootIconBox;
69 TGComboBox *fDrawOption; // drawing option entry
75 TList *fHistory; // history of browsing
76 TObject *fHistoryCursor; // current hsitory position
77 const TGPicture *fIconPic; // icon picture
79 void CreateBrowser(const char *name);
82 void HighlightListLevel();
83 void AddToHistory(TGListTreeItem *item);
84 void IconBoxAction(TObject *obj);
85 void Chdir(TGListTreeItem *item);
86 void DisplayDirectory();
87 void DisplayTotal(Int_t total, Int_t selected);
88 void SetViewMode(Int_t new_mode, Bool_t force = kFALSE);
89 void ToSystemDirectory(const char *dirname);
90 void UpdateDrawOption();
91 void Search();
92 void BrowseTextFile(const char *file);
93 void HideTextEdit();
94 void ShowMacroButtons(Bool_t show = kTRUE);
98 void ClearHistory();
113 TGButton *fToolBarButton[7]; // same size as gToolBarData[]
116 TGListTreeItem *fListLevel; // current TGListTree level
117 Bool_t fTreeLock; // true when we want to lock TGListTree
118 Int_t fViewMode; // current IconBox view mode
119 Int_t fSortMode; // current IconBox sort mode
120 TGTextEdit *fTextEdit; // contents of browsed text file
123 TRootBrowserLite(TBrowser *b = nullptr, const char *title = "ROOT Browser", UInt_t width = 800, UInt_t height = 500);
124 TRootBrowserLite(TBrowser *b, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height);
125 virtual ~TRootBrowserLite();
127 void Add(TObject *obj, const char *name = nullptr, Int_t check = -1) override;
128 virtual void AddToBox(TObject *obj, const char *name);
129 virtual void AddToTree(TObject *obj, const char *name, Int_t check = -1);
131 void AddCheckBox(TObject *obj, Bool_t check = kFALSE) override;
132 void CheckObjectItem(TObject *obj, Bool_t check = kFALSE) override;
133 void RemoveCheckBox(TObject *obj) override;
135 void BrowseObj(TObject *obj) override; //*SIGNAL*
136 void ExecuteDefaultAction(TObject *obj) override; //*SIGNAL*
137 virtual void DoubleClicked(TObject *obj); //*SIGNAL*
138 virtual void Checked(TObject *obj, Bool_t check); //*SIGNAL*
139 void CloseTabs() override { }
140 void Iconify() override { }
141 void RecursiveRemove(TObject *obj) override;
142 void Refresh(Bool_t force = kFALSE) override;
143 virtual void ResizeBrowser() { }
144 virtual void ShowToolBar(Bool_t show = kTRUE);
145 virtual void ShowStatusBar(Bool_t show = kTRUE);
146 void Show() override { MapRaised(); }
147 virtual void SetDefaults(const char *iconStyle = nullptr, const char *sortBy = nullptr);
148 Bool_t HandleKey(Event_t *event) override;
149 void SetStatusText(const char *txt, Int_t col) override;
151 TGListTree *GetListTree() const { return fLt; }
154 TGMenuBar *GetMenuBar() const { return fMenuBar; }
155 TGToolBar *GetToolBar() const { return fToolBar; }
156 void SetDrawOption(Option_t *option = "") override;
157 Option_t *GetDrawOption() const override;
158 void SetSortMode(Int_t new_mode);
159 TGMainFrame *GetMainFrame() const override { return (TGMainFrame *)this; }
161 // overridden from TGMainFrame
162 void CloseWindow() override;
163 Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) override;
164 void ReallyDelete() override;
166 // auxilary (a la private) methods
167 void ExecMacro();
168 void InterruptMacro();
170 static TBrowserImp *NewBrowser(TBrowser *b = nullptr, const char *title = "ROOT Browser", UInt_t width = 800, UInt_t height = 500, Option_t *opt="");
171 static TBrowserImp *NewBrowser(TBrowser *b, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height, Option_t *opt="");
173 ClassDefOverride(TRootBrowserLite,0) //ROOT native GUI version of browser
#define b(i)
Definition RSha256.hxx:100
int Int_t
Definition RtypesCore.h:45
unsigned int UInt_t
Definition RtypesCore.h:46
const Bool_t kFALSE
Definition RtypesCore.h:92
long Long_t
Definition RtypesCore.h:54
bool Bool_t
Definition RtypesCore.h:63
const Bool_t kTRUE
Definition RtypesCore.h:91
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:329
include TDocParser_001 C image html pict1_TDocParser_001 png width
static unsigned int total
char name[80]
Definition TGX11.cxx:110
ABC describing GUI independent browser implementation protocol.
Definition TBrowserImp.h:29
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
virtual void MapRaised()
map raised
Definition TGFrame.h:229
A doubly linked list.
Definition TList.h:44
Mother of all ROOT objects.
Definition TObject.h:37
TGMenuBar * GetMenuBar() const
TRootBrowserLite & operator=(const TRootBrowserLite &)=delete
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.
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.
virtual void ResizeBrowser()
TGFileContainer * GetIconBox() const
returns pointer to fIconBox object
TGMainFrame * GetMainFrame() const override
Returns top level main frame.
void SetSortMode(Int_t new_mode)
Set iconbox's sort mode and update menu radio buttons accordingly.
TGButton * fToolBarButton[7]
void ClearHistory()
clear navigation history
TGListTreeItem * fListLevel
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
virtual void ShowToolBar(Bool_t show=kTRUE)
Show or hide toolbar.
void HighlightListLevel()
helper method to track history
void CloseTabs() override
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
void AddToHistory(TGListTreeItem *item)
helper method to track history
TGLayoutHints * fBarLayout
TGListTree * GetListTree() const
TGHorizontalFrame * fHf
void BrowseObj(TObject *obj) override
Browse object.
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.
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.
TGToolBar * GetToolBar() const
TRootBrowserLite(const TRootBrowserLite &)=delete
void Search()
starts serach dialog
TGPopupMenu * fHelpMenu
TGListView * fListView
Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) override
Handle menu and other command generated by the user.
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
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
virtual ~TRootBrowserLite()
Browser destructor.
TGCompositeFrame * fListHdr
void UpdateDrawOption()
add new draw option to the "history"
TGTextEdit * fTextEdit
void Iconify() override
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.
Basic string class.
Definition TString.h:136
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Definition file.py:1
Event structure.
Definition GuiTypes.h:174