183 "ROOT Macros",
"*.C",
184 "Source files",
"*.cxx",
185 "Text files",
"*.txt",
237 if (
p &&
p !=
gClient->GetDefaultRoot()) {
261 if (
p &&
p !=
gClient->GetDefaultRoot()) {
277 tmp.Form(
"TMacro : %s: %ld lines read.",
282 tmp.Form(
"TMacro : %s - TGTextEditor", macro->
GetName());
394 if (strlen(
fTbData[i].fPixmap) == 0) {
424 gClient->GetColorByName(
"#3399ff", pxl);
431 Int_t parts[] = { 75, 25 };
450 fTextEdit->
Connect(
"DataDropped(char *)",
"TGTextEditor",
this,
"DataDropped(char *)");
481 tmp.Form(
"%s - TGTextEditor", fname);
527 tmp.Form(
"Error opening file \"%s\"", fname);
534 tmp.Form(
"%s - TGTextEditor", fname);
551 tmp.Form(
"Error saving file \"%s\"", fname);
556 if ((
p = (
char *)strrchr(fname,
'/')) == 0) {
564 tmp.Form(
"%s - TGTextEditor",
p);
602 tmp.Form(
"The text has been modified. Do you want to save the changes?");
798 "The text has been modified. Do you want to save the changes?",
852 sprintf(str,
"About ROOT %s...",
gROOT->GetVersion());
868 if ((
gVirtualX->InheritsFrom(
"TGX11")) &&
901 tmp.Form(
"Ln %ld, Ch %ld", pos.
fY, pos.
fX);
978 if (
prop.fName !=
"") {
979 fontname.Form(
"-*-%s-%s-%c-*-*-%d-*-*-*-*-*-*-*",
981 prop.fBold ?
"bold" :
"medium",
982 prop.fItalic ?
'i' :
'r',
985 fontname.Form(
"-*-%s-%s-%c-*-*-%d-*-*-*-*-*-*-*",
987 prop.fBold ?
"bold" :
"medium",
988 prop.fItalic ?
'o' :
'r',
1042 if(strlen(
string) > 1) {
1043 gROOT->ProcessLine(
string);
const Mask_t kFocusChangeMask
const Mask_t kKeyPressMask
const Mask_t kKeyShiftMask
const Mask_t kKeyControlMask
const Mask_t kLeaveWindowMask
const Mask_t kStructureNotifyMask
const Mask_t kEnterWindowMask
ULong_t Pixel_t
Pixel value.
Handle_t FontStruct_t
Pointer to font structure.
R__EXTERN const char gHelpAbout[]
R__EXTERN const char gHelpTextEditor[]
R__EXTERN TApplication * gApplication
static char * gEPrintCommand
const char * ed_filetypes[]
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h prop
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char fontname
char * StrDup(const char *str)
Duplicate the string str.
R__EXTERN TSystem * gSystem
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
const TGWindow * GetRoot() const
Returns current root (i.e.
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get a font from the font pool.
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
virtual TGTextEntry * GetTextEntry() const
virtual void ReturnPressed()
Add new entry to combo box when return key pressed inside text entry ReturnPressed signal is emitted.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
UInt_t GetDefaultWidth() const override
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
UInt_t GetDefaultHeight() const override
void Layout() override
Layout the elements of the composite frame.
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
This class creates a file selection dialog.
char * fFilename
selected file name
const char ** fFileTypes
file types used to filter selectable files
Bool_t fOverwrite
if true overwrite the file with existing name on save
void SetIniDir(const char *inidir)
Set directory name.
Font selection dialog, allowing to select one in the list of available fonts in the system.
Encapsulate fonts used in the GUI system.
FontStruct_t GetFontStruct() const
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
static Pixel_t GetWhitePixel()
Get white pixel value.
virtual UInt_t GetDefaultHeight() const
void MapWindow() override
map window
virtual void DeleteWindow()
Delete window.
void UnmapWindow() override
unmap window
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
A horizontal 3D line is a line that typically separates a toolbar from the menubar.
This class handles GUI labels.
This class describes layout hints used by the layout classes.
Defines top level windows that interact with the system Window Manager.
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
virtual void CloseWindow()
Close and delete main frame.
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Bool_t HandleKey(Event_t *event) override
Handle keyboard events.
TGClient * fClient
Connection to display server.
Handle_t fId
X11/Win32 Window identifier.
Provides a StatusBar widget.
virtual void SetText(TGString *text, Int_t partidx=0)
Set text in partition partidx in status bar.
virtual void SetParts(Int_t npart)
Divide the status bar in npart equal sized parts.
const char * GetString() const
A TGTextEdit is a specialization of TGTextView.
virtual Bool_t Goto(Long_t line, Long_t column=0)
Goto the specified line.
TGPopupMenu * GetMenu() const
virtual Bool_t SaveFile(const char *fname, Bool_t saveas=kFALSE)
Save file.
void Delete(Option_t *="") override
Delete selection.
virtual Bool_t Cut()
Cut text.
TGLongPosition GetCurrentPos() const
void Clear(Option_t *="") override
Clear text edit widget.
void Copy(TObject &) const override
Copy this to obj.
void Print(Option_t *="") const override
Send current buffer to printer.
Bool_t Search(const char *string, Bool_t direction=kTRUE, Bool_t caseSensitive=kFALSE) override
Search for string in the specified direction.
virtual Bool_t Paste()
Paste text into widget.
A simple text editor that uses the TGTextEdit widget.
TGStatusBar * fStatusBar
for file name, line and col number
Bool_t fTextChanged
true if text has changed
TGPopupMenu * fMenuTools
"Tools" menu entry
void DataChanged()
Slot setting the fTextChanged flag to true when the text has been modified in fTextEdit.
TString fFilename
name of the opened file
void InterruptMacro()
Interrupt execution of a macro.
void CloseWindow() override
Close TGTextEditor window.
Int_t IsSaved()
Check if file has to be saved in case of modifications.
void Search(Bool_t ret)
Invokes search dialog, or just search previous string if again is true.
TTimer * fTimer
for statusbar and toolbar update
TGPopupMenu * fMenuFile
"File" menu entry
TGLayoutHints * fMenuBarLayout
used for the menubar
TGTextEntry * fCommand
command text entry widget
TGLabel * fLabel
"command" label
void DataDropped(char *fname)
Update file information when receiving the signal DataDropped from TGTextEdit widget.
void CompileMacro()
Save the edited text in a temporary macro, then compile it.
Bool_t HandleKey(Event_t *event) override
Keyboard event handler.
~TGTextEditor() override
TGTextEditor destructor.
void ClearText()
Clear text edit widget.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Handle menu and other command generated by the user.
virtual void Build()
Build TGTextEditor widget.
void Goto()
Invokes goto dialog, and go to the specified line.
void About()
Display ROOT splash screen.
void ExecuteMacro()
Save the edited text in a temporary macro, execute it, and then delete the temporary file.
Bool_t SaveFileAs()
Save the edited text in a file selected with TGFileDialog.
TMacro * fMacro
pointer on the opened macro
TGMenuBar * fMenuBar
editor's menu bar
TGTextEditor(const char *filename=nullptr, const TGWindow *p=nullptr, UInt_t w=900, UInt_t h=600)
TGTextEditor constructor with file name as first argument.
TGTextEdit * fTextEdit
text edit widget
void PrintText()
Open the print dialog and send current buffer to printer.
TGLayoutHints * fMenuBarItemLayout
used for for menubar items
void SaveFile(const char *fname)
Save the edited text in the file "fname".
TGComboBox * fComboCmd
commands combobox
TGPopupMenu * fMenuEdit
"Edit" menu entry
TGPopupMenu * fMenuSearch
"Search" menu entry
TGTextBuffer * fCommandBuf
command text buffer
TGPopupMenu * fMenuHelp
"Help" menu entry
void DeleteWindow() override
Delete TGTextEditor Window.
Bool_t HandleTimer(TTimer *t) override
Handle timer event.
void LoadFile(const char *fname=nullptr)
Load a file into the editor. If fname is 0, a TGFileDialog will popup.
TGToolBar * fToolBar
toolbar with common tool buttons
Bool_t fExiting
true if editor is closing
TGTextBuffer * GetBuffer() const
virtual void Update()
update the whole window of text view
virtual Bool_t LoadFile(const char *fname, long startpos=0, long length=-1)
Load a file in the text view widget.
void Layout() override
Layout the components of view.
virtual void AddLine(const char *string)
Add a line of text to the view widget.
virtual Bool_t SelectAll()
Select all text in the viewer.
virtual void SetSelectBack(Pixel_t p)
set selected text background color
virtual Long_t ReturnLineCount()
virtual void SetFont(FontStruct_t font)
Changes text entry font.
virtual void SetSelectFore(Pixel_t p)
set selected text color
ROOT GUI Window base class.
const TGWindow * fParent
Parent window.
Class supporting a collection of lines with C++ code.
virtual Longptr_t Exec(const char *params=nullptr, Int_t *error=nullptr)
Execute this macro with params, if params is 0, default parameters (set via SetParams) are used.
TList * GetListOfLines() const
const char * GetName() const override
Returns name of object.
Collectable string class.
const char * GetName() const override
Returns name of object.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
A TRootHelpDialog is used to display help text (or any text in a dialog window).
void SetText(const char *helpText)
Set help text from helpText buffer in TGTextView.
void Popup()
Show help dialog.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
const char * Data() const
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
virtual Int_t Exec(const char *shellcmd)
Execute a command.
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual int CompileMacro(const char *filename, Option_t *opt="", const char *library_name="", const char *build_dir="", UInt_t dirmode=0)
This method compiles and loads a shared library containing the code from the file "filename".
virtual const char * WorkingDirectory()
Return working directory.
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
virtual int Unlink(const char *name)
Unlink, i.e.
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
Handles synchronous and a-synchronous timer events.
virtual void TurnOn()
Add the timer to the system timer list.
void Reset()
Reset the timer.
EGEventType fType
of event (see EGEventType)
UInt_t fState
key or button mask