Logo ROOT  
Reference Guide
TGTextEditor.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id: ca18aae7f02ae8574b0c5414c78ede465425855d $
2// Author: Bertrand Bellenot 20/06/06
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11/**************************************************************************
12
13 This source is based on Xclass95, a Win95-looking GUI toolkit.
14 Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.
15
16 Xclass95 is free software; you can redistribute it and/or
17 modify it under the terms of the GNU Library General Public
18 License as published by the Free Software Foundation; either
19 version 2 of the License, or (at your option) any later version.
20
21**************************************************************************/
22
23//////////////////////////////////////////////////////////////////////////
24// //
25// TGTextEditor //
26// //
27// A simple text editor that uses the TGTextEdit widget. //
28// It provides all functionalities of TGTextEdit as copy, paste, cut, //
29// search, go to a given line number. In addition, it provides the //
30// possibilities for compiling, executing or interrupting a running //
31// macro. //
32// //
33// This class can be used in following ways: //
34// - with file name as argument: //
35// new TGTextEditor("hsimple.C"); //
36// - with a TMacro* as argument: //
37// TMacro *macro = new TMacro("hsimple.C"); //
38// new TGTextEditor(macro); //
39// //
40// Basic Features: //
41// //
42// New Document //
43// //
44// To create a new blank document, select File menu / New, or click //
45// the New toolbar button. It will create a new instance of //
46// TGTextEditor. //
47// //
48// Open/Save File //
49// //
50// To open a file, select File menu / Open or click on the Open //
51// toolbar button. This will bring up the standard File Dialog for //
52// opening files. //
53// If the current document has not been saved yet, you will be asked //
54// either to save or abandon the changes. //
55// To save the file using the same name, select File menu / Save or //
56// the toolbar Save button. To change the file name use File menu / //
57// Save As... or corresponding SaveAs button on the toolbar. //
58// //
59// Text Selection //
60// //
61// You can move the cursor by simply clicking on the desired location //
62// with the left mouse button. To highlight some text, press the mouse //
63// and drag the mouse while holding the left button pressed. //
64// To select a word, double-click on it; //
65// to select the text line - triple-click on it; //
66// to select all do quadruple-click. //
67// //
68// Cut, Copy, Paste //
69// //
70// After selecting some text, you can cut or copy it to the clipboard. //
71// A subsequent paste operation will insert the contents of the //
72// clipboard at the current cursor location. //
73// //
74// Text Search //
75// //
76// The editor uses a standard Search dialog. You can specify a forward //
77// or backward search direction starting from the current cursor //
78// location according to the selection made of a case sensitive mode //
79// or not. The last search can be repeated by pressing F3. //
80// //
81// Text Font //
82// //
83// You can change the text font by selecting Edit menu / Set Font. //
84// The Font Dialog pops up and shows the Name, Style, and Size of any //
85// available font. The selected font sample is shown in the preview //
86// area. //
87// //
88// Executing Macros //
89// //
90// You can execute the currently loaded macro in the editor by //
91// selecting Tools menu / Execute Macro; by clicking on the //
92// corresponding toolbar button, or by using Ctrl+F5 accelerator keys. //
93// This is identical to the command ".x macro.C" in the root prompt //
94// command line. //
95// //
96// Compiling Macros //
97// //
98// The currently loaded macro can be compiled with ACLiC if you select //
99// Tools menu / Compile Macro; by clicking on the corresponding //
100// toolbar button, or by using Ctrl+F7 accelerator keys. //
101// This is identical to the command ".L macro.C++" in the root prompt //
102// command line. //
103// //
104// Interrupting a Running Macro //
105// //
106// You can interrupt a running macro by selecting the Tools menu / //
107// Interrupt; by clicking on the corresponding toolbar button, or by //
108// using Shift+F5 accelerator keys. //
109// //
110// Interface to CINT Interpreter //
111// //
112// Any command entered in the Command combo box will be passed to //
113// the CINT interpreter. This combo box will keep the commands history //
114// and will allow you to re-execute the same commands during an editor //
115// session. //
116// //
117// Keyboard Bindings //
118// //
119// The following table lists the keyboard shortcuts and accelerator //
120// keys. //
121// //
122// Key: Action: //
123// ==== ======= //
124// //
125// Up Move cursor up. //
126// Shift+Up Move cursor up and extend selection. //
127// Down Move cursor down. //
128// Shift+Down Move cursor down and extend selection. //
129// Left Move cursor left. //
130// Shift+Left Move cursor left and extend selection. //
131// Right Move cursor right. //
132// Shift+Right Move cursor right and extend selection. //
133// Home Move cursor to begin of line. //
134// Shift+Home Move cursor to begin of line and extend selection.//
135// Ctrl+Home Move cursor to top of page. //
136// End Move cursor to end of line. //
137// Shift+End Move cursor to end of line and extend selection. //
138// Ctrl+End Move cursor to end of page. //
139// PgUp Move cursor up one page. //
140// Shift+PgUp Move cursor up one page and extend selection. //
141// PgDn Move cursor down one page. //
142// Shift+PgDn Move cursor down one page and extend selection. //
143// Delete Delete character after cursor, or text selection. //
144// BackSpace Delete character before cursor, or text selection.//
145// Ctrl+B Move cursor left. //
146// Ctrl+D Delete character after cursor, or text selection. //
147// Ctrl+E Move cursor to end of line. //
148// Ctrl+H Delete character before cursor, or text selection.//
149// Ctrl+K Delete characters from current position to the //
150// end of line. //
151// Ctrl+U Delete current line. //
152// //
153//Begin_Html
154/*
155<img src="gif/TGTextEditor.gif">
156*/
157//End_Html
158// //
159//////////////////////////////////////////////////////////////////////////
160
161
162#include "TROOT.h"
163#include "TApplication.h"
164#include "TSystem.h"
165#include "TMacro.h"
166#include "TInterpreter.h"
167#include "TGMsgBox.h"
168#include "TGFileDialog.h"
169#include "TGFontDialog.h"
170#include "TGTextEdit.h"
171#include "TGMenu.h"
172#include "TGButton.h"
173#include "TGStatusBar.h"
174#include "KeySymbols.h"
175#include "TGToolBar.h"
176#include "TG3DLine.h"
177#include "TGLabel.h"
178#include "TGTextEntry.h"
179#include "TGTextEditDialogs.h"
180#include "TGTextEditor.h"
181#include "TGComboBox.h"
182#include "TObjString.h"
183#include "TRootHelpDialog.h"
184#include "HelpText.h"
185#include "TVirtualX.h"
186#ifdef WIN32
187#include "TWin32SplashThread.h"
188#endif
189
190const char *ed_filetypes[] = {
191 "ROOT Macros", "*.C",
192 "Source files", "*.cxx",
193 "Text files", "*.txt",
194 "All files", "*",
195 0, 0
196};
197
205
207 { "ed_new.png", "New File", kFALSE, kM_FILE_NEW, 0 },
208 { "ed_open.png", "Open File", kFALSE, kM_FILE_OPEN, 0 },
209 { "ed_save.png", "Save File", kFALSE, kM_FILE_SAVE, 0 },
210 { "ed_saveas.png", "Save File As...", kFALSE, kM_FILE_SAVEAS, 0 },
211 { "", 0, 0, -1, 0 },
212 { "ed_print.png", "Print", kFALSE, kM_FILE_PRINT, 0 },
213 { "", 0, 0, -1, 0 },
214 { "ed_cut.png", "Cut selection", kFALSE, kM_EDIT_CUT, 0 },
215 { "ed_copy.png", "Copy selection", kFALSE, kM_EDIT_COPY, 0 },
216 { "ed_paste.png", "Paste selection", kFALSE, kM_EDIT_PASTE, 0 },
217 { "ed_delete.png", "Delete selection", kFALSE, kM_EDIT_DELETE, 0 },
218 { "", 0, 0, -1, 0 },
219 { "ed_find.png", "Find...", kFALSE, kM_SEARCH_FIND, 0 },
220 { "ed_findnext.png", "Find next", kFALSE, kM_SEARCH_FINDNEXT, 0 },
221 { "ed_goto.png", "Goto...", kFALSE, kM_SEARCH_GOTO, 0 },
222 { "", 0, 0, -1, 0 },
223 { "ed_compile.png", "Compile Macro", kFALSE, kM_TOOLS_COMPILE, 0 },
224 { "ed_execute.png", "Execute Macro", kFALSE, kM_TOOLS_EXECUTE, 0 },
225 { "ed_interrupt.png", "Interrupt", kFALSE, kM_TOOLS_INTERRUPT, 0 },
226 { "", 0, 0, -1, 0 },
227 { "ed_help.png", "Help Contents", kFALSE, kM_HELP_CONTENTS, 0 },
228 { "", 0, 0, -1, 0 },
229 { "ed_quit.png", "Close Editor", kFALSE, kM_FILE_EXIT, 0 },
230 { 0, 0, 0, 0, 0 }
231};
232
233static char *gEPrinter = 0;
234static char *gEPrintCommand = 0;
235
237
238////////////////////////////////////////////////////////////////////////////////
239/// TGTextEditor constructor with file name as first argument.
240
241TGTextEditor::TGTextEditor(const char *filename, const TGWindow *p, UInt_t w,
242 UInt_t h) : TGMainFrame(p, w, h)
243{
244 Build();
245 if (p && p != gClient->GetDefaultRoot()) {
246 // special case for TRootBrowser
247 // remove the command line combo box and its associated label
253 fToolBar->Layout();
254 }
255 if (filename) {
256 LoadFile(filename);
257 }
258 MapWindow();
259}
260
261////////////////////////////////////////////////////////////////////////////////
262/// TGTextEditor constructor with pointer to a TMacro as first argument.
263
265 TGMainFrame(p, w, h)
266{
267 TString tmp;
268 Build();
269 if (p && p != gClient->GetDefaultRoot()) {
270 // special case for TRootBrowser
271 // remove the command line combo box and its associated label
276 fToolBar->Layout();
277 }
278 if (macro) {
279 fMacro = macro;
280 TIter next(macro->GetListOfLines());
281 TObjString *obj;
282 while ((obj = (TObjString*) next())) {
283 fTextEdit->AddLine(obj->GetName());
284 }
285 tmp.Form("TMacro : %s: %ld lines read.",
286 macro->GetName(), fTextEdit->ReturnLineCount());
287 fStatusBar->SetText(tmp.Data(), 0);
288 fFilename = macro->GetName();
289 fFilename += ".C";
290 tmp.Form("TMacro : %s - TGTextEditor", macro->GetName());
291 SetWindowName(tmp.Data());
292 }
293 MapWindow();
294}
295
296////////////////////////////////////////////////////////////////////////////////
297/// TGTextEditor destructor.
298
300{
301 gApplication->Disconnect("Terminate(Int_t)");
302 if (fTimer) delete fTimer;
303 if (fMenuFile) delete fMenuFile;
304 if (fMenuEdit) delete fMenuEdit;
305 if (fMenuSearch) delete fMenuSearch;
306 if (fMenuTools) delete fMenuTools;
307 if (fMenuHelp) delete fMenuHelp;
308}
309
310////////////////////////////////////////////////////////////////////////////////
311/// Delete TGTextEditor Window.
312
314{
315 gApplication->Disconnect("Terminate(Int_t)");
316 delete fTimer; fTimer = 0;
317 delete fMenuFile; fMenuFile = 0;
318 delete fMenuEdit; fMenuEdit = 0;
319 delete fMenuSearch; fMenuSearch = 0;
320 delete fMenuTools; fMenuTools = 0;
321 delete fMenuHelp; fMenuHelp = 0;
322 Cleanup();
324}
325
326////////////////////////////////////////////////////////////////////////////////
327/// Build TGTextEditor widget.
328
330{
334
338 fMenuFile->AddEntry("&Open...", kM_FILE_OPEN);
339 fMenuFile->AddEntry("&Close", kM_FILE_CLOSE);
341 fMenuFile->AddEntry("Save &As...", kM_FILE_SAVEAS);
343 fMenuFile->AddEntry("&Print...", kM_FILE_PRINT);
346
348 fMenuEdit->AddEntry("Cu&t\tCtrl+X", kM_EDIT_CUT);
349 fMenuEdit->AddEntry("&Copy\tCtrl+C", kM_EDIT_COPY);
350 fMenuEdit->AddEntry("&Paste\tCtrl+V", kM_EDIT_PASTE);
351 fMenuEdit->AddEntry("De&lete\tDel", kM_EDIT_DELETE);
353 fMenuEdit->AddEntry("Select &All\tCtrl+A", kM_EDIT_SELECTALL);
355 fMenuEdit->AddEntry("Set &Font", kM_EDIT_SELFONT);
356
358 fMenuTools->AddEntry("&Compile Macro\tCtrl+F7", kM_TOOLS_COMPILE);
359 fMenuTools->AddEntry("&Execute Macro\tCtrl+F5", kM_TOOLS_EXECUTE);
360 fMenuTools->AddEntry("&Interrupt\tShift+F5", kM_TOOLS_INTERRUPT);
361
366
368 fMenuSearch->AddEntry("&Find...\tCtrl+F", kM_SEARCH_FIND);
369 fMenuSearch->AddEntry("Find &Next\tF3", kM_SEARCH_FINDNEXT);
371 fMenuSearch->AddEntry("&Goto Line...\tCtrl+L", kM_SEARCH_GOTO);
372
374 fMenuHelp->AddEntry("&Help Topics\tF1", kM_HELP_CONTENTS);
376 fMenuHelp->AddEntry("&About...", kM_HELP_ABOUT);
377
378 fMenuFile->Associate(this);
379 fMenuEdit->Associate(this);
380 fMenuSearch->Associate(this);
381 fMenuTools->Associate(this);
382 fMenuHelp->Associate(this);
383
384 fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
391 kLHintsRight));
393
394 //---- toolbar
395
397 new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0,0,2,2));
398 Int_t i,spacing = 8;
399 fToolBar = new TGToolBar(this, 60, 20, kHorizontalFrame);
401 for (i = 0; fTbData[i].fPixmap; i++) {
402 if (strlen(fTbData[i].fPixmap) == 0) {
403 spacing = 8;
404 continue;
405 }
406 fToolBar->AddButton(this, &fTbData[i], spacing);
407 spacing = 0;
408 }
409 fComboCmd = new TGComboBox(fToolBar, "");
412 fCommand->Associate(this);
415 kLHintsRight, 5, 5, 1, 1));
416
417 fToolBar->AddFrame(fLabel = new TGLabel(fToolBar, "Command :"),
418 new TGLayoutHints(kLHintsCenterY | kLHintsRight, 5, 5, 1, 1));
420 0, 0, 0, 0));
422 new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0,0,2,2));
423
428
429 fTextEdit = new TGTextEdit(this, 10, 10, 1);
430 if (gClient->GetStyle() < 2) {
431 Pixel_t pxl;
432 gClient->GetColorByName("#3399ff", pxl);
435 }
436 fTextEdit->Associate(this);
438
439 Int_t parts[] = { 75, 25 };
440 fStatusBar = new TGStatusBar(this);
442 fStatusBar->SetParts(parts, 2);
444
445 SetClassHints("ROOT", "TGTextEditor");
446 SetWindowName("Untitled - TGTextEditor");
447
448 fMacro = 0;
449 fFilename = "Untitled";
451
455 fTextEdit->Connect("DataChanged()", "TGTextEditor", this, "DataChanged()");
456 fTextEdit->Connect("Closed()", "TGTextEditor", this, "ClearText()");
457 fTextEdit->Connect("Opened()", "TGTextEditor", this, "ClearText()");
458 fTextEdit->Connect("DataDropped(char *)", "TGTextEditor", this, "DataDropped(char *)");
460
462 Resize(GetDefaultWidth() + 50, GetDefaultHeight() > 500 ? GetDefaultHeight() : 500);
463 Layout();
464
465 gApplication->Connect("Terminate(Int_t)", "TGTextEditor", this, "ClearText()");
466 gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_F3), 0, kTRUE);
467
470
471 fTimer = new TTimer(this, 250);
472 fTimer->Reset();
473 fTimer->TurnOn();
474
477}
478
479////////////////////////////////////////////////////////////////////////////////
480/// Update file information when receiving the signal
481/// DataDropped from TGTextEdit widget.
482
484{
485 TString tmp;
486 fFilename = fname;
487 tmp.Form("%s: %ld lines read.", fname, fTextEdit->ReturnLineCount());
488 fStatusBar->SetText(tmp, 0);
489 tmp.Form("%s - TGTextEditor", fname);
490 SetWindowName(tmp.Data());
491}
492
493////////////////////////////////////////////////////////////////////////////////
494/// Slot setting the fTextChanged flag to true when the text has been
495/// modified in fTextEdit
496
498{
500}
501
502////////////////////////////////////////////////////////////////////////////////
503/// Load a file into the editor. If fname is 0, a TGFileDialog will popup.
504
505void TGTextEditor::LoadFile(const char *fname)
506{
507 TString tmp;
508 TGFileInfo fi;
510 switch (IsSaved()) {
511 case kMBCancel:
512 return;
513 case kMBYes:
514 if (!fFilename.CompareTo("Untitled"))
515 SaveFileAs();
516 else
518 if (fTextChanged) {
519 return;
520 }
521 break;
522 case kMBNo:
523 break;
524 default:
525 return;
526 }
527 if (fname == 0) {
528 new TGFileDialog(fClient->GetDefaultRoot(), this, kFDOpen, &fi);
529 if (fi.fFilename && strlen(fi.fFilename)) {
530 fname = fi.fFilename;
531 }
532 }
533 if (fname) {
534 if (!fTextEdit->LoadFile(fname)) {
535 tmp.Form("Error opening file \"%s\"", fname);
536 new TGMsgBox(fClient->GetRoot(), this, "TGTextEditor",
538 } else {
539 fFilename = fname;
540 tmp.Form("%s: %ld lines read.", fname, fTextEdit->ReturnLineCount());
541 fStatusBar->SetText(tmp.Data(), 0);
542 tmp.Form("%s - TGTextEditor", fname);
543 SetWindowName(tmp.Data());
545 }
546 }
547 fTextEdit->Layout();
548}
549
550////////////////////////////////////////////////////////////////////////////////
551/// Save the edited text in the file "fname".
552
553void TGTextEditor::SaveFile(const char *fname)
554{
555 char *p;
556 TString tmp;
557
558 if (!fTextEdit->SaveFile(fname)) {
559 tmp.Form("Error saving file \"%s\"", fname);
560 new TGMsgBox(fClient->GetRoot(), this, "TGTextEditor",
562 return;
563 }
564 if ((p = (char *)strrchr(fname, '/')) == 0) {
565 p = (char *)fname;
566 } else {
567 ++p;
568 }
569 tmp.Form("%s: %ld lines written.", p, fTextEdit->ReturnLineCount());
570 fStatusBar->SetText(tmp.Data(), 0);
571
572 tmp.Form("%s - TGTextEditor", p);
573 SetWindowName(tmp.Data());
575}
576
577////////////////////////////////////////////////////////////////////////////////
578/// Save the edited text in a file selected with TGFileDialog.
579/// Shouldn't we create a backup file?
580
582{
583 TString workdir = gSystem->WorkingDirectory();
584 static TString dir(".");
585 static Bool_t overwr = kFALSE;
586 TGFileInfo fi;
588 fi.SetIniDir(dir);
589 fi.fOverwrite = overwr;
590 new TGFileDialog(fClient->GetDefaultRoot(), this, kFDSave, &fi);
591 gSystem->ChangeDirectory(workdir.Data());
592 overwr = fi.fOverwrite;
593 if (fi.fFilename && strlen(fi.fFilename)) {
595 fFilename = fi.fFilename;
596 return kTRUE;
597 }
598 return kFALSE;
599}
600
601////////////////////////////////////////////////////////////////////////////////
602/// Check if file has to be saved in case of modifications.
603
605{
606 Int_t ret;
607 TString tmp;
608 Int_t opt = (kMBYes | kMBNo);
609
610 tmp.Form("The text has been modified. Do you want to save the changes?");
611
612 if (!fTextChanged) {
613 return kMBNo;
614 } else {
615 if (fParent == gClient->GetDefaultRoot())
616 opt |= kMBCancel;
617 new TGMsgBox(fClient->GetRoot(), this, "TGTextEditor",
618 tmp.Data(), kMBIconExclamation, opt, &ret);
619 return ret;
620 }
621}
622
623////////////////////////////////////////////////////////////////////////////////
624/// Open the print dialog and send current buffer to printer.
625
627{
628 TString tmp;
629 Int_t ret = 0;
630 if (!gEPrinter) {
631 gEPrinter = StrDup("892_2_cor"); // use gEnv
632 gEPrintCommand = StrDup("xprint");
633 }
634 new TGPrintDialog(fClient->GetDefaultRoot(), this, 400, 150,
635 &gEPrinter, &gEPrintCommand, &ret);
636 if (ret) {
637 fTextEdit->Print();
638 tmp.Form("Printed: %s", fFilename.Data());
639 fStatusBar->SetText(tmp.Data(), 0);
640 }
641}
642
643////////////////////////////////////////////////////////////////////////////////
644/// Close TGTextEditor window.
645
647{
648 Bool_t reallyClose = kFALSE;
649 if (fExiting) {
650 return;
651 }
652 fExiting = kTRUE;
653 switch (IsSaved()) {
654 case kMBYes:
655 if (!fFilename.CompareTo("Untitled"))
657 else
659 // close the editor only if the text has been saved and the
660 // TGTextEditor is not embedded in the ROOT browser
661 reallyClose = (!fTextChanged || (fParent != gClient->GetDefaultRoot()));
662 break;
663 case kMBCancel:
664 reallyClose = kFALSE;
665 break;
666 case kMBNo:
667 reallyClose = kTRUE;
668 break;
669 }
670 if (reallyClose) {
671 gApplication->Disconnect("Terminate(Int_t)");
673 }
675}
676
677////////////////////////////////////////////////////////////////////////////////
678/// Keyboard event handler.
679
681{
682 char input[10];
683 UInt_t keysym;
684
685 if (event->fType == kGKeyPress) {
686 gVirtualX->LookupString(event, input, sizeof(input), keysym);
687
688 switch ((EKeySym)keysym) { // ignore these keys
689 case kKey_Shift:
690 case kKey_Control:
691 case kKey_Meta:
692 case kKey_Alt:
693 case kKey_CapsLock:
694 case kKey_NumLock:
695 case kKey_ScrollLock:
696 return kTRUE;
697 case kKey_F1:
700 return kTRUE;
701 case kKey_F3:
702 Search(kTRUE);
703 return kTRUE;
704 default:
705 break;
706 }
707 if (event->fState & kKeyControlMask) { // Ctrl key modifier pressed
708 switch((EKeySym)keysym) {
709 case kKey_F5:
710 ExecuteMacro();
711 return kTRUE;
712 case kKey_F7:
713 CompileMacro();
714 return kTRUE;
715 default:
716 break;
717 }
718 }
719 if (event->fState & kKeyShiftMask) { // Shift key modifier pressed
720 switch((EKeySym)keysym) {
721 case kKey_F5:
723 return kTRUE;
724 default:
725 break;
726 }
727 }
728 }
729 return TGMainFrame::HandleKey(event);
730}
731
732////////////////////////////////////////////////////////////////////////////////
733/// Clear text edit widget.
734
736{
737 fTextEdit->Clear();
738 fMacro = 0;
739 fFilename = "Untitled";
740 SetWindowName("Untitled - TGTextEditor");
741 fStatusBar->SetText("New File", 0);
743}
744
745////////////////////////////////////////////////////////////////////////////////
746/// Invokes search dialog, or just search previous string if again is true.
747
749{
750 if (again) {
753 }
754 else {
756 }
757}
758
759////////////////////////////////////////////////////////////////////////////////
760/// Invokes goto dialog, and go to the specified line.
761
763{
764 Long_t ret;
765
766 new TGGotoDialog(fClient->GetDefaultRoot(), this, 400, 150, &ret);
767
768 if (ret >= 0)
769 fTextEdit->Goto(ret-1);
770}
771
772////////////////////////////////////////////////////////////////////////////////
773/// Save the edited text in a temporary macro, then compile it.
774
776{
777 if (fTextEdit->ReturnLineCount() < 3)
778 return;
779 if ((fMacro) || (!fFilename.CompareTo("Untitled"))) {
780 if (!SaveFileAs())
781 return;
782 }
783 char *tmpfile = gSystem->ConcatFileName(gSystem->TempDirectory(),
785 fTextEdit->SaveFile(tmpfile, kFALSE);
786 gSystem->CompileMacro(tmpfile);
787 gSystem->Unlink(tmpfile);
788 delete [] tmpfile;
789}
790
791////////////////////////////////////////////////////////////////////////////////
792/// Save the edited text in a temporary macro, execute it, and then delete
793/// the temporary file.
794
796{
797 if (fTextEdit->ReturnLineCount() < 3)
798 return;
799 if (fMacro) {
800 fMacro->Exec();
801 return;
802 }
803 if (fTextChanged) {
804 Int_t ret;
805 new TGMsgBox(fClient->GetRoot(), this, "TGTextEditor",
806 "The text has been modified. Do you want to save the changes?",
808 if (ret == kMBYes) {
809 if (!fFilename.CompareTo("Untitled"))
810 SaveFileAs();
811 else
814 }
815 if (ret == kMBCancel)
816 return;
817 }
818 if (!fFilename.CompareTo("Untitled")) {
819 //if (!SaveFileAs())
820 // return;
821 fFilename += ".C";
822 }
823 gInterpreter->SaveContext();
824 TString savdir = gSystem->WorkingDirectory();
825 TString tmpfile = gSystem->BaseName(fFilename.Data());
826 tmpfile += "_exec";
828 fTextEdit->SaveFile(tmpfile.Data(), kFALSE);
829 gROOT->SetExecutingMacro(kTRUE);
830 gROOT->Macro(tmpfile.Data());
831 gROOT->SetExecutingMacro(kFALSE);
832 if (gInterpreter->IsLoaded(tmpfile.Data()))
833 gInterpreter->UnloadFile(tmpfile.Data());
834 gSystem->Unlink(tmpfile.Data());
835 gSystem->ChangeDirectory(savdir.Data());
836 gInterpreter->Reset();
837}
838
839////////////////////////////////////////////////////////////////////////////////
840/// Interrupt execution of a macro.
841
843{
844 gROOT->SetInterrupt(kTRUE);
845}
846
847////////////////////////////////////////////////////////////////////////////////
848/// Display ROOT splash screen.
849
851{
852#ifdef R__UNIX
853 TString rootx = TROOT::GetBinDir() + "/root -a &";
854 gSystem->Exec(rootx);
855#else
856#ifdef WIN32
858#else
859 char str[32];
860 sprintf(str, "About ROOT %s...", gROOT->GetVersion());
861 TRootHelpDialog *hd = new TRootHelpDialog(this, str, 600, 400);
862 hd->SetText(gHelpAbout);
863 hd->Popup();
864#endif
865#endif
866}
867
868////////////////////////////////////////////////////////////////////////////////
869/// Handle timer event.
870
872{
873 TString tmp;
874 if (t != fTimer) return kTRUE;
875 // check if some text is available in the clipboard
876 if ((gVirtualX->InheritsFrom("TGX11")) &&
877 (gVirtualX->GetPrimarySelectionOwner() == kNone)) {
880 }
881 else {
885 }
886 // check if text is selected in the editor
887 if (fTextEdit->IsMarked()) {
895 }
896 }
897 else {
905 }
906 }
907 // get cursor position
909 tmp.Form("Ln %ld, Ch %ld", pos.fY, pos.fX);
910 fStatusBar->SetText(tmp.Data(), 1);
911 fTimer->Reset();
912 return kTRUE;
913}
914
915////////////////////////////////////////////////////////////////////////////////
916/// Handle menu and other command generated by the user.
917
919{
920 TRootHelpDialog *hd;
921
922 switch(GET_MSG(msg)) {
923 case kC_COMMAND:
924 switch(GET_SUBMSG(msg)) {
925 case kCM_BUTTON:
926 case kCM_MENU:
927 switch (parm1) {
928 // "File" menu related events
929 case kM_FILE_NEW:
930 new TGTextEditor();
931 break;
932 case kM_FILE_OPEN:
933 LoadFile();
934 break;
935 case kM_FILE_CLOSE:
936 ClearText();
937 break;
938 case kM_FILE_SAVE:
939 if (!fFilename.CompareTo("Untitled"))
940 SaveFileAs();
941 else
943 break;
944 case kM_FILE_SAVEAS:
945 SaveFileAs();
946 break;
947 case kM_FILE_PRINT:
948 PrintText();
949 break;
950 case kM_FILE_EXIT:
951 CloseWindow();
952 break;
953
954 // "Edit" menu related events
955 case kM_EDIT_CUT:
956 fTextEdit->Cut();
957 break;
958 case kM_EDIT_COPY:
959 fTextEdit->Copy();
960 break;
961 case kM_EDIT_PASTE:
962 fTextEdit->Paste();
963 break;
964 case kM_EDIT_DELETE:
965 fTextEdit->Delete();
966 break;
969 if (fTextEdit->IsMarked()) {
977 }
978 }
979 break;
980 case kM_EDIT_SELFONT:
981 {
982 Int_t count;
983 TString fontname;
985 new TGFontDialog(fClient->GetRoot(), this, &prop);
986 if (prop.fName != "") {
987 fontname.Form("-*-%s-%s-%c-*-*-%d-*-*-*-*-*-*-*",
988 prop.fName.Data(),
989 prop.fBold ? "bold" : "medium",
990 prop.fItalic ? 'i' : 'r',
991 prop.fSize);
992 if (!gVirtualX->ListFonts(fontname, 10, count)) {
993 fontname.Form("-*-%s-%s-%c-*-*-%d-*-*-*-*-*-*-*",
994 prop.fName.Data(),
995 prop.fBold ? "bold" : "medium",
996 prop.fItalic ? 'o' : 'r',
997 prop.fSize);
998 }
999 TGFont *font = fClient->GetFont(fontname);
1000 if (font) {
1001 FontStruct_t editorfont = font->GetFontStruct();
1002 fTextEdit->SetFont(editorfont);
1003 fTextEdit->Update();
1004 }
1005 }
1006 }
1007 break;
1008
1009 // "Tools" menu related events
1010 case kM_TOOLS_COMPILE:
1011 CompileMacro();
1012 break;
1013 case kM_TOOLS_EXECUTE:
1014 ExecuteMacro();
1015 break;
1016 case kM_TOOLS_INTERRUPT:
1018 break;
1019
1020 // "Search" menu related events
1021 case kM_SEARCH_FIND:
1022 Search(kFALSE);
1023 break;
1024 case kM_SEARCH_FINDNEXT:
1025 Search(kTRUE);
1026 break;
1027 case kM_SEARCH_GOTO:
1028 Goto();
1029 break;
1030
1031 // "Help" menu related events
1032 case kM_HELP_CONTENTS:
1033 hd = new TRootHelpDialog(this, "Help on Editor...", 600, 400);
1035 hd->Popup();
1036 break;
1037 case kM_HELP_ABOUT:
1038 About();
1039 break;
1040 }
1041 break;
1042 }
1043 break;
1044 case kC_TEXTENTRY:
1045 switch (GET_SUBMSG(msg)) {
1046 case kTE_ENTER:
1047 {
1048 // here copy the string from text buffer to return variable
1049 const char *string = fCommandBuf->GetString();
1050 if(strlen(string) > 1) {
1051 gROOT->ProcessLine(string);
1053 }
1054 }
1055 break;
1056 default:
1057 break;
1058 }
1059 break;
1060
1061 default:
1062 break;
1063 }
1064 return kTRUE;
1065}
@ kGKeyPress
Definition: GuiTypes.h:59
const Mask_t kFocusChangeMask
Definition: GuiTypes.h:168
const Mask_t kKeyPressMask
Definition: GuiTypes.h:158
const Mask_t kKeyShiftMask
Definition: GuiTypes.h:194
@ kHorizontalFrame
Definition: GuiTypes.h:382
const Handle_t kNone
Definition: GuiTypes.h:87
const Mask_t kKeyControlMask
Definition: GuiTypes.h:196
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:167
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:165
const Mask_t kEnterWindowMask
Definition: GuiTypes.h:166
Handle_t FontStruct_t
Definition: GuiTypes.h:38
ULong_t Pixel_t
Definition: GuiTypes.h:39
R__EXTERN const char gHelpAbout[]
Definition: HelpText.h:14
R__EXTERN const char gHelpTextEditor[]
Definition: HelpText.h:24
EKeySym
Definition: KeySymbols.h:25
@ kKey_Meta
Definition: KeySymbols.h:51
@ kKey_F1
Definition: KeySymbols.h:57
@ kKey_CapsLock
Definition: KeySymbols.h:53
@ kKey_F5
Definition: KeySymbols.h:61
@ kKey_Alt
Definition: KeySymbols.h:52
@ kKey_ScrollLock
Definition: KeySymbols.h:55
@ kKey_F3
Definition: KeySymbols.h:59
@ kKey_Shift
Definition: KeySymbols.h:49
@ kKey_Control
Definition: KeySymbols.h:50
@ kKey_NumLock
Definition: KeySymbols.h:54
@ kKey_F7
Definition: KeySymbols.h:63
#define h(i)
Definition: RSha256.hxx:106
const Bool_t kFALSE
Definition: RtypesCore.h:90
long Long_t
Definition: RtypesCore.h:52
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassImp(name)
Definition: Rtypes.h:361
R__EXTERN TApplication * gApplication
Definition: TApplication.h:166
@ kButtonDisabled
Definition: TGButton.h:56
@ kButtonUp
Definition: TGButton.h:53
#define gClient
Definition: TGClient.h:166
@ kFDOpen
Definition: TGFileDialog.h:38
@ kFDSave
Definition: TGFileDialog.h:39
@ kDeepCleanup
Definition: TGFrame.h:51
@ kLHintsRight
Definition: TGLayout.h:33
@ kLHintsExpandY
Definition: TGLayout.h:38
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsCenterY
Definition: TGLayout.h:35
@ kLHintsBottom
Definition: TGLayout.h:36
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
@ kMBNo
Definition: TGMsgBox.h:43
@ kMBYes
Definition: TGMsgBox.h:42
@ kMBCancel
Definition: TGMsgBox.h:48
@ kMBOk
Definition: TGMsgBox.h:44
@ kMBIconExclamation
Definition: TGMsgBox.h:35
static char * gEPrinter
static char * gEPrintCommand
ETextEditorCommands
@ kM_TOOLS_EXECUTE
@ kM_HELP_ABOUT
@ kM_EDIT_SELFONT
@ kM_FILE_EXIT
@ kM_FILE_NEW
@ kM_EDIT_PASTE
@ kM_EDIT_CUT
@ kM_FILE_PRINT
@ kM_EDIT_DELETE
@ kM_SEARCH_GOTO
@ kM_EDIT_COPY
@ kM_TOOLS_COMPILE
@ kM_FILE_OPEN
@ kM_TOOLS_INTERRUPT
@ kM_EDIT_SELECTALL
@ kM_FILE_SAVEAS
@ kM_FILE_SAVE
@ kM_HELP_CONTENTS
@ kM_FILE_CLOSE
@ kM_SEARCH_FINDNEXT
@ kM_SEARCH_FIND
const char * ed_filetypes[]
ToolBarData_t fTbData[]
#define gInterpreter
Definition: TInterpreter.h:556
#define gROOT
Definition: TROOT.h:406
char * StrDup(const char *str)
Duplicate the string str.
Definition: TString.cxx:2490
R__EXTERN TSystem * gSystem
Definition: TSystem.h:556
#define gVirtualX
Definition: TVirtualX.h:338
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Int_t GET_MSG(Long_t val)
@ kCM_MENU
@ kTE_ENTER
@ kC_COMMAND
@ kCM_BUTTON
@ kC_TEXTENTRY
Int_t GET_SUBMSG(Long_t val)
virtual EButtonState GetState() const
Definition: TGButton.h:112
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:187
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:234
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition: TGClient.cxx:224
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get a font from the font pool.
Definition: TGClient.cxx:348
virtual TGTextEntry * GetTextEntry() const
Definition: TGComboBox.h:131
virtual void ReturnPressed()
Add new entry to combo box when return key pressed inside text entry ReturnPressed signal is emitted.
Definition: TGComboBox.cxx:656
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:349
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition: TGFrame.cxx:951
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1241
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1056
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1148
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:351
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1133
char * fFilename
Definition: TGFileDialog.h:61
const char ** fFileTypes
Definition: TGFileDialog.h:63
Bool_t fOverwrite
Definition: TGFileDialog.h:65
void SetIniDir(const char *inidir)
Set directory name.
Definition: TGFont.h:149
FontStruct_t GetFontStruct() const
Definition: TGFont.h:193
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:323
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:693
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:216
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:629
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:260
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
virtual void MapWindow()
map window
Definition: TGFrame.h:229
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
Definition: TGFrame.cxx:1816
virtual void CloseWindow()
Close and delete main frame.
Definition: TGFrame.cxx:1730
virtual Bool_t HandleKey(Event_t *event)
Handle keyboard events.
Definition: TGFrame.cxx:1566
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1748
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
Add popup menu to menu bar.
Definition: TGMenu.cxx:416
TGClient * fClient
Definition: TGObject.h:37
Handle_t fId
Definition: TGObject.h:36
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=0, const TGPicture *p=0, TGMenuEntry *before=0)
Add a menu entry.
Definition: TGMenu.cxx:988
virtual void AddSeparator(TGMenuEntry *before=0)
Add a menu separator to the menu.
Definition: TGMenu.cxx:1058
virtual void DisableEntry(Int_t id)
Disable entry (disabled entries appear in a sunken relieve).
Definition: TGMenu.cxx:1722
virtual void EnableEntry(Int_t id)
Enable entry. By default entries are enabled.
Definition: TGMenu.cxx:1703
virtual void Associate(const TGWindow *w)
Definition: TGMenu.h:219
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
Definition: TGTextBuffer.h:47
virtual Bool_t Goto(Long_t line, Long_t column=0)
Goto the specified line.
Definition: TGTextEdit.cxx:738
@ kM_SEARCH_FINDAGAIN
Definition: TGTextEdit.h:43
@ kM_FILE_OPEN
Definition: TGTextEdit.h:41
TGPopupMenu * GetMenu() const
Definition: TGTextEdit.h:110
virtual Bool_t SaveFile(const char *fname, Bool_t saveas=kFALSE)
Save file.
Definition: TGTextEdit.cxx:388
virtual Bool_t Cut()
Cut text.
Definition: TGTextEdit.cxx:442
TGLongPosition GetCurrentPos() const
Definition: TGTextEdit.h:122
virtual void Print(Option_t *="") const
Send current buffer to printer.
Definition: TGTextEdit.cxx:477
virtual void Clear(Option_t *="")
Clear text edit widget.
Definition: TGTextEdit.cxx:376
virtual void Delete(Option_t *="")
Delete selection.
Definition: TGTextEdit.cxx:532
virtual Bool_t Search(const char *string, Bool_t direction=kTRUE, Bool_t caseSensitive=kFALSE)
Search for string in the specified direction.
Definition: TGTextEdit.cxx:634
virtual Bool_t Paste()
Paste text into widget.
Definition: TGTextEdit.cxx:455
virtual void SetFocus()
Definition: TGTextEdit.h:119
virtual void Copy(TObject &) const
Copy this to obj.
Definition: TGTextEdit.h:70
virtual void DeleteWindow()
Delete TGTextEditor Window.
virtual Bool_t HandleKey(Event_t *event)
Keyboard event handler.
TGStatusBar * fStatusBar
Definition: TGTextEditor.h:44
Bool_t fTextChanged
Definition: TGTextEditor.h:60
TGPopupMenu * fMenuTools
Definition: TGTextEditor.h:57
void DataChanged()
Slot setting the fTextChanged flag to true when the text has been modified in fTextEdit.
TString fFilename
Definition: TGTextEditor.h:61
void InterruptMacro()
Interrupt execution of a macro.
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
Definition: TGTextEditor.h:43
TGPopupMenu * fMenuFile
Definition: TGTextEditor.h:54
TGLayoutHints * fMenuBarLayout
Definition: TGTextEditor.h:51
TGTextEntry * fCommand
Definition: TGTextEditor.h:49
TGLabel * fLabel
Definition: TGTextEditor.h:47
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.
void ClearText()
Clear text edit widget.
virtual void Build()
Build TGTextEditor widget.
virtual void CloseWindow()
Close TGTextEditor window.
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
Definition: TGTextEditor.h:62
virtual Bool_t HandleTimer(TTimer *t)
Handle timer event.
TGMenuBar * fMenuBar
Definition: TGTextEditor.h:53
TGTextEdit * fTextEdit
Definition: TGTextEditor.h:46
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Handle menu and other command generated by the user.
void PrintText()
Open the print dialog and send current buffer to printer.
TGLayoutHints * fMenuBarItemLayout
Definition: TGTextEditor.h:52
void SaveFile(const char *fname)
Save the edited text in the file "fname".
TGComboBox * fComboCmd
Definition: TGTextEditor.h:48
TGPopupMenu * fMenuEdit
Definition: TGTextEditor.h:55
TGPopupMenu * fMenuSearch
Definition: TGTextEditor.h:56
TGTextEditor(const char *filename=0, const TGWindow *p=0, UInt_t w=900, UInt_t h=600)
TGTextEditor constructor with file name as first argument.
virtual ~TGTextEditor()
TGTextEditor destructor.
TGTextBuffer * fCommandBuf
Definition: TGTextEditor.h:50
TGPopupMenu * fMenuHelp
Definition: TGTextEditor.h:58
void LoadFile(const char *fname=0)
Load a file into the editor. If fname is 0, a TGFileDialog will popup.
TGToolBar * fToolBar
Definition: TGTextEditor.h:45
Bool_t fExiting
Definition: TGTextEditor.h:59
TGTextBuffer * GetBuffer() const
Definition: TGTextEntry.h:127
virtual void Update()
update the whole window of text view
Definition: TGTextView.cxx:261
virtual Bool_t LoadFile(const char *fname, long startpos=0, long length=-1)
Load a file in the text view widget.
Definition: TGTextView.cxx:453
Bool_t IsMarked() const
Definition: TGTextView.h:130
virtual void AddLine(const char *string)
Add a line of text to the view widget.
Definition: TGTextView.cxx:228
virtual Bool_t SelectAll()
Select all text in the viewer.
Definition: TGTextView.cxx:516
virtual void Layout()
Layout the components of view.
virtual void SetSelectBack(Pixel_t p)
set selected text background color
Definition: TGTextView.cxx:178
virtual Long_t ReturnLineCount()
Definition: TGTextView.h:105
virtual void SetFont(FontStruct_t font)
Changes text entry font.
Definition: TGTextView.cxx:332
virtual void SetSelectFore(Pixel_t p)
set selected text color
Definition: TGTextView.cxx:187
virtual TGButton * AddButton(const TGWindow *w, ToolBarData_t *button, Int_t spacing=0)
Add button to toolbar.
Definition: TGToolBar.cxx:91
virtual TGButton * GetButton(Int_t id) const
Finds and returns a pointer to the button with the specified identifier id.
Definition: TGToolBar.cxx:156
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
const TGWindow * fParent
Definition: TGWindow.h:36
Class supporting a collection of lines with C++ code.
Definition: TMacro.h:31
virtual Long_t Exec(const char *params=0, Int_t *error=0)
Execute this macro with params, if params is 0, default parameters (set via SetParams) are used.
Definition: TMacro.cxx:266
TList * GetListOfLines() const
Definition: TMacro.h:51
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Collectable string class.
Definition: TObjString.h:28
const char * GetName() const
Returns name of object.
Definition: TObjString.h:38
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.
Definition: TQObject.cxx:866
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1024
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
Definition: TROOT.cxx:2887
void SetText(const char *helpText)
Set help text from helpText buffer in TGTextView.
void Popup()
Show help dialog.
Basic string class.
Definition: TString.h:131
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Definition: TString.cxx:418
const char * Data() const
Definition: TString.h:364
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
Definition: TSystem.cxx:1066
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition: TSystem.cxx:651
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
Definition: TSystem.cxx:858
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:930
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".
Definition: TSystem.cxx:2831
virtual const char * WorkingDirectory()
Return working directory.
Definition: TSystem.cxx:867
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:1027
virtual int Unlink(const char *name)
Unlink, i.e.
Definition: TSystem.cxx:1376
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
Definition: TSystem.cxx:1477
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
virtual void TurnOn()
Add the timer to the system timer list.
Definition: TTimer.cxx:241
void Reset()
Reset the timer.
Definition: TTimer.cxx:157
EGEventType fType
Definition: GuiTypes.h:174
UInt_t fState
Definition: GuiTypes.h:180
const char * fPixmap
Definition: TGToolBar.h:33