183 "ROOT Macros",
"*.C",
184 "Source files",
"*.cxx",
185 "Text files",
"*.txt",
236 if (p && p !=
gClient->GetDefaultRoot()) {
260 if (p && p !=
gClient->GetDefaultRoot()) {
276 tmp.
Form(
"TMacro : %s: %ld lines read.",
281 tmp.
Form(
"TMacro : %s - TGTextEditor", macro->
GetName());
392 for (i = 0;
fTbData[i].fPixmap; i++) {
393 if (strlen(
fTbData[i].fPixmap) == 0) {
423 gClient->GetColorByName(
"#3399ff", pxl);
430 Int_t parts[] = { 75, 25 };
446 fTextEdit->Connect(
"DataChanged()",
"TGTextEditor",
this,
"DataChanged()");
447 fTextEdit->Connect(
"Closed()",
"TGTextEditor",
this,
"ClearText()");
448 fTextEdit->Connect(
"Opened()",
"TGTextEditor",
this,
"ClearText()");
449 fTextEdit->Connect(
"DataDropped(char *)",
"TGTextEditor",
this,
"DataDropped(char *)");
456 gApplication->Connect(
"Terminate(Int_t)",
"TGTextEditor",
this,
"ClearText()");
478 tmp.
Form(
"%s: %ld lines read.", fname,
fTextEdit->ReturnLineCount());
480 tmp.
Form(
"%s - TGTextEditor", fname);
526 tmp.
Form(
"Error opening file \"%s\"", fname);
531 tmp.
Form(
"%s: %ld lines read.", fname,
fTextEdit->ReturnLineCount());
533 tmp.
Form(
"%s - TGTextEditor", fname);
550 tmp.
Form(
"Error saving file \"%s\"", fname);
555 if ((p = (
char *)strrchr(fname,
'/')) == 0) {
560 tmp.
Form(
"%s: %ld lines written.", p,
fTextEdit->ReturnLineCount());
563 tmp.
Form(
"%s - TGTextEditor", p);
601 tmp.
Form(
"The text has been modified. Do you want to save the changes?");
677 gVirtualX->LookupString(event, input,
sizeof(input), keysym);
775 const char *tmpfile =
gSystem->PrependPathName(
gSystem->TempDirectory(), temp);
777 gSystem->CompileMacro(tmpfile);
796 "The text has been modified. Do you want to save the changes?",
861 if ((
gVirtualX->InheritsFrom(
"TGX11")) &&
894 tmp.
Form(
"Ln %ld, Ch %ld", pos.fY, pos.fX);
971 if (prop.
fName !=
"") {
972 fontname.
Form(
"-*-%s-%s-%c-*-*-%d-*-*-*-*-*-*-*",
974 prop.
fBold ?
"bold" :
"medium",
977 if (!
gVirtualX->ListFonts(fontname, 10, count)) {
978 fontname.
Form(
"-*-%s-%s-%c-*-*-%d-*-*-*-*-*-*-*",
980 prop.
fBold ?
"bold" :
"medium",
1035 if(strlen(
string) > 1) {
1036 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
Handle_t FontStruct_t
Pointer to font structure.
ULong_t Pixel_t
Pixel value.
R__EXTERN const char gHelpAbout[]
R__EXTERN const char gHelpTextEditor[]
int Int_t
Signed integer 4 bytes (int).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
bool Bool_t
Boolean (0=false, 1=true) (bool).
externTApplication * gApplication
static char * gEPrintCommand
const char * ed_filetypes[]
char * StrDup(const char *str)
Duplicate the string str.
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
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.
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.
void MapWindow() override
map window
virtual void DeleteWindow()
Delete 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.
TGMainFrame(const TGMainFrame &)=delete
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.
A TGTextEdit is a specialization of TGTextView.
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
ROOT GUI Window base class.
const TGWindow * fParent
Parent window.
Class supporting a collection of lines with C++ code.
TList * GetListOfLines() const
const char * GetName() const override
Returns name of object.
Collectable string class.
const char * GetName() const override
Returns name of object.
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.
const char * Data() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Handles synchronous and a-synchronous timer events.
EGEventType fType
of event (see EGEventType)
UInt_t fState
key or button mask
Bool_t fItalic
italic flag