Warning, file /include/root/TGTextEditor.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGTextEditor
0013 #define ROOT_TGTextEditor
0014
0015
0016 #include "TGFrame.h"
0017 #include "TGTextEdit.h"
0018
0019 class TGComboBox;
0020 class TGLabel;
0021 class TGLayoutHints;
0022 class TGMenuBar;
0023 class TGPopupMenu;
0024 class TGStatusBar;
0025 class TGText;
0026 class TGTextBuffer;
0027 class TGTextEntry;
0028 class TGToolBar;
0029 class TMacro;
0030 class TString;
0031 class TTimer;
0032
0033 class TGTextEditor : public TGMainFrame {
0034
0035 protected:
0036
0037 TTimer *fTimer;
0038 TGStatusBar *fStatusBar;
0039 TGToolBar *fToolBar;
0040 TGTextEdit *fTextEdit;
0041 TGLabel *fLabel;
0042 TGComboBox *fComboCmd;
0043 TGTextEntry *fCommand;
0044 TGTextBuffer *fCommandBuf;
0045 TGLayoutHints *fMenuBarLayout;
0046 TGLayoutHints *fMenuBarItemLayout;
0047 TGMenuBar *fMenuBar;
0048 TGPopupMenu *fMenuFile;
0049 TGPopupMenu *fMenuEdit;
0050 TGPopupMenu *fMenuSearch;
0051 TGPopupMenu *fMenuTools;
0052 TGPopupMenu *fMenuHelp;
0053 Bool_t fExiting;
0054 Bool_t fTextChanged;
0055 TString fFilename;
0056 TMacro *fMacro;
0057 virtual void Build();
0058
0059 public:
0060 TGTextEditor(const char *filename = nullptr, const TGWindow *p = nullptr,
0061 UInt_t w = 900, UInt_t h = 600);
0062 TGTextEditor(TMacro *macro, const TGWindow *p = nullptr, UInt_t w = 0,
0063 UInt_t h = 0);
0064 ~TGTextEditor() override;
0065
0066 void ClearText();
0067 Bool_t LoadBuffer(const char *buf) { return fTextEdit->LoadBuffer(buf); }
0068 void LoadFile(const char *fname = nullptr);
0069 void SaveFile(const char *fname);
0070 Bool_t SaveFileAs();
0071 void PrintText();
0072 void Search(Bool_t ret);
0073 void Goto();
0074 void About();
0075 void DataChanged();
0076 void DataDropped(char *fname);
0077 Int_t IsSaved();
0078 void CompileMacro();
0079 void ExecuteMacro();
0080 void InterruptMacro();
0081 void SetText(TGText *text) { fTextEdit->SetText(text); }
0082 void AddText(TGText *text) { fTextEdit->AddText(text); }
0083 void AddLine(const char *string) { fTextEdit->AddLine(string); }
0084 void AddLineFast(const char *string) { fTextEdit->AddLineFast(string); }
0085 TGText *GetText() const { return fTextEdit->GetText(); }
0086
0087 Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override;
0088 Bool_t HandleKey(Event_t *event) override;
0089 Bool_t HandleTimer(TTimer *t) override;
0090 void CloseWindow() override;
0091 void DeleteWindow() override;
0092
0093 ClassDefOverride(TGTextEditor,0)
0094 };
0095
0096 #endif