00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGROOTIDE
00013 #define ROOT_TGROOTIDE
00014
00015
00016
00017
00018
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;
00058 Bool_t fModified;
00059 TGTextEdit *fEditor;
00060 TGTab *fTab;
00061 TGTabElement *fTabEl;
00062 TObjArray *fDocList;
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)
00084 };
00085
00086 class TGRootIDE : public TGMainFrame {
00087
00088 protected:
00089 Int_t fPid;
00090 TTimer *fTimer;
00091 TGStatusBar *fStatusBar;
00092 TGToolBar *fToolBar;
00093 TGTab *fTab;
00094 TGTextEntry *fDir;
00095 TGTextBuffer *fDirBuf;
00096 TGComboBox *fDirCombo;
00097 TGFileContainer *fContents;
00098 TGTextEdit *fTextEdit;
00099 TGTextView *fTextView;
00100 TGComboBox *fComboCmd;
00101 TGComboBox *fFileType;
00102 TGTextEntry *fFilter;
00103 TGLabel *fLabel;
00104 TGTextEntry *fCommand;
00105 TGTextBuffer *fCommandBuf;
00106 TGLayoutHints *fMenuBarLayout;
00107 TGLayoutHints *fMenuBarItemLayout;
00108 TGMenuBar *fMenuBar;
00109 TGPopupMenu *fMenuFile;
00110 TGPopupMenu *fMenuEdit;
00111 TGPopupMenu *fMenuSearch;
00112 TGPopupMenu *fMenuTools;
00113 TGPopupMenu *fMenuHelp;
00114 Bool_t fExiting;
00115 Bool_t fTextChanged;
00116 TString fFilename;
00117 TMacro *fMacro;
00118 TObjArray *fDocList;
00119 TGDocument *fCurrentDoc;
00120 Int_t fCurrent;
00121 Int_t fNbDoc;
00122
00123 TGVerticalFrame *fVerticalFrame;
00124 TGHorizontalFrame *fHorizontalFrame;
00125 TGPictureButton *fBack;
00126 TGPictureButton *fForward;
00127 TGPictureButton *fReload;
00128 TGPictureButton *fStop;
00129 TGPictureButton *fHome;
00130 TGComboBox *fComboBox;
00131 TGTextBuffer *fURLBuf;
00132 TGTextEntry *fURL;
00133 THtml *fHtml;
00134 TGHtml *fGuiHtml;
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)
00190 };
00191
00192 #endif