library: libGui #include "TRootBrowser.h"

# TRootBrowser

class description - source file - inheritance tree (.pdf)

## class TRootBrowser : public TGMainFrame, public TBrowserImp

| Inheritance Chart:
`TObject`
| <- | `TGObject`
| <- | `TGWindow`
`TQObject`
| <- | `TGFrame`
| <- | `TGCompositeFrame`
| <- | `TGMainFrame`
`TBrowserImp`
| <- | `TRootBrowser` |

        private:

            void AddToHistory(TGListTreeItem* item)
            void Chdir(TGListTreeItem* item)
            void ClearHistory()
            void CreateBrowser(const char* name)
            void DeleteListTreeItem(TGListTreeItem* item)
            void DisplayDirectory()
            void DisplayTotal(Int_t total, Int_t selected)
            void HighlightListLevel()
          Bool_t HistoryBackward()
          Bool_t HistoryForward()
            void IconBoxAction(TObject* obj)
            void ListTreeHighlight(TGListTreeItem* item)
            void SetSortMode(Int_t new_mode)
            void SetViewMode(Int_t new_mode, Bool_t force = kFALSE)
            void ToUpSystemDirectory()
            void UpdateDrawOption()

        public:

                            TRootBrowser(TBrowser* b = 0, const char* title = "ROOT Browser", UInt_t width = 500, UInt_t height = 300)
                            TRootBrowser(TBrowser* b, const char* title, Int_t x, Int_t y, UInt_t width, UInt_t height)
                            TRootBrowser(const TRootBrowser&)
                    virtual ~TRootBrowser()
               virtual void Add(TObject* obj, const char* name = "0")
               virtual void AddToBox(TObject* obj, const char* name)
               virtual void AddToTree(TObject* obj, const char* name)
               virtual void BrowseObj(TObject* obj)
             static TClass* Class()
               virtual void CloseWindow()
               virtual void DoubleClicked(TObject* obj)
               virtual void ExecuteDefaultAction(TObject* obj)
          virtual Option_t* GetDrawOption() const
           TGFileContainer* GetIconBox() const
                TGListTree* GetListTree() const
                 TGMenuBar* GetMenuBar() const
               TGStatusBar* GetStatusBar() const
                 TGToolBar* GetToolBar() const
             virtual Bool_t HandleKey(Event_t* event)
               virtual void Iconify()
            virtual TClass* IsA() const
             virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
               virtual void ReallyDelete()
               virtual void RecursiveRemove(TObject* obj)
               virtual void Refresh(Bool_t force = kFALSE)
               virtual void ResizeBrowser()
               virtual void SetDefaults(const char* iconStyle = "0", const char* sortBy = "0")
               virtual void SetDrawOption(Option_t* option = "")
               virtual void Show()
               virtual void ShowMembers(TMemberInspector& insp, char* parent)
               virtual void ShowStatusBar(Bool_t show = kTRUE)
               virtual void ShowToolBar(Bool_t show = kTRUE)
               virtual void Streamer(TBuffer& b)
                       void StreamerNVirtual(TBuffer& b)

### Data Members

        private:

                   TGMenuBar* fMenuBar
                   TGToolBar* fToolBar
          TGHorizontal3DLine* fToolBarSep
             TGVerticalFrame* fV1
             TGVerticalFrame* fV2
                     TGLabel* fLbl1
                     TGLabel* fLbl2
           TGHorizontalFrame* fHf
            TGCompositeFrame* fTreeHdr
            TGCompositeFrame* fListHdr
               TGLayoutHints* fMenuBarLayout
               TGLayoutHints* fMenuBarItemLayout
               TGLayoutHints* fMenuBarHelpLayout
               TGLayoutHints* fComboLayout
               TGLayoutHints* fBarLayout
                  TGComboBox* fDrawOption         drawing option entry
                       TList* fWidgets
                       TList* fHistory            history of browsing
                     TObject* fHistoryCursor      current hsitory position

        protected:

             TGPopupMenu* fFileMenu
             TGPopupMenu* fViewMenu
             TGPopupMenu* fOptionMenu
             TGPopupMenu* fHelpMenu
             TGPopupMenu* fSortMenu
              TGListView* fListView
            TRootIconBox* fIconBox
                TGCanvas* fTreeView
              TGListTree* fLt
                TGButton* fToolBarButton[7]  same size as gToolBarData[]
            TGFSComboBox* fFSComboBox
             TGStatusBar* fStatusBar
          TGListTreeItem* fListLevel         current TGListTree level
                   Bool_t fTreeLock          true when we want to lock TGListTree
                    Int_t fViewMode          current IconBox view mode
                    Int_t fSortMode          current IconBox sort mode

## Class Description

     TRootBrowser

     This class creates a ROOT object browser (looking like Windows
     Explorer). The widgets used are the new native ROOT GUI widgets.

TRootBrowser(TBrowser *b, const char *name, UInt_t width, UInt_t height) : TGMainFrame(gClient->GetRoot(), width, height), TBrowserImp(b)

     Create browser with a specified width and height.

TRootBrowser(TBrowser *b, const char *name, Int_t x, Int_t y, UInt_t width, UInt_t height) : TGMainFrame(gClient->GetRoot(), width, height), TBrowserImp(b)

     Create browser with a specified width and height and at position x, y.

~TRootBrowser()

     Browser destructor.

void CreateBrowser(const char *name)

     Create the actual canvas.

Bool_t HandleKey(Event_t *event)

     handle keys

void Add(TObject *obj, const char *name)

     Add items to the browser. This function has to be called
     by the Browse() member function of objects when they are
     called by a browser.

void AddToBox(TObject *obj, const char *name)

     Add items to the iconbox of the browser.

void AddToTree(TObject *obj, const char *name)

     Add items to the current TGListTree of the browser.

void BrowseObj(TObject *obj)

     Browse object. This, in turn, will trigger the calling of
     TRootBrowser::Add() which will fill the IconBox and the tree.
     Emits signal "BrowseObj(TObject*)".

void UpdateDrawOption()

     add new draw option to the "history"

TGFileContainer* GetIconBox() const

     returns pointer to fIconBox object

void ReallyDelete()

     Really delete the browser and the this GUI.

void CloseWindow()

     In case window is closed via WM we get here.

void DisplayTotal(Int_t total, Int_t selected)

     Display in statusbar total number of objects and number of
     selected objects in IconBox.

void DisplayDirectory()

     Display current directory in second label, fLbl2.

void ExecuteDefaultAction(TObject *obj)

     Execute default action for selected object (action is specified
     in the $HOME/.root.mimes or $ROOTSYS/etc/root.mimes file.
     Emits signal "ExecuteDefaultAction(TObject*)".

Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)

     Handle menu and other command generated by the user.

void Chdir(TGListTreeItem *item)

     Make object associated with item the current directory.

void HighlightListLevel()

     helper method  to track history

void AddToHistory(TGListTreeItem *item)

     helper method to track history

void ClearHistory()

     clear navigation history

Bool_t HistoryBackward()

     go to the past

Bool_t HistoryForward()

      go to the future

void DeleteListTreeItem(TGListTreeItem *item)

     delete list tree item, remove it from history

void ListTreeHighlight(TGListTreeItem *item)

     Open tree item and list in iconbox its contents.

void ToUpSystemDirectory()

     display upper directory

void SetDrawOption(Option_t *option)

     sets drawing option

Option_t* GetDrawOption() const

     returns drawing option

void DoubleClicked(TObject *obj)

     Emits signal when double clicking on icon.

void IconBoxAction(TObject *obj)

     Default action when double clicking on icon.

void RecursiveRemove(TObject *obj)

     Recursively remove object from browser.

void Refresh(Bool_t force)

     Refresh the browser contents.

void ShowToolBar(Bool_t show)

     Show or hide toolbar.

void ShowStatusBar(Bool_t show)

     Show or hide statusbar.

void SetDefaults(const char *iconStyle, const char *sortBy)

     Set defaults depending on settings in the user's .rootrc.

void SetViewMode(Int_t new_mode, Bool_t force)

     Set iconbox's view mode and update menu and toolbar buttons accordingly.

void SetSortMode(Int_t new_mode)

     Set iconbox's sort mode and update menu radio buttons accordingly.

### Inline Functions

                    void Iconify()
                    void ResizeBrowser()
                    void Show()
             TGListTree* GetListTree() const
            TGStatusBar* GetStatusBar() const
              TGMenuBar* GetMenuBar() const
              TGToolBar* GetToolBar() const
                 TClass* Class()
                 TClass* IsA() const
                    void ShowMembers(TMemberInspector& insp, char* parent)
                    void Streamer(TBuffer& b)
                    void StreamerNVirtual(TBuffer& b)
            TRootBrowser TRootBrowser(const TRootBrowser&)

Author: Fons Rademakers 27/02/98
Last update: root/gui:$Name: $:$Id: TRootBrowser.cxx,v 1.75 2005/06/01 12:35:55 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *