TRootBrowserLite.h

Go to the documentation of this file.
00001 // @(#)root/gui:$Id: TRootBrowserLite.h 30884 2009-10-27 12:26:33Z rdm $
00002 // Author: Fons Rademakers   27/02/98
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 
00013 #ifndef ROOT_TRootBrowserLite
00014 #define ROOT_TRootBrowserLite
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TRootBrowserLite                                                     //
00019 //                                                                      //
00020 // This class creates a ROOT object browser (looking like Windows       //
00021 // Explorer). The widgets used are the new native ROOT GUI widgets.     //
00022 //                                                                      //
00023 //////////////////////////////////////////////////////////////////////////
00024 
00025 #ifndef ROOT_TBrowserImp
00026 #include "TBrowserImp.h"
00027 #endif
00028 #ifndef ROOT_TGFrame
00029 #include "TGFrame.h"
00030 #endif
00031 
00032 class TGMenuBar;
00033 class TGPopupMenu;
00034 class TGLayoutHints;
00035 class TGStatusBar;
00036 class TGHorizontal3DLine;
00037 class TGToolBar;
00038 class TGButton;
00039 class TGFSComboBox;
00040 class TGLabel;
00041 class TGListView;
00042 class TRootIconBox;
00043 class TGCanvas;
00044 class TGListTree;
00045 class TGListTreeItem;
00046 class TGFileItem;
00047 class TList;
00048 class TGFileContainer;
00049 class TGComboBox;
00050 class TGTextEdit;
00051 
00052 class TRootBrowserLite : public TGMainFrame, public TBrowserImp {
00053 
00054 friend class TRootIconBox;
00055 
00056 private:
00057    TGMenuBar           *fMenuBar;
00058    TGToolBar           *fToolBar;
00059    TGHorizontal3DLine  *fToolBarSep;
00060    TGVerticalFrame     *fV1;
00061    TGVerticalFrame     *fV2;
00062    TGLabel             *fLbl1;
00063    TGLabel             *fLbl2;
00064    TGHorizontalFrame   *fHf;
00065    TGCompositeFrame    *fTreeHdr;
00066    TGCompositeFrame    *fListHdr;
00067 
00068    TGLayoutHints       *fMenuBarLayout;
00069    TGLayoutHints       *fMenuBarItemLayout;
00070    TGLayoutHints       *fMenuBarHelpLayout;
00071    TGLayoutHints       *fComboLayout;
00072    TGLayoutHints       *fBarLayout;
00073    TGComboBox          *fDrawOption;         // drawing option entry
00074    TGLayoutHints       *fExpandLayout;       //
00075    Bool_t               fBrowseTextFile;     //
00076    TString              fTextFileName;
00077 
00078    TList               *fWidgets;
00079    TList               *fHistory;            // history of browsing
00080    TObject             *fHistoryCursor;      // current hsitory position
00081    const TGPicture     *fIconPic;            // icon picture
00082 
00083    void  CreateBrowser(const char *name);
00084    void  ListTreeHighlight(TGListTreeItem *item);
00085    void  DeleteListTreeItem(TGListTreeItem *item);
00086    void  HighlightListLevel();
00087    void  AddToHistory(TGListTreeItem *item);
00088    void  IconBoxAction(TObject *obj);
00089    void  Chdir(TGListTreeItem *item);
00090    void  DisplayDirectory();
00091    void  DisplayTotal(Int_t total, Int_t selected);
00092    void  SetViewMode(Int_t new_mode, Bool_t force = kFALSE);
00093    void  ToSystemDirectory(const char *dirname);
00094    void  UpdateDrawOption();
00095    void  Search();
00096    void  BrowseTextFile(const char *file);
00097    void  HideTextEdit();
00098    void  ShowMacroButtons(Bool_t show = kTRUE);
00099 
00100    Bool_t  HistoryBackward();
00101    Bool_t  HistoryForward();
00102    void    ClearHistory();
00103 
00104 protected:
00105    TGPopupMenu         *fFileMenu;
00106    TGPopupMenu         *fViewMenu;
00107    TGPopupMenu         *fOptionMenu;
00108    TGPopupMenu         *fHelpMenu;
00109    TGPopupMenu         *fSortMenu;
00110    TGListView          *fListView;
00111    TRootIconBox        *fIconBox;
00112    TGCanvas            *fTreeView;
00113    TGListTree          *fLt;
00114    TGButton            *fToolBarButton[7];  // same size as gToolBarData[]
00115    TGFSComboBox        *fFSComboBox;
00116    TGStatusBar         *fStatusBar;
00117    TGListTreeItem      *fListLevel;         // current TGListTree level
00118    Bool_t               fTreeLock;          // true when we want to lock TGListTree
00119    Int_t                fViewMode;          // current IconBox view mode
00120    Int_t                fSortMode;          // current IconBox sort mode
00121    TGTextEdit          *fTextEdit;          // contents of browsed text file
00122 
00123 public:
00124    TRootBrowserLite(TBrowser *b = 0, const char *title = "ROOT Browser", UInt_t width = 800, UInt_t height = 500);
00125    TRootBrowserLite(TBrowser *b, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height);
00126    virtual ~TRootBrowserLite();
00127 
00128    virtual void Add(TObject *obj, const char *name = 0, Int_t check = -1);
00129    virtual void AddToBox(TObject *obj, const char *name);
00130    virtual void AddToTree(TObject *obj, const char *name, Int_t check = -1);
00131 
00132    virtual void AddCheckBox(TObject *obj, Bool_t check = kFALSE);
00133    virtual void CheckObjectItem(TObject *obj, Bool_t check = kFALSE);
00134    virtual void RemoveCheckBox(TObject *obj);
00135 
00136    virtual void BrowseObj(TObject *obj);             //*SIGNAL*
00137    virtual void ExecuteDefaultAction(TObject *obj);  //*SIGNAL*
00138    virtual void DoubleClicked(TObject *obj);         //*SIGNAL*
00139    virtual void Checked(TObject *obj, Bool_t check); //*SIGNAL*
00140    virtual void Iconify() { }
00141    virtual void RecursiveRemove(TObject *obj);
00142    virtual void Refresh(Bool_t force = kFALSE);
00143    virtual void ResizeBrowser() { }
00144    virtual void ShowToolBar(Bool_t show = kTRUE);
00145    virtual void ShowStatusBar(Bool_t show = kTRUE);
00146    virtual void Show() { MapRaised(); }
00147    virtual void SetDefaults(const char *iconStyle = 0, const char *sortBy = 0);
00148    virtual Bool_t HandleKey(Event_t *event);
00149    virtual void SetStatusText(const char *txt, Int_t col);
00150 
00151    TGListTree      *GetListTree()  const { return fLt; }
00152    TGFileContainer *GetIconBox()   const;
00153    TGStatusBar     *GetStatusBar() const { return fStatusBar; }
00154    TGMenuBar       *GetMenuBar()   const { return  fMenuBar; }
00155    TGToolBar       *GetToolBar()   const { return fToolBar; }
00156    void             SetDrawOption(Option_t *option="");
00157    Option_t        *GetDrawOption() const;
00158    void             SetSortMode(Int_t new_mode);
00159    TGMainFrame     *GetMainFrame() const { return (TGMainFrame *)this; }
00160 
00161    // overridden from TGMainFrame
00162    void     CloseWindow();
00163    Bool_t   ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00164    void     ReallyDelete();
00165 
00166    // auxilary (a la privae) methods
00167    void     ExecMacro();
00168    void     InterruptMacro();
00169 
00170    static TBrowserImp *NewBrowser(TBrowser *b = 0, const char *title = "ROOT Browser", UInt_t width = 800, UInt_t height = 500, Option_t *opt="");
00171    static TBrowserImp *NewBrowser(TBrowser *b, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height, Option_t *opt="");
00172 
00173    ClassDef(TRootBrowserLite,0)  //ROOT native GUI version of browser
00174 };
00175 
00176 #endif

Generated on Tue Jul 5 14:20:11 2011 for ROOT_528-00b_version by  doxygen 1.5.1