Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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/** \class TGTextEditor
25 \ingroup guiwidgets
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| Up | Move cursor up. |
125| Shift+Up | Move cursor up and extend selection. |
126| Down | Move cursor down. |
127| Shift+Down | Move cursor down and extend selection. |
128| Left | Move cursor left. |
129| Shift+Left | Move cursor left and extend selection. |
130| Right | Move cursor right. |
131| Shift+Right | Move cursor right and extend selection. |
132| Home | Move cursor to begin of line. |
133| Shift+Home | Move cursor to begin of line and extend selection. |
134| Ctrl+Home | Move cursor to top of page. |
135| End | Move cursor to end of line. |
136| Shift+End | Move cursor to end of line and extend selection. |
137| Ctrl+End | Move cursor to end of page. |
138| PgUp | Move cursor up one page. |
139| Shift+PgUp | Move cursor up one page and extend selection. |
140| PgDn | Move cursor down one page. |
141| Shift+PgDn | Move cursor down one page and extend selection. |
142| Delete | Delete character after cursor, or text selection. |
143| BackSpace | Delete character before cursor, or text selection. |
144| Ctrl+B | Move cursor left. |
145| Ctrl+D | Delete character after cursor, or text selection. |
146| Ctrl+E | Move cursor to end of line. |
147| Ctrl+H | Delete character before cursor, or text selection. |
148| Ctrl+K | Delete characters from current position to the end of line. |
149| Ctrl+U | Delete current line. |
150
151
152*/
153
154
155#include "TROOT.h"
156#include "TApplication.h"
157#include "TSystem.h"
158#include "TMacro.h"
159#include "TInterpreter.h"
160#include "TGMsgBox.h"
161#include "TGFileDialog.h"
162#include "TGFontDialog.h"
163#include "TGTextEdit.h"
164#include "TGMenu.h"
165#include "TGStatusBar.h"
166#include "KeySymbols.h"
167#include "TGToolBar.h"
168#include "TG3DLine.h"
169#include "TGLabel.h"
170#include "TGTextEntry.h"
171#include "TGTextEditDialogs.h"
172#include "TGTextEditor.h"
173#include "TGComboBox.h"
174#include "TObjString.h"
175#include "TRootHelpDialog.h"
176#include "HelpText.h"
177#include "TVirtualX.h"
178#ifdef WIN32
179#include "TWin32SplashThread.h"
180#endif
181
182const char *ed_filetypes[] = {
183 "ROOT Macros", "*.C",
184 "Source files", "*.cxx",
185 "Text files", "*.txt",
186 "All files", "*",
187 0, 0
188};
189
197
199 { "ed_new.png", "New File", kFALSE, kM_FILE_NEW, 0 },
200 { "ed_open.png", "Open File", kFALSE, kM_FILE_OPEN, 0 },
201 { "ed_save.png", "Save File", kFALSE, kM_FILE_SAVE, 0 },
202 { "ed_saveas.png", "Save File As...", kFALSE, kM_FILE_SAVEAS, 0 },
203 { "", 0, 0, -1, 0 },
204 { "ed_print.png", "Print", kFALSE, kM_FILE_PRINT, 0 },
205 { "", 0, 0, -1, 0 },
206 { "ed_cut.png", "Cut selection", kFALSE, kM_EDIT_CUT, 0 },
207 { "ed_copy.png", "Copy selection", kFALSE, kM_EDIT_COPY, 0 },
208 { "ed_paste.png", "Paste selection", kFALSE, kM_EDIT_PASTE, 0 },
209 { "ed_delete.png", "Delete selection", kFALSE, kM_EDIT_DELETE, 0 },
210 { "", 0, 0, -1, 0 },
211 { "ed_find.png", "Find...", kFALSE, kM_SEARCH_FIND, 0 },
212 { "ed_findnext.png", "Find next", kFALSE, kM_SEARCH_FINDNEXT, 0 },
213 { "ed_goto.png", "Goto...", kFALSE, kM_SEARCH_GOTO, 0 },
214 { "", 0, 0, -1, 0 },
215 { "ed_compile.png", "Compile Macro", kFALSE, kM_TOOLS_COMPILE, 0 },
216 { "ed_execute.png", "Execute Macro", kFALSE, kM_TOOLS_EXECUTE, 0 },
217 { "ed_interrupt.png", "Interrupt", kFALSE, kM_TOOLS_INTERRUPT, 0 },
218 { "", 0, 0, -1, 0 },
219 { "ed_help.png", "Help Contents", kFALSE, kM_HELP_CONTENTS, 0 },
220 { "", 0, 0, -1, 0 },
221 { "ed_quit.png", "Close Editor", kFALSE, kM_FILE_EXIT, 0 },
222 { 0, 0, 0, 0, 0 }
223};
224
225static char *gEPrinter = 0;
226static char *gEPrintCommand = 0;
227
228
229////////////////////////////////////////////////////////////////////////////////
230/// TGTextEditor constructor with file name as first argument.
231
233 UInt_t h) : TGMainFrame(p, w, h)
234{
235 Build();
236 if (p && p != gClient->GetDefaultRoot()) {
237 // special case for TRootBrowser
238 // remove the command line combo box and its associated label
243 if (auto btn = fToolBar->GetButton(kM_FILE_EXIT); btn) btn->SetState(kButtonDisabled);
244 fToolBar->Layout();
245 }
246 if (filename) {
248 }
249 MapWindow();
250}
251
252////////////////////////////////////////////////////////////////////////////////
253/// TGTextEditor constructor with pointer to a TMacro as first argument.
254
256 TGMainFrame(p, w, h)
257{
258 TString tmp;
259 Build();
260 if (p && p != gClient->GetDefaultRoot()) {
261 // special case for TRootBrowser
262 // remove the command line combo box and its associated label
267 fToolBar->Layout();
268 }
269 if (macro) {
270 fMacro = macro;
271 TIter next(macro->GetListOfLines());
272 TObjString *obj;
273 while ((obj = (TObjString*) next())) {
274 fTextEdit->AddLine(obj->GetName());
275 }
276 tmp.Form("TMacro : %s: %ld lines read.",
277 macro->GetName(), fTextEdit->ReturnLineCount());
278 fStatusBar->SetText(tmp.Data(), 0);
279 fFilename = macro->GetName();
280 fFilename += ".C";
281 tmp.Form("TMacro : %s - TGTextEditor", macro->GetName());
282 SetWindowName(tmp.Data());
283 }
284 MapWindow();
285}
286
287////////////////////////////////////////////////////////////////////////////////
288/// TGTextEditor destructor.
289
291{
292 gApplication->Disconnect("Terminate(Int_t)");
293 if (fTimer) delete fTimer;
294 if (fMenuFile) delete fMenuFile;
295 if (fMenuEdit) delete fMenuEdit;
296 if (fMenuSearch) delete fMenuSearch;
297 if (fMenuTools) delete fMenuTools;
298 if (fMenuHelp) delete fMenuHelp;
299}
300
301////////////////////////////////////////////////////////////////////////////////
302/// Delete TGTextEditor Window.
303
305{
306 gApplication->Disconnect("Terminate(Int_t)");
307 delete fTimer; fTimer = 0;
308 delete fMenuFile; fMenuFile = 0;
309 delete fMenuEdit; fMenuEdit = 0;
310 delete fMenuSearch; fMenuSearch = 0;
311 delete fMenuTools; fMenuTools = 0;
312 delete fMenuHelp; fMenuHelp = 0;
313 Cleanup();
315}
316
317////////////////////////////////////////////////////////////////////////////////
318/// Build TGTextEditor widget.
319
321{
325
329 fMenuFile->AddEntry("&Open...", kM_FILE_OPEN);
330 fMenuFile->AddEntry("&Close", kM_FILE_CLOSE);
332 fMenuFile->AddEntry("Save &As...", kM_FILE_SAVEAS);
334 fMenuFile->AddEntry("&Print...", kM_FILE_PRINT);
337
339 fMenuEdit->AddEntry("Cu&t\tCtrl+X", kM_EDIT_CUT);
340 fMenuEdit->AddEntry("&Copy\tCtrl+C", kM_EDIT_COPY);
341 fMenuEdit->AddEntry("&Paste\tCtrl+V", kM_EDIT_PASTE);
342 fMenuEdit->AddEntry("De&lete\tDel", kM_EDIT_DELETE);
344 fMenuEdit->AddEntry("Select &All\tCtrl+A", kM_EDIT_SELECTALL);
346 fMenuEdit->AddEntry("Set &Font", kM_EDIT_SELFONT);
347
349 fMenuTools->AddEntry("&Compile Macro\tCtrl+F7", kM_TOOLS_COMPILE);
350 fMenuTools->AddEntry("&Execute Macro\tCtrl+F5", kM_TOOLS_EXECUTE);
351 fMenuTools->AddEntry("&Interrupt\tShift+F5", kM_TOOLS_INTERRUPT);
352
357
359 fMenuSearch->AddEntry("&Find...\tCtrl+F", kM_SEARCH_FIND);
360 fMenuSearch->AddEntry("Find &Next\tF3", kM_SEARCH_FINDNEXT);
362 fMenuSearch->AddEntry("&Goto Line...\tCtrl+L", kM_SEARCH_GOTO);
363
365 fMenuHelp->AddEntry("&Help Topics\tF1", kM_HELP_CONTENTS);
367 fMenuHelp->AddEntry("&About...", kM_HELP_ABOUT);
368
369 fMenuFile->Associate(this);
370 fMenuEdit->Associate(this);
371 fMenuSearch->Associate(this);
372 fMenuTools->Associate(this);
373 fMenuHelp->Associate(this);
374
375 fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
382 kLHintsRight));
384
385 //---- toolbar
386
388 new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0,0,2,2));
389 Int_t i,spacing = 8;
390 fToolBar = new TGToolBar(this, 60, 20, kHorizontalFrame);
392 for (i = 0; fTbData[i].fPixmap; i++) {
393 if (strlen(fTbData[i].fPixmap) == 0) {
394 spacing = 8;
395 continue;
396 }
397 fToolBar->AddButton(this, &fTbData[i], spacing);
398 spacing = 0;
399 }
400 fComboCmd = new TGComboBox(fToolBar, "");
403 fCommand->Associate(this);
406 kLHintsRight, 5, 5, 1, 1));
407
408 fToolBar->AddFrame(fLabel = new TGLabel(fToolBar, "Command :"),
409 new TGLayoutHints(kLHintsCenterY | kLHintsRight, 5, 5, 1, 1));
411 0, 0, 0, 0));
413 new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0,0,2,2));
414
415 if (auto btn = fToolBar->GetButton(kM_EDIT_CUT); btn) btn->SetState(kButtonDisabled);
416 if (auto btn = fToolBar->GetButton(kM_EDIT_COPY); btn) btn->SetState(kButtonDisabled);
417 if (auto btn = fToolBar->GetButton(kM_EDIT_DELETE); btn) btn->SetState(kButtonDisabled);
418 if (auto btn = fToolBar->GetButton(kM_EDIT_PASTE); btn) btn->SetState(kButtonDisabled);
419
420 fTextEdit = new TGTextEdit(this, 10, 10, 1);
421 if (gClient->GetStyle() < 2) {
422 Pixel_t pxl;
423 gClient->GetColorByName("#3399ff", pxl);
426 }
427 fTextEdit->Associate(this);
429
430 Int_t parts[] = { 75, 25 };
431 fStatusBar = new TGStatusBar(this);
435
436 SetClassHints("ROOT", "TGTextEditor");
437 SetWindowName("Untitled - TGTextEditor");
438
439 fMacro = 0;
440 fFilename = "Untitled";
442
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 *)");
451
453 Resize(GetDefaultWidth() + 50, GetDefaultHeight() > 500 ? GetDefaultHeight() : 500);
454 Layout();
455
456 gApplication->Connect("Terminate(Int_t)", "TGTextEditor", this, "ClearText()");
457 gVirtualX->GrabKey(fId, gVirtualX->KeysymToKeycode(kKey_F3), 0, kTRUE);
458
461
462 fTimer = new TTimer(this, 250);
463 fTimer->Reset();
464 fTimer->TurnOn();
465
468}
469
470////////////////////////////////////////////////////////////////////////////////
471/// Update file information when receiving the signal
472/// DataDropped from TGTextEdit widget.
473
475{
476 TString tmp;
478 tmp.Form("%s: %ld lines read.", fname, fTextEdit->ReturnLineCount());
479 fStatusBar->SetText(tmp, 0);
480 tmp.Form("%s - TGTextEditor", fname);
481 SetWindowName(tmp.Data());
482}
483
484////////////////////////////////////////////////////////////////////////////////
485/// Slot setting the fTextChanged flag to true when the text has been
486/// modified in fTextEdit
487
492
493////////////////////////////////////////////////////////////////////////////////
494/// Load a file into the editor. If fname is 0, a TGFileDialog will popup.
495
497{
498 TString tmp;
500 fi.fFileTypes = ed_filetypes;
501 switch (IsSaved()) {
502 case kMBCancel:
503 return;
504 case kMBYes:
505 if (!fFilename.CompareTo("Untitled"))
506 SaveFileAs();
507 else
509 if (fTextChanged) {
510 return;
511 }
512 break;
513 case kMBNo:
514 break;
515 default:
516 return;
517 }
518 if (fname == 0) {
520 if (fi.fFilename && strlen(fi.fFilename)) {
521 fname = fi.fFilename;
522 }
523 }
524 if (fname) {
525 if (!fTextEdit->LoadFile(fname)) {
526 tmp.Form("Error opening file \"%s\"", fname);
527 new TGMsgBox(fClient->GetRoot(), this, "TGTextEditor",
528 tmp.Data(), kMBIconExclamation, kMBOk);
529 } else {
531 tmp.Form("%s: %ld lines read.", fname, fTextEdit->ReturnLineCount());
532 fStatusBar->SetText(tmp.Data(), 0);
533 tmp.Form("%s - TGTextEditor", fname);
534 SetWindowName(tmp.Data());
536 }
537 }
538 fTextEdit->Layout();
539}
540
541////////////////////////////////////////////////////////////////////////////////
542/// Save the edited text in the file "fname".
543
545{
546 char *p;
547 TString tmp;
548
549 if (!fTextEdit->SaveFile(fname)) {
550 tmp.Form("Error saving file \"%s\"", fname);
551 new TGMsgBox(fClient->GetRoot(), this, "TGTextEditor",
552 tmp.Data(), kMBIconExclamation, kMBOk);
553 return;
554 }
555 if ((p = (char *)strrchr(fname, '/')) == 0) {
556 p = (char *)fname;
557 } else {
558 ++p;
559 }
560 tmp.Form("%s: %ld lines written.", p, fTextEdit->ReturnLineCount());
561 fStatusBar->SetText(tmp.Data(), 0);
562
563 tmp.Form("%s - TGTextEditor", p);
564 SetWindowName(tmp.Data());
566}
567
568////////////////////////////////////////////////////////////////////////////////
569/// Save the edited text in a file selected with TGFileDialog.
570/// Shouldn't we create a backup file?
571
573{
575 static TString dir(".");
576 static Bool_t overwr = kFALSE;
578 fi.fFileTypes = ed_filetypes;
579 fi.SetIniDir(dir);
580 fi.fOverwrite = overwr;
583 overwr = fi.fOverwrite;
584 if (fi.fFilename && strlen(fi.fFilename)) {
585 SaveFile(fi.fFilename);
586 fFilename = fi.fFilename;
587 return kTRUE;
588 }
589 return kFALSE;
590}
591
592////////////////////////////////////////////////////////////////////////////////
593/// Check if file has to be saved in case of modifications.
594
596{
597 Int_t ret;
598 TString tmp;
599 Int_t opt = (kMBYes | kMBNo);
600
601 tmp.Form("The text has been modified. Do you want to save the changes?");
602
603 if (!fTextChanged) {
604 return kMBNo;
605 } else {
606 if (fParent == gClient->GetDefaultRoot())
607 opt |= kMBCancel;
608 new TGMsgBox(fClient->GetRoot(), this, "TGTextEditor",
609 tmp.Data(), kMBIconExclamation, opt, &ret);
610 return ret;
611 }
612}
613
614////////////////////////////////////////////////////////////////////////////////
615/// Open the print dialog and send current buffer to printer.
616
618{
619 TString tmp;
620 Int_t ret = 0;
621 if (!gEPrinter) {
622 gEPrinter = StrDup("892_2_cor"); // use gEnv
623 gEPrintCommand = StrDup("xprint");
624 }
625 new TGPrintDialog(fClient->GetDefaultRoot(), this, 400, 150,
627 if (ret) {
628 fTextEdit->Print();
629 tmp.Form("Printed: %s", fFilename.Data());
630 fStatusBar->SetText(tmp.Data(), 0);
631 }
632}
633
634////////////////////////////////////////////////////////////////////////////////
635/// Close TGTextEditor window.
636
638{
640 if (fExiting) {
641 return;
642 }
643 fExiting = kTRUE;
644 switch (IsSaved()) {
645 case kMBYes:
646 if (!fFilename.CompareTo("Untitled"))
648 else
650 // close the editor only if the text has been saved and the
651 // TGTextEditor is not embedded in the ROOT browser
652 reallyClose = (!fTextChanged || (fParent != gClient->GetDefaultRoot()));
653 break;
654 case kMBCancel:
656 break;
657 case kMBNo:
659 break;
660 }
661 if (reallyClose) {
662 gApplication->Disconnect("Terminate(Int_t)");
664 }
666}
667
668////////////////////////////////////////////////////////////////////////////////
669/// Keyboard event handler.
670
672{
673 char input[10];
675
676 if (event->fType == kGKeyPress) {
677 gVirtualX->LookupString(event, input, sizeof(input), keysym);
678
679 switch ((EKeySym)keysym) { // ignore these keys
680 case kKey_Shift:
681 case kKey_Control:
682 case kKey_Meta:
683 case kKey_Alt:
684 case kKey_CapsLock:
685 case kKey_NumLock:
686 case kKey_ScrollLock:
687 return kTRUE;
688 case kKey_F1:
691 return kTRUE;
692 case kKey_F3:
693 Search(kTRUE);
694 return kTRUE;
695 default:
696 break;
697 }
698 if (event->fState & kKeyControlMask) { // Ctrl key modifier pressed
699 switch((EKeySym)keysym) {
700 case kKey_F5:
701 ExecuteMacro();
702 return kTRUE;
703 case kKey_F7:
704 CompileMacro();
705 return kTRUE;
706 default:
707 break;
708 }
709 }
710 if (event->fState & kKeyShiftMask) { // Shift key modifier pressed
711 switch((EKeySym)keysym) {
712 case kKey_F5:
714 return kTRUE;
715 default:
716 break;
717 }
718 }
719 }
720 return TGMainFrame::HandleKey(event);
721}
722
723////////////////////////////////////////////////////////////////////////////////
724/// Clear text edit widget.
725
727{
728 fTextEdit->Clear();
729 fMacro = 0;
730 fFilename = "Untitled";
731 SetWindowName("Untitled - TGTextEditor");
732 fStatusBar->SetText("New File", 0);
734}
735
736////////////////////////////////////////////////////////////////////////////////
737/// Invokes search dialog, or just search previous string if again is true.
738
749
750////////////////////////////////////////////////////////////////////////////////
751/// Invokes goto dialog, and go to the specified line.
752
754{
755 Long_t ret;
756
757 new TGGotoDialog(fClient->GetDefaultRoot(), this, 400, 150, &ret);
758
759 if (ret >= 0)
760 fTextEdit->Goto(ret-1);
761}
762
763////////////////////////////////////////////////////////////////////////////////
764/// Save the edited text in a temporary macro, then compile it.
765
767{
768 if (fTextEdit->ReturnLineCount() < 3)
769 return;
770 if ((fMacro) || (!fFilename.CompareTo("Untitled"))) {
771 if (!SaveFileAs())
772 return;
773 }
775 const char *tmpfile = gSystem->PrependPathName(gSystem->TempDirectory(), temp);
779}
780
781////////////////////////////////////////////////////////////////////////////////
782/// Save the edited text in a temporary macro, execute it, and then delete
783/// the temporary file.
784
786{
787 if (fTextEdit->ReturnLineCount() < 3)
788 return;
789 if (fMacro) {
790 fMacro->Exec();
791 return;
792 }
793 if (fTextChanged) {
794 Int_t ret;
795 new TGMsgBox(fClient->GetRoot(), this, "TGTextEditor",
796 "The text has been modified. Do you want to save the changes?",
798 if (ret == kMBYes) {
799 if (!fFilename.CompareTo("Untitled"))
800 SaveFileAs();
801 else
804 }
805 if (ret == kMBCancel)
806 return;
807 }
808 if (!fFilename.CompareTo("Untitled")) {
809 //if (!SaveFileAs())
810 // return;
811 fFilename += ".C";
812 }
813 gInterpreter->SaveContext();
816 tmpfile += "_exec";
819 gROOT->SetExecutingMacro(kTRUE);
820 gROOT->Macro(tmpfile.Data());
821 gROOT->SetExecutingMacro(kFALSE);
822 if (gInterpreter->IsLoaded(tmpfile.Data()))
823 gInterpreter->UnloadFile(tmpfile.Data());
824 gSystem->Unlink(tmpfile.Data());
826 gInterpreter->Reset();
827}
828
829////////////////////////////////////////////////////////////////////////////////
830/// Interrupt execution of a macro.
831
833{
834 gROOT->SetInterrupt(kTRUE);
835}
836
837////////////////////////////////////////////////////////////////////////////////
838/// Display ROOT splash screen.
839
841{
842#ifdef WIN32
844#else
845 char str[32];
846 snprintf(str, 32, "About ROOT %s...", gROOT->GetVersion());
847 TRootHelpDialog *hd = new TRootHelpDialog(this, str, 600, 400);
848 hd->SetText(gHelpAbout);
849 hd->Popup();
850#endif
851}
852
853////////////////////////////////////////////////////////////////////////////////
854/// Handle timer event.
855
857{
858 TString tmp;
859 if (t != fTimer) return kTRUE;
860 // check if some text is available in the clipboard
861 if ((gVirtualX->InheritsFrom("TGX11")) &&
862 (gVirtualX->GetPrimarySelectionOwner() == kNone)) {
865 }
866 else {
868 if (auto btn = fToolBar->GetButton(kM_EDIT_PASTE); btn && btn->GetState() == kButtonDisabled)
869 btn->SetState(kButtonUp);
870 }
871 // check if text is selected in the editor
872 if (fTextEdit->IsMarked()) {
876 if (fToolBar->GetButton(kM_EDIT_CUT)->GetState() == kButtonDisabled) {
880 }
881 }
882 else {
886 if (auto btn = fToolBar->GetButton(kM_EDIT_CUT); btn && btn->GetState() == kButtonUp) {
887 btn->SetState(kButtonDisabled);
890 }
891 }
892 // get cursor position
894 tmp.Form("Ln %ld, Ch %ld", pos.fY, pos.fX);
895 fStatusBar->SetText(tmp.Data(), 1);
896 fTimer->Reset();
897 return kTRUE;
898}
899
900////////////////////////////////////////////////////////////////////////////////
901/// Handle menu and other command generated by the user.
902
904{
906
907 switch(GET_MSG(msg)) {
908 case kC_COMMAND:
909 switch(GET_SUBMSG(msg)) {
910 case kCM_BUTTON:
911 case kCM_MENU:
912 switch (parm1) {
913 // "File" menu related events
914 case kM_FILE_NEW:
915 new TGTextEditor();
916 break;
917 case kM_FILE_OPEN:
918 LoadFile();
919 break;
920 case kM_FILE_CLOSE:
921 ClearText();
922 break;
923 case kM_FILE_SAVE:
924 if (!fFilename.CompareTo("Untitled"))
925 SaveFileAs();
926 else
928 break;
929 case kM_FILE_SAVEAS:
930 SaveFileAs();
931 break;
932 case kM_FILE_PRINT:
933 PrintText();
934 break;
935 case kM_FILE_EXIT:
936 CloseWindow();
937 break;
938
939 // "Edit" menu related events
940 case kM_EDIT_CUT:
941 fTextEdit->Cut();
942 break;
943 case kM_EDIT_COPY:
944 fTextEdit->Copy();
945 break;
946 case kM_EDIT_PASTE:
947 fTextEdit->Paste();
948 break;
949 case kM_EDIT_DELETE:
950 fTextEdit->Delete();
951 break;
954 if (fTextEdit->IsMarked()) {
958 if (fToolBar->GetButton(kM_EDIT_CUT)->GetState() == kButtonDisabled) {
962 }
963 }
964 break;
965 case kM_EDIT_SELFONT:
966 {
967 Int_t count;
970 new TGFontDialog(fClient->GetRoot(), this, &prop);
971 if (prop.fName != "") {
972 fontname.Form("-*-%s-%s-%c-*-*-%d-*-*-*-*-*-*-*",
973 prop.fName.Data(),
974 prop.fBold ? "bold" : "medium",
975 prop.fItalic ? 'i' : 'r',
976 prop.fSize);
977 if (!gVirtualX->ListFonts(fontname, 10, count)) {
978 fontname.Form("-*-%s-%s-%c-*-*-%d-*-*-*-*-*-*-*",
979 prop.fName.Data(),
980 prop.fBold ? "bold" : "medium",
981 prop.fItalic ? 'o' : 'r',
982 prop.fSize);
983 }
984 TGFont *font = fClient->GetFont(fontname);
985 if (font) {
988 fTextEdit->Update();
989 }
990 }
991 }
992 break;
993
994 // "Tools" menu related events
995 case kM_TOOLS_COMPILE:
996 CompileMacro();
997 break;
998 case kM_TOOLS_EXECUTE:
999 ExecuteMacro();
1000 break;
1001 case kM_TOOLS_INTERRUPT:
1003 break;
1004
1005 // "Search" menu related events
1006 case kM_SEARCH_FIND:
1007 Search(kFALSE);
1008 break;
1009 case kM_SEARCH_FINDNEXT:
1010 Search(kTRUE);
1011 break;
1012 case kM_SEARCH_GOTO:
1013 Goto();
1014 break;
1015
1016 // "Help" menu related events
1017 case kM_HELP_CONTENTS:
1018 hd = new TRootHelpDialog(this, "Help on Editor...", 600, 400);
1019 hd->SetText(gHelpTextEditor);
1020 hd->Popup();
1021 break;
1022 case kM_HELP_ABOUT:
1023 About();
1024 break;
1025 }
1026 break;
1027 }
1028 break;
1029 case kC_TEXTENTRY:
1030 switch (GET_SUBMSG(msg)) {
1031 case kTE_ENTER:
1032 {
1033 // here copy the string from text buffer to return variable
1034 const char *string = fCommandBuf->GetString();
1035 if(strlen(string) > 1) {
1036 gROOT->ProcessLine(string);
1038 }
1039 }
1040 break;
1041 default:
1042 break;
1043 }
1044 break;
1045
1046 default:
1047 break;
1048 }
1049 return kTRUE;
1050}
@ kGKeyPress
Definition GuiTypes.h:60
const Mask_t kFocusChangeMask
Definition GuiTypes.h:169
const Mask_t kKeyPressMask
Definition GuiTypes.h:159
const Mask_t kKeyShiftMask
Definition GuiTypes.h:195
@ kHorizontalFrame
Definition GuiTypes.h:382
const Handle_t kNone
Definition GuiTypes.h:88
const Mask_t kKeyControlMask
Definition GuiTypes.h:197
const Mask_t kLeaveWindowMask
Definition GuiTypes.h:168
const Mask_t kStructureNotifyMask
Definition GuiTypes.h:166
const Mask_t kEnterWindowMask
Definition GuiTypes.h:167
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
Handle_t FontStruct_t
Pointer to font structure.
Definition GuiTypes.h:39
R__EXTERN const char gHelpAbout[]
Definition HelpText.h:17
R__EXTERN const char gHelpTextEditor[]
Definition HelpText.h:27
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
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
Definition RtypesCore.h:89
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
Definition RtypesCore.h:68
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
R__EXTERN TApplication * gApplication
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
@ kButtonDisabled
Definition TGButton.h:56
@ kButtonUp
Definition TGButton.h:53
#define gClient
Definition TGClient.h:157
@ kFDOpen
@ kFDSave
@ kDeepCleanup
Definition TGFrame.h:42
@ kLHintsRight
Definition TGLayout.h:26
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsCenterY
Definition TGLayout.h:28
@ kLHintsBottom
Definition TGLayout.h:29
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
@ kMBNo
Definition TGMsgBox.h:32
@ kMBYes
Definition TGMsgBox.h:31
@ kMBCancel
Definition TGMsgBox.h:37
@ kMBOk
Definition TGMsgBox.h:33
@ kMBIconExclamation
Definition TGMsgBox.h:24
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[]
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
#define gInterpreter
#define gROOT
Definition TROOT.h:411
char * StrDup(const char *str)
Duplicate the string str.
Definition TString.cxx:2563
R__EXTERN TSystem * gSystem
Definition TSystem.h:572
#define gVirtualX
Definition TVirtualX.h:337
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)
#define snprintf
Definition civetweb.c:1579
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition TGClient.cxx:233
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition TGClient.cxx:223
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get a font from the font pool.
Definition TGClient.cxx:356
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
Definition TGComboBox.h:47
virtual TGTextEntry * GetTextEntry() const
Definition TGComboBox.h:111
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.
Definition TGFrame.cxx:1109
UInt_t GetDefaultWidth() const override
Definition TGFrame.h:314
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:959
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1156
UInt_t GetDefaultHeight() const override
Definition TGFrame.h:316
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1249
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1064
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition TGFrame.cxx:1141
This class creates a file selection dialog.
Font selection dialog, allowing to select one in the list of available fonts in the system.
Encapsulate fonts used in the GUI system.
Definition TGFont.h:140
FontStruct_t GetFontStruct() const
Definition TGFont.h:184
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition TGFrame.cxx:331
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:597
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition TGFrame.cxx:701
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:193
void MapWindow() override
map window
Definition TGFrame.h:206
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:268
void UnmapWindow() override
unmap window
Definition TGFrame.h:208
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
Definition TGFrame.cxx:637
A horizontal 3D line is a line that typically separates a toolbar from the menubar.
Definition TG3DLine.h:18
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
Long_t fX
x position
Definition TGDimension.h:56
Long_t fY
y position
Definition TGDimension.h:57
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:399
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
Definition TGFrame.cxx:1850
virtual void CloseWindow()
Close and delete main frame.
Definition TGFrame.cxx:1762
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1780
Bool_t HandleKey(Event_t *event) override
Handle keyboard events.
Definition TGFrame.cxx:1598
The TGMenu.h header contains all different menu classes.
Definition TGMenu.h:282
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=nullptr)
Add popup menu to menu bar.
Definition TGMenu.cxx:414
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Handle_t fId
X11/Win32 Window identifier.
Definition TGObject.h:24
This class creates a popup menu object.
Definition TGMenu.h:110
virtual void DisableEntry(Int_t id)
Disable entry (disabled entries appear in a sunken relieve).
Definition TGMenu.cxx:1720
virtual void EnableEntry(Int_t id)
Enable entry. By default entries are enabled.
Definition TGMenu.cxx:1701
virtual void Associate(const TGWindow *w)
Definition TGMenu.h:206
virtual void AddSeparator(TGMenuEntry *before=nullptr)
Add a menu separator to the menu.
Definition TGMenu.cxx:1056
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=nullptr, const TGPicture *p=nullptr, TGMenuEntry *before=nullptr)
Add a menu entry.
Definition TGMenu.cxx:986
Provides a StatusBar widget.
Definition TGStatusBar.h:21
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.
Definition TGTextEdit.h:22
@ kM_SEARCH_FINDAGAIN
Definition TGTextEdit.h:33
virtual Bool_t Goto(Long_t line, Long_t column=0)
Goto the specified line.
TGPopupMenu * GetMenu() const
Definition TGTextEdit.h:100
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
Definition TGTextEdit.h:112
void Clear(Option_t *="") override
Clear text edit widget.
void Copy(TObject &) const override
Copy this to obj.
Definition TGTextEdit.h:60
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.
virtual void SetFocus()
Definition TGTextEdit.h:109
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.
Bool_t IsMarked() const
Definition TGTextView.h:119
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()
Definition TGTextView.h:94
virtual void SetFont(FontStruct_t font)
Changes text entry font.
virtual void SetSelectFore(Pixel_t p)
set selected text color
A toolbar is a composite frame that contains TGPictureButtons.
Definition TGToolBar.h:33
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.
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:72
ROOT GUI Window base class.
Definition TGWindow.h:23
const TGWindow * fParent
Parent window.
Definition TGWindow.h:28
Class supporting a collection of lines with C++ code.
Definition TMacro.h:31
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.
Definition TMacro.cxx:261
Collectable string class.
Definition TObjString.h:28
const char * GetName() const override
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:865
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
A TRootHelpDialog is used to display help text (or any text in a dialog window).
Basic string class.
Definition TString.h:138
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
Definition TString.cxx:464
const char * Data() const
Definition TString.h:384
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
Definition TSystem.cxx:1092
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
Definition TSystem.cxx:872
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition TSystem.cxx:944
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:2847
virtual const char * WorkingDirectory()
Return working directory.
Definition TSystem.cxx:881
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
Definition TSystem.cxx:1042
virtual int Unlink(const char *name)
Unlink, i.e.
Definition TSystem.cxx:1392
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
Definition TSystem.cxx:1493
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:246
void Reset()
Reset the timer.
Definition TTimer.cxx:162
Event structure.
Definition GuiTypes.h:174
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:175
UInt_t fState
key or button mask
Definition GuiTypes.h:181
const char * fPixmap
Definition TGToolBar.h:24