TGRootIDE.h

Go to the documentation of this file.
00001 // @(#)root/test/RootIDE/:$Id: TGRootIDE.h 26142 2008-11-11 14:53:11Z bellenot $
00002 // Author: Bertrand Bellenot   20/04/2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2007, 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 #ifndef ROOT_TGROOTIDE
00013 #define ROOT_TGROOTIDE
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TGRootIDE                                                            //
00019 //                                                                      //
00020 //////////////////////////////////////////////////////////////////////////
00021 
00022 #ifndef ROOT_TGFrame
00023 #include "TGFrame.h"
00024 #endif
00025 #ifndef ROOT_TGTextEdit
00026 #include "TGTextEdit.h"
00027 #endif
00028 
00029 class TGToolBar;
00030 class TTimer;
00031 class TGStatusBar;
00032 class TGLayoutHints;
00033 class TGMenuBar;
00034 class TGPopupMenu;
00035 class TString;
00036 class TMacro;
00037 class TGText;
00038 class TGTextEntry;
00039 class TGComboBox;
00040 class TGTextBuffer;
00041 class TGTab;
00042 class TGFileContainer;
00043 class TGLVEntry;
00044 class TObjArray;
00045 class TGTabElement;
00046 class TGVerticalFrame;
00047 class TGHorizontalFrame;
00048 class TGPictureButton;
00049 class THtml;
00050 class TGLabel;
00051 class TProcessID;
00052 class TGHtml;
00053 
00054 class TGDocument : public TNamed {
00055 
00056 protected:
00057    Int_t              fTabId;       // Tab id associated to this document
00058    Bool_t             fModified;    // modified flag
00059    TGTextEdit        *fEditor;      // pointer on TGTextEdit widget
00060    TGTab             *fTab;         // pointer to main TGTab widget
00061    TGTabElement      *fTabEl;       // pointer to associated TGTabElement
00062    TObjArray         *fDocList;     // pointer to list of opened documents
00063 
00064 public:
00065    TGDocument(const char *fname = "", const char *title = "", Int_t tabid = 0,
00066              TGTab *tab = 0, TGTabElement *tabel = 0, TGTextEdit *edit = 0,
00067              TObjArray *doclist = 0);
00068    virtual ~TGDocument() { }
00069 
00070    Bool_t         Open(const char *filename);
00071    Bool_t         Close();
00072    Bool_t         Save(const char *filename = "");
00073    Int_t          GetTabId() const { return fTabId; }
00074    Bool_t         IsModified() const { return fModified; }
00075    void           SetTabId(Int_t id) { fTabId = id; }
00076    void           Modified(Bool_t mod = kTRUE) { fModified = mod; }
00077    TGTextEdit    *GetTextEdit() const { return fEditor; }
00078    TGTab         *GetTab() const { return fTab; }
00079    TGTabElement  *GetTabEl() const { return fTabEl; }
00080    void           DataChanged();
00081    void           DataDropped(char *fname);
00082 
00083    ClassDef(TGDocument,0)  // Simple class describing document used in TGRootIDE
00084 };
00085 
00086 class TGRootIDE : public TGMainFrame {
00087 
00088 protected:
00089    Int_t              fPid;               // current process id
00090    TTimer            *fTimer;             // for statusbar and toolbar update
00091    TGStatusBar       *fStatusBar;         // for file name, line and col number
00092    TGToolBar         *fToolBar;           // toolbar with common tool buttons
00093    TGTab             *fTab;               // Main tab
00094    TGTextEntry       *fDir;               // directory text entry
00095    TGTextBuffer      *fDirBuf;            // directory text buffer
00096    TGComboBox        *fDirCombo;          // directory history combobox
00097    TGFileContainer   *fContents;          // file navigation container
00098    TGTextEdit        *fTextEdit;          // active text edit widget
00099    TGTextView        *fTextView;          // command output widget
00100    TGComboBox        *fComboCmd;          // commands combobox
00101    TGComboBox        *fFileType;          // file type combobox
00102    TGTextEntry       *fFilter;            // file type text entry widget
00103    TGLabel           *fLabel;             // "command :" label
00104    TGTextEntry       *fCommand;           // command text entry widget
00105    TGTextBuffer      *fCommandBuf;        // command text buffer
00106    TGLayoutHints     *fMenuBarLayout;     // used for the menubar
00107    TGLayoutHints     *fMenuBarItemLayout; // used for for menubar items
00108    TGMenuBar         *fMenuBar;           // editor's menu bar
00109    TGPopupMenu       *fMenuFile;          // "File" menu entry
00110    TGPopupMenu       *fMenuEdit;          // "Edit" menu entry
00111    TGPopupMenu       *fMenuSearch;        // "Search" menu entry
00112    TGPopupMenu       *fMenuTools;         // "Tools" menu entry
00113    TGPopupMenu       *fMenuHelp;          // "Help" menu entry
00114    Bool_t             fExiting;           // true if editor is closing
00115    Bool_t             fTextChanged;       // true if text has changed
00116    TString            fFilename;          // name of the opened file
00117    TMacro            *fMacro;             // pointer on the opened macro
00118    TObjArray         *fDocList;           // list of open documents
00119    TGDocument        *fCurrentDoc;        // pointer on current document
00120    Int_t              fCurrent;           // index of current document
00121    Int_t              fNbDoc;             // number of documents
00122 
00123    TGVerticalFrame   *fVerticalFrame;     // vertical frame
00124    TGHorizontalFrame *fHorizontalFrame;   // horizontal frame
00125    TGPictureButton   *fBack;              // back button
00126    TGPictureButton   *fForward;           // forward button
00127    TGPictureButton   *fReload;            // reload button
00128    TGPictureButton   *fStop;              // stop loading button
00129    TGPictureButton   *fHome;              // home button
00130    TGComboBox        *fComboBox;          // url history combo box
00131    TGTextBuffer      *fURLBuf;            // url buffer
00132    TGTextEntry       *fURL;               // url text entry
00133    THtml             *fHtml;              // html doc
00134    TGHtml            *fGuiHtml;           // html widget
00135 
00136    virtual void       Build();
00137 
00138 public:
00139    TGRootIDE(const char *filename = 0, const TGWindow *p = 0,
00140                 UInt_t w = 900, UInt_t h = 600);
00141    TGRootIDE(TMacro *macro, const TGWindow *p = 0, UInt_t w = 0,
00142                 UInt_t h = 0);
00143    virtual ~TGRootIDE();
00144 
00145    virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00146    virtual Bool_t HandleKey(Event_t *event);
00147    virtual Bool_t HandleTimer(TTimer *t);
00148    virtual void   CloseWindow();
00149 
00150    void           ClearText();
00151    Bool_t         LoadBuffer(const char *buf) { return fTextEdit->LoadBuffer(buf); }
00152    void           LoadFile(char *fname = NULL);
00153    void           SaveFile(const char *fname);
00154    Bool_t         SaveFileAs();
00155    void           PrintText();
00156    void           Search(Bool_t ret);
00157    void           Goto();
00158    void           About();
00159    Int_t          IsSaved();
00160    void           CompileMacro();
00161    void           ExecuteMacro();
00162    void           InterruptMacro();
00163    void           SetText(TGText *text) { fTextEdit->SetText(text); }
00164    void           AddText(TGText *text) { fTextEdit->AddText(text); }
00165    void           AddLine(const char *string) { fTextEdit->AddLine(string); }
00166    void           AddLineFast(const char *string) { fTextEdit->AddLineFast(string); }
00167    TGText        *GetText() const { return fTextEdit->GetText(); }
00168 
00169    void           DisplayFile(const TString &fname);
00170    void           DisplayDirectory(const TString &fname);
00171    void           DisplayObject(const TString& fname,const TString& name);
00172    void           OnDoubleClick(TGLVEntry* f, Int_t btn);
00173    void           CloseTab(Int_t id);
00174    void           DoTab(Int_t id);
00175    void           ApplyFilter(Int_t id);
00176    
00177    void           CheckRemote(const char *str);
00178    void           DirSelected(const char *txt);
00179    void           DirChanged();
00180    void           Selected(const char *txt);
00181    void           URLChanged();
00182    void           Back();
00183    void           Forward();
00184    void           Reload();
00185    void           Stop();
00186    void           MouseOver(char *);
00187    void           MouseDown(char *);
00188 
00189    ClassDef(TGRootIDE,0)  // Simple IDE using TGTextEdit and TGHtml widgets
00190 };
00191 
00192 #endif

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